Procházet zdrojové kódy

提货配置重量KG改成吨,列表查询条件优化

shasha před 1 měsícem
rodič
revize
11eb8c480c

+ 3 - 3
snowy-admin-web/src/views/biz/bizvehicle/index.vue

@@ -4,17 +4,17 @@
 			<a-row :gutter="24">
 				<a-col :span="6">
 					<a-form-item label="车牌号" name="licensePlate">
-						<a-input v-model:value="searchFormState.licensePlate" placeholder="请输入车牌号" />
+						<a-input v-model:value="searchFormState.licensePlate" placeholder="查询车牌号" />
 					</a-form-item>
 				</a-col>
 				<a-col :span="6">
 					<a-form-item label="司机姓名" name="driverName">
-						<a-input v-model:value="searchFormState.driverName" placeholder="请输入司机姓名" />
+						<a-input v-model:value="searchFormState.driverName" placeholder="查询司机姓名" />
 					</a-form-item>
 				</a-col>
 				<a-col :span="6">
 					<a-form-item label="司机电话" name="driverMobile">
-						<a-input v-model:value="searchFormState.driverMobile" placeholder="请输入司机电话" />
+						<a-input v-model:value="searchFormState.driverMobile" placeholder="查询司机电话" />
 					</a-form-item>
 				</a-col>
 				<a-col :span="6">

+ 28 - 11
snowy-admin-web/src/views/biz/customer/accountIndex.vue

@@ -22,9 +22,7 @@
 				</template>
 				<template v-if="column.dataIndex === 'action'">
 					<a-space>
-						<a-popconfirm title="确定要删除此账号吗?" v-if="hasPerm('customerAccountDelete')" @confirm="deleteCustomerAccount(record)">
-							<a-button type="link" danger size="small">删除</a-button>
-						</a-popconfirm>
+						<a-button type="link" danger size="small" v-if="hasPerm('customerAccountDelete')" @click="deleteConfig(record)">删除</a-button>
 					</a-space>
 				</template>
 			</template>
@@ -36,6 +34,9 @@
 <script setup name="accountForm">
 	import customerAccountApi from '@/api/biz/customerAccountApi'
 	import AccountAddForm from './accountAdd.vue'
+	import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
+	import {Modal} from 'ant-design-vue';
+	import {createVNode} from 'vue';
 
 	const columns = [
 		{
@@ -50,6 +51,7 @@
 			dataIndex: 'loginAccount'
 		},
 	]
+	const submitLoading = ref(false)
 	const toolConfig = { refresh: true, height: false, columnSetting: false, striped: false }
 	// 默认是关闭状态
 	const visible = ref(false)
@@ -87,14 +89,29 @@
 		visible.value = false
 	}
 	// 删除
-	const deleteCustomerAccount = (record) => {
-		let params = [
-			{
-				id: record.id
-			}
-		]
-		customerAccountApi.customerAccountDelete(params).then(() => {
-			tableRef.value.refresh(true)
+	const deleteConfig = (record) => {
+		Modal.confirm({
+			title: '确定删除该数据吗?',
+			icon: createVNode(ExclamationCircleOutlined),
+			content: '',
+			onOk() {
+				submitLoading.value = true
+				let params = [
+					{
+						id: record.id
+					}
+				]
+
+				customerAccountApi
+					.customerAccountDelete(params)
+					.then(() => {
+						tableRef.value.refresh(true)
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			},
+			onCancel() {}
 		})
 	}
 	// 调用这个函数将子组件的一些数据和方法暴露出去

+ 29 - 17
snowy-admin-web/src/views/biz/customer/index.vue

@@ -40,9 +40,7 @@
 					<a-space>
 						<a @click="formRef.onOpen(record)" v-if="hasPerm('customerEdit')">编辑</a>
 						<a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'and')" />
-						<a-popconfirm title="确定要删除吗?" @confirm="deleteCustomer(record)">
-							<a-button type="link" danger size="small" v-if="hasPerm('customerDelete')">删除</a-button>
-						</a-popconfirm>
+						<a-button type="link" danger size="small" v-if="hasPerm('customerDelete')" @click="deleteConfig(record)">删除</a-button>
 						<a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'or') && hasPerm('customerAccount')" />
 						<a @click="accountFormRef.onOpen(record)" v-if="hasPerm('customerAccount')">账号管理</a>
 					</a-space>
@@ -59,11 +57,16 @@
 	import Form from './form.vue'
 	import AccountForm from './accountIndex.vue'
 	import customerApi from '@/api/biz/customerApi'
+	import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
+	import {Modal} from 'ant-design-vue';
+	import {createVNode} from 'vue';
+
 	const searchFormState = ref({})
 	const searchFormRef = ref()
 	const tableRef = ref()
 	const formRef = ref()
 	const accountFormRef = ref()	
+	const submitLoading = ref(false)
 	const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
 	const columns = [
 		{
@@ -134,20 +137,29 @@
 		tableRef.value.refresh(true)
 	}
 	// 删除
-	const deleteCustomer = (record) => {
-		let params = [
-			{
-				id: record.id
-			}
-		]
-		customerApi.customerDelete(params).then(() => {
-			tableRef.value.refresh(true)
-		})
-	}
-	// 批量删除
-	const deleteBatchCustomer = (params) => {
-		customerApi.customerDelete(params).then(() => {
-			tableRef.value.clearRefreshSelected()
+	const deleteConfig = (record) => {
+		Modal.confirm({
+			title: '确定删除该数据吗?',
+			icon: createVNode(ExclamationCircleOutlined),
+			content: '',
+			onOk() {
+				submitLoading.value = true
+				let params = [
+					{
+						id: record.id
+					}
+				]
+
+				customerApi
+					.customerDelete(params)
+					.then(() => {
+						tableRef.value.refresh(true)
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			},
+			onCancel() {}
 		})
 	}
 </script>

+ 2 - 2
snowy-admin-web/src/views/biz/goods/index.vue

@@ -4,12 +4,12 @@
 			<a-row :gutter="24">
 				<a-col :span="6">
 					<a-form-item label="货品编码" name="goodsCode">
-						<a-input v-model:value="searchFormState.goodsCode" placeholder="查询货品编码" />
+						<a-input v-model:value="searchFormState.goodsCode" placeholder="查询货品编码" allow-clear  />
 					</a-form-item>
 				</a-col>
 				<a-col :span="6">
 					<a-form-item label="货品名称" name="goodsName">
-						<a-input v-model:value="searchFormState.goodsName" placeholder="查询货品名称" />
+						<a-input v-model:value="searchFormState.goodsName" placeholder="查询货品名称" allow-clear  />
 					</a-form-item>
 				</a-col>
 				<a-col :span="6">

+ 4 - 1
snowy-admin-web/src/views/biz/goodsConf/addForm.vue

@@ -19,7 +19,7 @@
 			<a-form-item label="货物信息" name="goodsJson">
 				<a-row :gutter="24" class="form-row">
 					<a-col :span="12" class="form-row-con"> 货物 </a-col>
-					<a-col :span="8" class="form-row-con"> 最大提货重量(KG) </a-col>
+					<a-col :span="8" class="form-row-con"> 最大提货重量() </a-col>
 					<a-col :span="4" class="form-row-con">
 						<a-button type="primary" @click="addDomains()" size="small">
 							<PlusOutlined />
@@ -161,6 +161,9 @@
 					// 判断当前货品列表选择是否存在重复的
 					let goodsId = []
 					formDatas.goodsJson.map((item, index) => {
+						// 重量 吨 转成 公斤
+						let confWeight = Number(item.confWeight) * 1000
+						item.confWeight = confWeight;
 						if(goodsId.indexOf(item.goodsId)==-1){
 							goodsId.push(item.goodsId)
 						}else{

+ 4 - 1
snowy-admin-web/src/views/biz/goodsConf/editForm.vue

@@ -18,7 +18,7 @@
 			<a-form-item label="提货结束时间:" name="confEndTime">
 				<a-date-picker v-model:value="formData.confEndTime" value-format="YYYY-MM-DD HH:mm" show-time :disabled-date="disabledDate" style="width: 100%" />
 			</a-form-item>
-			<a-form-item label="最大提货重量(KG):" name="confWeight">
+			<a-form-item label="最大提货重量():" name="confWeight">
 				<a-input-number v-model:value="formData.confWeight" :min="formData.usedWeight" style="width: 100%;" placeholder="请输入最大提货重量" allow-clear />
 			</a-form-item>
 		</a-form>
@@ -92,6 +92,9 @@
 					message.error('结束时间不得小于开始时间!')
 					return
 				}else{
+					// 重量 吨 转成 公斤
+					let confWeight = Number(formDataParam.confWeight) * 1000
+					formDataParam.confWeight = confWeight;
 					goodsConfApi
 					.goodsConfSubmitForm(formDataParam, formDataParam.id)
 					.then(() => {

+ 45 - 25
snowy-admin-web/src/views/biz/goodsConf/index.vue

@@ -4,24 +4,24 @@
 			<a-row :gutter="24">
 				<a-col :span="6">
 					<a-form-item label="货品名称" name="goodsName">
-						<a-input v-model:value="searchFormState.goodsName" placeholder="查询货品名称" />
+						<a-input v-model:value="searchFormState.goodsName" placeholder="查询货品名称" allow-clear  />
 					</a-form-item>
 				</a-col>
 				<a-col :span="9">
 					<a-form-item label="提货开始时间" name="confStartTime">
-						<a-range-picker v-model:value="searchFormState.confStartTime" value-format="YYYY-MM-DD HH:mm" show-time />
+						<a-range-picker v-model:value="searchFormState.confStartTime" value-format="YYYY-MM-DD HH:mm" show-time allow-clear  />
 					</a-form-item>
 				</a-col>
 				<a-col :span="9">
 					<a-form-item label="提货结束时间" name="confEndTime">
-						<a-range-picker v-model:value="searchFormState.confEndTime" value-format="YYYY-MM-DD HH:mm" show-time />
+						<a-range-picker v-model:value="searchFormState.confEndTime" value-format="YYYY-MM-DD HH:mm" show-time allow-clear  />
 					</a-form-item>
 				</a-col>
 			</a-row>
 			<a-row :gutter="24">
 				<a-col :span="6">
 					<a-form-item label="货品编码" name="goodsCode">
-						<a-input v-model:value="searchFormState.goodsCode" placeholder="查询货品名称" />
+						<a-input v-model:value="searchFormState.goodsCode" placeholder="查询货品名称" allow-clear  />
 					</a-form-item>
 				</a-col>
 				<a-col :span="9"></a-col>
@@ -49,15 +49,22 @@
 				<template v-if="column.dataIndex === 'serial'">
 					{{ index + 1 }}
 				</template>
+				<template v-if="column.dataIndex === 'confWeight'">
+					{{ record.confWeight / 1000 }}
+				</template>
+				<template v-if="column.dataIndex === 'usedWeight'">
+					{{ record.usedWeight / 1000 }}
+				</template>
+				<template v-if="column.dataIndex === 'lastWeight'">
+					{{ record.lastWeight / 1000 }}
+				</template>
 				<template v-if="column.dataIndex === 'action'">
 					<a-space>
 						<a @click="editFormRef.onOpen(record)" v-if="hasPerm('goodsConfEdit') && Number(record.usedWeight) == 0">编辑</a>
 
 						<a-divider type="vertical" v-if="hasPerm(['goodsConfEdit', 'goodsConfDelete'], 'and') && Number(record.usedWeight) == 0" />
-						<a-popconfirm title="确定要删除吗?" @confirm="deleteGoodsConf(record)">
-							<a-button type="link" danger size="small" v-if="hasPerm('goodsConfDelete') && Number(record.usedWeight) == 0">删除</a-button>
-						</a-popconfirm>
-
+						<a-button type="link" danger size="small" v-if="hasPerm('goodsConfDelete')" @click="deleteConfig(record)">删除</a-button>
+						
 						<a-divider type="vertical" v-if="(hasPerm(['goodsConfEdit', 'goodsConfDelete'], 'or') && Number(record.usedWeight) == 0) && hasPerm('goodsConfWeight')" />
 						<a @click="weightFormRef.onOpen(record)" v-if="hasPerm('goodsConfWeight')">重量</a>
 					</a-space>
@@ -76,6 +83,9 @@
 	import EditForm from './editForm.vue'
 	import WeightForm from './weightForm.vue'
 	import goodsConfApi from '@/api/biz/goodsConfApi'
+	import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
+	import {Modal} from 'ant-design-vue';
+	import {createVNode} from 'vue';
 
 	const searchFormState = ref({})
 	const searchFormRef = ref()
@@ -83,6 +93,7 @@
 	const addFormRef = ref()
 	const editFormRef = ref()
 	const weightFormRef = ref()
+	const submitLoading = ref(false)
 
 	const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
 	const columns = [
@@ -122,19 +133,19 @@
 			align:'center'
 		},
 		{
-			title: '可提重量(KG)',
+			title: '可提重量()',
 			width: 110,
 			dataIndex: 'confWeight',
 			align:'center'
 		},
 		{
-			title: '已提重量(KG)',
+			title: '已提重量()',
 			width: 110,
 			dataIndex: 'usedWeight',
 			align:'center'
 		},
 		{
-			title: '剩余重量(KG)',
+			title: '剩余重量()',
 			width: 110,
 			dataIndex: 'lastWeight',
 			align:'center'
@@ -189,20 +200,29 @@
 		tableRef.value.refresh(true)
 	}
 	// 删除
-	const deleteGoodsConf = (record) => {
-		let params = [
-			{
-				id: record.id
-			}
-		]
-		goodsConfApi.goodsConfDelete(params).then(() => {
-			tableRef.value.refresh(true)
-		})
-	}
-	// 批量删除
-	const deleteBatchGoodsConf = (params) => {
-		goodsConfApi.goodsConfDelete(params).then(() => {
-			tableRef.value.clearRefreshSelected()
+	const deleteConfig = (record) => {
+		Modal.confirm({
+			title: '确定删除该数据吗?',
+			icon: createVNode(ExclamationCircleOutlined),
+			content: '',
+			onOk() {
+				submitLoading.value = true
+				let params = [
+					{
+						id: record.id
+					}
+				]
+
+				goodsConfApi
+					.goodsConfDelete(params)
+					.then(() => {
+						tableRef.value.refresh(true)
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			},
+			onCancel() {}
 		})
 	}
 </script>

+ 15 - 7
snowy-admin-web/src/views/biz/goodsConf/weightForm.vue

@@ -10,18 +10,18 @@
 			<a-descriptions-item label="货品编码" :span="4">{{ formData.goodsCode }}</a-descriptions-item>
 			<a-descriptions-item label="货品信息" :span="4">{{ formData.goodsName }} ( {{ formData.goodsModel }} )</a-descriptions-item>
 			<a-descriptions-item label="提货时间段" :span="4">{{ formData.confStartTime }} ~ {{ formData.confEndTime }}</a-descriptions-item>
-			<a-descriptions-item label="原最大提货重量" :span="4">{{ confWeight }} KG</a-descriptions-item>
-			<a-descriptions-item label="已提货重量" :span="4">{{ formData.usedWeight }} KG</a-descriptions-item>
-			<a-descriptions-item label="剩余提货重量" :span="4">{{ formData.lastWeight }} KG</a-descriptions-item>
+			<a-descriptions-item label="原最大提货重量" :span="4">{{ confWeight }} </a-descriptions-item>
+			<a-descriptions-item label="已提货重量" :span="4">{{ usedWeight }} 吨</a-descriptions-item>
+			<a-descriptions-item label="剩余提货重量" :span="4">{{ lastWeight }} 吨</a-descriptions-item>
 		</a-descriptions>
 
 		<a-form ref="formRef" :model="formData" :rules="formRules" :wrapper-col="wrapperCol" :label-col="labelCol">
-			<a-form-item label="最大提货重量(KG):" name="confWeight">
-				<a-input-number v-model:value="formData.confWeight" :min="formData.usedWeight" style="width: 100%;" placeholder="请输入最大提货重量" allow-clear />
+			<a-form-item label="最大提货重量(吨):" name="confWeight">
+				<a-input-number v-model:value="formData.confWeight" :min="usedWeight" style="width: 100%;" placeholder="请输入最大提货重量" allow-clear />
 			</a-form-item>
 		</a-form>
 
-		<div style="color: red;">提示:不得小于当前已提货重量 {{ formData.usedWeight }} KG</div>
+		<div style="color: red;">提示:不得小于当前已提货重量 {{ usedWeight }} 吨</div>
 
 		<template #footer>
 			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
@@ -42,6 +42,8 @@
 	const formData = ref({})
 	const submitLoading = ref(false)
 	const confWeight = ref("")
+	const usedWeight = ref("")
+	const lastWeight = ref("")	
 
 	//设置表单样式
 	const labelCol = ref({ span: 5})
@@ -53,7 +55,10 @@
 		if (record) {
 			let recordData = cloneDeep(record)
 			formData.value = Object.assign({}, recordData)
-			confWeight.value = formData.value.confWeight
+			confWeight.value = Number(formData.value.confWeight) / 1000
+			usedWeight.value = Number(formData.value.usedWeight) / 1000
+			lastWeight.value = Number(formData.value.lastWeight) / 1000
+			formData.value.confWeight = Number(formData.value.confWeight) / 1000
 		}
 	}
 	// 关闭抽屉
@@ -73,6 +78,9 @@
 			.then(() => {
 				submitLoading.value = true
 				const formDataParam = cloneDeep(formData.value)
+				// 重量 吨 转成 公斤
+				let confWeight = Number(formDataParam.confWeight) * 1000
+				formDataParam.confWeight = confWeight;
 				goodsConfApi
 					.goodsConfSubmitForm(formDataParam, formDataParam.id)
 					.then(() => {

+ 2 - 2
snowy-admin-web/src/views/biz/supplier/index.vue

@@ -4,12 +4,12 @@
 			<a-row :gutter="24">
 				<a-col :span="6">
 					<a-form-item label="供货商名称" name="searchKey">
-						<a-input v-model:value="searchFormState.searchKey" placeholder="查询供货商名称" />
+						<a-input v-model:value="searchFormState.searchKey" placeholder="查询供货商名称" allow-clear  />
 					</a-form-item>
 				</a-col>
 				<a-col :span="6">
 					<a-form-item label="联系方式" name="searchKey">
-						<a-input v-model:value="searchFormState.searchKey" placeholder="查询联系方式" />
+						<a-input v-model:value="searchFormState.searchKey" placeholder="查询联系方式" allow-clear  />
 					</a-form-item>
 				</a-col>
 				<a-col :span="6">