diff --git a/src/api/basicdata/TripartiteMaterial.js b/src/api/basicdata/TripartiteMaterial.js index 2c31e24a..bf6da195 100644 --- a/src/api/basicdata/TripartiteMaterial.js +++ b/src/api/basicdata/TripartiteMaterial.js @@ -49,3 +49,15 @@ export const postRemove = (data = {}) => { data, }); }; + + +/** + * 获取上传模板 + */ +export const getDownTemplate = () => { + return request({ + url: '/api/logpm-basicdata/factoryCategory/downTemplate', + method: 'get', + responseType: 'blob', + }); +}; \ No newline at end of file diff --git a/src/components/MyUpload/MyUpload.vue b/src/components/MyUpload/MyUpload.vue index ba48773d..f851cb99 100644 --- a/src/components/MyUpload/MyUpload.vue +++ b/src/components/MyUpload/MyUpload.vue @@ -98,6 +98,11 @@ const props = defineProps({ type: Boolean, default: false, }, + /** 成功 */ + success: { + type: Function, + default: () => {}, + }, }); const $emit = defineEmits(['update:modelValue']); @@ -135,7 +140,7 @@ const handleSuccess = res => { details.loadingObj.UploadLoadong = false; if (res.code !== 200) return ElMessage.warning('上传失败'); ElMessage.success(res.msg || '上传成功'); - initOnLoad({}, true); + props.success(); }; /** 上传失败 */ diff --git a/src/views/Pricesystem/Price/PriceBill.vue b/src/views/Pricesystem/Price/PriceBill.vue index 5f3b8e39..8fca4845 100644 --- a/src/views/Pricesystem/Price/PriceBill.vue +++ b/src/views/Pricesystem/Price/PriceBill.vue @@ -43,7 +43,7 @@ - {{ index }} + {{ index + 1 }} - {{ index }} + {{ index + 1 }} { if (details.VehicleBillingDetal.length === details.vehicleTypeArr.length) return ElMessage.warning('已无更多车型, 无法再新增'); - for (let i = 0; i < details.vehicleTypeArr.length; i++) { - const value = details.vehicleTypeArr[i]; - if (value.isCheck) return ElMessage.warning('暂无可选车型'); - } + // for (let i = 0; i < details.vehicleTypeArr.length; i++) { + // const value = details.vehicleTypeArr[i]; + // if (value.isCheck) return ElMessage.warning('暂无可选车型'); + // } details.VehicleBillingDetal.splice(index + 1, 0, { /** 车型 */ @@ -1108,6 +1108,17 @@ const handleAdd = () => { }, ]; details.form = deepClone(details.initForm); + + for (let i = 0; i < details.form.billTemplateDetail.length; i++) { + const value = details.form.billTemplateDetail[i]; + + for (let index = 0; index < value.categories.length; index++) { + const item = value.categories[index]; + + item.price = 0; + } + } + details.popUpShow.addVsitied = true; }; diff --git a/src/views/Pricesystem/Price/PriceTrunkLine.vue b/src/views/Pricesystem/Price/PriceTrunkLine.vue index 5434b477..181b4212 100644 --- a/src/views/Pricesystem/Price/PriceTrunkLine.vue +++ b/src/views/Pricesystem/Price/PriceTrunkLine.vue @@ -43,7 +43,7 @@ - {{ index }} + {{ index + 1 }} - {{ index }} + {{ index + 1 }} { if (details.VehicleBillingDetal.length === details.vehicleTypeArr.length) return ElMessage.warning('已无更多车型, 无法再新增'); - for (let i = 0; i < details.vehicleTypeArr.length; i++) { - const value = details.vehicleTypeArr[i]; - if (value.isCheck) return ElMessage.warning('暂无可选车型'); - } + // for (let i = 0; i < details.vehicleTypeArr.length; i++) { + // const value = details.vehicleTypeArr[i]; + // if (value.isCheck) return ElMessage.warning('暂无可选车型'); + // } details.VehicleBillingDetal.splice(index + 1, 0, { /** 车型 */ @@ -1083,6 +1083,16 @@ const handleAdd = () => { }, ]; details.form = deepClone(details.initForm); + + for (let i = 0; i < details.form.billTemplateDetail.length; i++) { + const value = details.form.billTemplateDetail[i]; + + for (let index = 0; index < value.categories.length; index++) { + const item = value.categories[index]; + + item.price = 0; + } + } details.popUpShow.addVsitied = true; }; diff --git a/src/views/basicdata/TripartiteMaterial/list.vue b/src/views/basicdata/TripartiteMaterial/list.vue index 3162fb9d..7dc021ea 100644 --- a/src/views/basicdata/TripartiteMaterial/list.vue +++ b/src/views/basicdata/TripartiteMaterial/list.vue @@ -164,16 +164,16 @@ 下载模板 @@ -250,12 +256,12 @@ import { postSave, postLazyTree, postBrandLists, + getDownTemplate, } from '@/api/basicdata/TripartiteMaterial'; import { useStore } from 'vuex'; import { useRouter, useRoute } from 'vue-router'; import { ElMessage, ElMessageBox } from 'element-plus'; -import { getDownTemplate } from '@/api/basicdata/basicdataCategory'; // 获取路由实例 const $router = useRouter(); @@ -350,6 +356,8 @@ const tableNodeRef = ref(); /** 表单实例 */ const formRef = ref(); +const myUpload = ref(); + const { search, query, shortcuts, stockupDate, data, loadingObj, selectionList, drawerShow, page } = toRefs(details); @@ -604,7 +612,7 @@ const remoteMethodBrand = async value => { } }; -remoteMethodBrand(); +remoteMethodBrand(''); /** 搜索物料 */ const getMaterialTree = async value => { @@ -617,7 +625,7 @@ const getMaterialTree = async value => { console.log('data :>> ', data); }; -getMaterialTree(); +getMaterialTree(''); /** 物料变化时 */ const handleChangeMaterial = value => { @@ -691,8 +699,7 @@ const handleRemove = ({ row }) => { /** 下载模板 */ const handleDownloadTemplate = async () => { try { - console.log('this.$refs :>> ', this.$refs); - this.$refs.myUpload.details.loadingObj.UploadLoadong = true; + myUpload.value.details.loadingObj.UploadLoadong = true; const res = await getDownTemplate(); @@ -700,13 +707,13 @@ const handleDownloadTemplate = async () => { if (status !== 200) return; - downloadXls(data, '产品导入模板'); + downloadXls(data, '三方物料导入模板'); console.log('res :>> ', res); } catch (error) { console.log('error :>> ', error); } finally { - this.$refs.myUpload.details.loadingObj.UploadLoadong = false; + myUpload.value.details.loadingObj.UploadLoadong = false; } }; diff --git a/src/views/basicdata/brand/basicdataCategory.vue b/src/views/basicdata/brand/basicdataCategory.vue index 872bdaa0..51b42a33 100644 --- a/src/views/basicdata/brand/basicdataCategory.vue +++ b/src/views/basicdata/brand/basicdataCategory.vue @@ -72,6 +72,12 @@ templateSrc="" uploadAddress="/api/logpm-basicdata/basicdataCategory/import" isDefined + :success=" + () => { + popUpShow.UploadPackageDelivery = false; + onLoad(page); + } + " > 下载模板 @@ -381,6 +387,4 @@ export default { margin-right: 0; } } - - diff --git a/src/views/waybill/CreateZeroOrder.vue b/src/views/waybill/CreateZeroOrder.vue index 604d3f85..1ab466c7 100644 --- a/src/views/waybill/CreateZeroOrder.vue +++ b/src/views/waybill/CreateZeroOrder.vue @@ -7,7 +7,7 @@ :inline="true" :rules="details.rules" :model="query" - class="el-fr-d" + class="table_form" label-width="100px" > @@ -843,6 +843,63 @@ + + + + + + + + + + + + + + + + + + + +
+ 取 消 + 确 认 +
+
@@ -862,7 +919,7 @@ import dayjs from 'dayjs'; import { mapGetters } from 'vuex'; /** 获取字典 */ import { getDictionaryBiz } from '@/api/system/dict'; -import { downloadXls, computeNumber, debounce } from '@/utils/util'; +import { downloadXls, computeNumber, debounce, setNodeHeight } from '@/utils/util'; import { getLazyTreeAll } from '@/api/base/region'; import { ElMessage, ElMessageBox } from 'element-plus'; import type { FormInstance, FormRules } from 'element-plus'; @@ -888,6 +945,7 @@ const instance = getCurrentInstance(); // 获取表单实例 const ruleFormRef = ref(); +const causeFormRef = ref(); // vuex const $store = useStore(); @@ -1205,6 +1263,8 @@ const details = reactive({ popUpShow: { /** 是否继续开单 */ titleVisited: false, + /** 改单原因 */ + titleVisited: false, }, itemRules: { /** 计价方式 */ @@ -1265,6 +1325,43 @@ const details = reactive({ /** 装卸费 */ // { name: '仓库存储费', key: 'storageFee' }, ], + /** 修改原因 */ + causeForm: {}, + /** 修改列表 */ + changeColumnList: [ + { + prop: 'itemName', + label: '修改项', + type: 1, + values: '', + width: '', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'oldValue', + label: '修改前', + type: 1, + values: '', + width: '', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'newValue', + label: '修改后', + type: 1, + values: '', + width: '', + checkarr: [], + fixed: false, + sortable: false, + }, + ], + /** 修改数据 */ + changeData: [], }); const { query, data, drawerShow, loadingObj } = toRefs(details); @@ -1912,33 +2009,43 @@ const handleSubmit = (formEl: FormInstance | undefined) => { // 记录提交参数 details.submitData = submitData; + // const response = await postUpdateWaybillVerify(submitData); + // if (response.data.code !== 200) return; + + // if (!response.data.data) return ElMessage.warning('没有更改的数据'); + + // ElMessageBox.alert(response.data.data.replaceAll(';', '
'), '被更改数据', { + // dangerouslyUseHTMLString: true, + // confirmButtonText: '确认', + // callback: async (action: Action) => { + // try { + // details.loadingObj.submitLoadingBtn = true; + + // const res = await postUpdateWaybill(submitData); + // const { code, msg } = res.data; + // if (code !== 200) return; + // if (msg) ElMessage.success(msg); + + // back(); + // } catch (error) { + // console.log('error :>> ', error); + // } finally { + // details.loadingObj.submitLoadingBtn = false; + // } + // }, + // }); + const response = await postUpdateWaybillVerify(submitData); if (response.data.code !== 200) return; - if (!response.data.data) return ElMessage.warning('没有更改的数据'); - - ElMessageBox.alert(response.data.data.replaceAll(';', '
'), '被更改数据', { - // if you want to disable its autofocus - // autofocus: false, - dangerouslyUseHTMLString: true, - confirmButtonText: '确认', - callback: async (action: Action) => { - try { - details.loadingObj.submitLoadingBtn = true; - - const res = await postUpdateWaybill(submitData); - const { code, msg } = res.data; - if (code !== 200) return; - if (msg) ElMessage.success(msg); - - back(); - } catch (error) { - console.log('error :>> ', error); - } finally { - details.loadingObj.submitLoadingBtn = false; - } - }, - }); + if (!response.data.data || response.data.data.length === 0) + return ElMessage.warning('没有更改的数据'); + + details.changeData = response.data.data; + details.popUpShow.causeVisited = true; + await nextTick(); + + setNodeHeight(tableNode.value.$el, '40vh'); } const { code, msg } = res.data; @@ -2087,6 +2194,39 @@ const handleFindPrice = async (condition?: any) => { } }; +/** 改单提交 */ +const handleSubmitCause = () => { + causeFormRef.value.validate(async valid => { + if (!valid) return; + + const submitData = { ...details.submitData, ...details.causeForm }; + for (let i = 0; i < details.query.editWaybillReasonTypeList.length; i++) { + const value = details.query.editWaybillReasonTypeList[i]; + + if (value.dictKey !== details.causeForm.editResonCode) continue; + + submitData.editReson = value.dictValue; + break; + } + + try { + details.loadingObj.submitLoadingBtn = true; + details.popUpShow.causeVisited = false; + + const res = await postUpdateWaybill(submitData); + const { code, msg } = res.data; + if (code !== 200) return; + if (msg) ElMessage.success(msg); + + back(); + } catch (error) { + console.log('error :>> ', error); + } finally { + details.loadingObj.submitLoadingBtn = false; + } + }); +}; + watch( () => $route.query, () => { @@ -2100,14 +2240,20 @@ watch(