Browse Source

Merge branch 'dev' into pre-production

pre-production
pref_mail@163.com 11 months ago
parent
commit
050cb2defe
  1. 12
      src/api/basicdata/TripartiteMaterial.js
  2. 7
      src/components/MyUpload/MyUpload.vue
  3. 23
      src/views/Pricesystem/Price/PriceBill.vue
  4. 22
      src/views/Pricesystem/Price/PriceTrunkLine.vue
  5. 29
      src/views/basicdata/TripartiteMaterial/list.vue
  6. 8
      src/views/basicdata/brand/basicdataCategory.vue
  7. 217
      src/views/waybill/CreateZeroOrder.vue

12
src/api/basicdata/TripartiteMaterial.js

@ -49,3 +49,15 @@ export const postRemove = (data = {}) => {
data, data,
}); });
}; };
/**
* 获取上传模板
*/
export const getDownTemplate = () => {
return request({
url: '/api/logpm-basicdata/factoryCategory/downTemplate',
method: 'get',
responseType: 'blob',
});
};

7
src/components/MyUpload/MyUpload.vue

@ -98,6 +98,11 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
/** 成功 */
success: {
type: Function,
default: () => {},
},
}); });
const $emit = defineEmits(['update:modelValue']); const $emit = defineEmits(['update:modelValue']);
@ -135,7 +140,7 @@ const handleSuccess = res => {
details.loadingObj.UploadLoadong = false; details.loadingObj.UploadLoadong = false;
if (res.code !== 200) return ElMessage.warning('上传失败'); if (res.code !== 200) return ElMessage.warning('上传失败');
ElMessage.success(res.msg || '上传成功'); ElMessage.success(res.msg || '上传成功');
initOnLoad({}, true); props.success();
}; };
/** 上传失败 */ /** 上传失败 */

23
src/views/Pricesystem/Price/PriceBill.vue

@ -43,7 +43,7 @@
<tbody> <tbody>
<tr v-for="(value, index) in details.VehicleBillingDetal" :key="value"> <tr v-for="(value, index) in details.VehicleBillingDetal" :key="value">
<td class="index">{{ index }}</td> <td class="index">{{ index + 1 }}</td>
<td> <td>
<el-select <el-select
class="w100" class="w100"
@ -360,7 +360,7 @@
<tbody> <tbody>
<tr v-for="(value, index) in details.VehicleBillingDetal" :key="value"> <tr v-for="(value, index) in details.VehicleBillingDetal" :key="value">
<td class="index">{{ index }}</td> <td class="index">{{ index + 1 }}</td>
<td> <td>
<el-select <el-select
class="w100" class="w100"
@ -908,10 +908,10 @@ const handlePlusVehicle = async (index: number) => {
if (details.VehicleBillingDetal.length === details.vehicleTypeArr.length) if (details.VehicleBillingDetal.length === details.vehicleTypeArr.length)
return ElMessage.warning('已无更多车型, 无法再新增'); return ElMessage.warning('已无更多车型, 无法再新增');
for (let i = 0; i < details.vehicleTypeArr.length; i++) { // for (let i = 0; i < details.vehicleTypeArr.length; i++) {
const value = details.vehicleTypeArr[i]; // const value = details.vehicleTypeArr[i];
if (value.isCheck) return ElMessage.warning('暂无可选车型'); // if (value.isCheck) return ElMessage.warning('');
} // }
details.VehicleBillingDetal.splice(index + 1, 0, { details.VehicleBillingDetal.splice(index + 1, 0, {
/** 车型 */ /** 车型 */
@ -1108,6 +1108,17 @@ const handleAdd = () => {
}, },
]; ];
details.form = deepClone(details.initForm); 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; details.popUpShow.addVsitied = true;
}; };

22
src/views/Pricesystem/Price/PriceTrunkLine.vue

@ -43,7 +43,7 @@
<tbody> <tbody>
<tr v-for="(value, index) in details.VehicleBillingDetal" :key="value"> <tr v-for="(value, index) in details.VehicleBillingDetal" :key="value">
<td class="index">{{ index }}</td> <td class="index">{{ index + 1 }}</td>
<td> <td>
<el-select <el-select
class="w100" class="w100"
@ -364,7 +364,7 @@
<tbody> <tbody>
<tr v-for="(value, index) in details.VehicleBillingDetal" :key="value"> <tr v-for="(value, index) in details.VehicleBillingDetal" :key="value">
<td class="index">{{ index }}</td> <td class="index">{{ index + 1 }}</td>
<td> <td>
<el-select <el-select
class="w100" class="w100"
@ -879,10 +879,10 @@ const handlePlusVehicle = async (index: number) => {
if (details.VehicleBillingDetal.length === details.vehicleTypeArr.length) if (details.VehicleBillingDetal.length === details.vehicleTypeArr.length)
return ElMessage.warning('已无更多车型, 无法再新增'); return ElMessage.warning('已无更多车型, 无法再新增');
for (let i = 0; i < details.vehicleTypeArr.length; i++) { // for (let i = 0; i < details.vehicleTypeArr.length; i++) {
const value = details.vehicleTypeArr[i]; // const value = details.vehicleTypeArr[i];
if (value.isCheck) return ElMessage.warning('暂无可选车型'); // if (value.isCheck) return ElMessage.warning('');
} // }
details.VehicleBillingDetal.splice(index + 1, 0, { details.VehicleBillingDetal.splice(index + 1, 0, {
/** 车型 */ /** 车型 */
@ -1083,6 +1083,16 @@ const handleAdd = () => {
}, },
]; ];
details.form = deepClone(details.initForm); 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; details.popUpShow.addVsitied = true;
}; };

29
src/views/basicdata/TripartiteMaterial/list.vue

@ -164,16 +164,16 @@
<!-- materialArr --> <!-- materialArr -->
<el-form-item <el-form-item
label="物料" label="结算品类"
prop="categoryName" prop="categoryName"
:rules="[{ required: true, message: '请选择物料', trigger: ['blur', 'change'] }]" :rules="[{ required: true, message: '请选择结算品类', trigger: ['blur', 'change'] }]"
> >
<el-select <el-select
class="w100" class="w100"
v-model="details.form.categoryName" v-model="details.form.categoryName"
filterable filterable
clearable clearable
placeholder="请选择品类" placeholder="请选择结算品类"
style="width: 240px" style="width: 240px"
:loading="loadingObj.loading" :loading="loadingObj.loading"
@change="handleChangeMaterial" @change="handleChangeMaterial"
@ -220,8 +220,14 @@
ref="myUpload" ref="myUpload"
v-model="details.popUpShow.UploadPackageDelivery" v-model="details.popUpShow.UploadPackageDelivery"
templateSrc="" templateSrc=""
uploadAddress="/api/logpm-basicdata/basicdataCategory/import" uploadAddress="/api/logpm-basicdata/factoryCategory/import"
isDefined isDefined
:success="
() => {
details.popUpShow.UploadPackageDelivery = false;
onLoad();
}
"
> >
<el-button type="danger" icon="Download" @click="handleDownloadTemplate"> 下载模板 </el-button> <el-button type="danger" icon="Download" @click="handleDownloadTemplate"> 下载模板 </el-button>
</MyUpload> </MyUpload>
@ -250,12 +256,12 @@ import {
postSave, postSave,
postLazyTree, postLazyTree,
postBrandLists, postBrandLists,
getDownTemplate,
} from '@/api/basicdata/TripartiteMaterial'; } from '@/api/basicdata/TripartiteMaterial';
import { useStore } from 'vuex'; import { useStore } from 'vuex';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
import { getDownTemplate } from '@/api/basicdata/basicdataCategory';
// //
const $router = useRouter(); const $router = useRouter();
@ -350,6 +356,8 @@ const tableNodeRef = ref();
/** 表单实例 */ /** 表单实例 */
const formRef = ref(); const formRef = ref();
const myUpload = ref();
const { search, query, shortcuts, stockupDate, data, loadingObj, selectionList, drawerShow, page } = const { search, query, shortcuts, stockupDate, data, loadingObj, selectionList, drawerShow, page } =
toRefs(details); toRefs(details);
@ -604,7 +612,7 @@ const remoteMethodBrand = async value => {
} }
}; };
remoteMethodBrand(); remoteMethodBrand('');
/** 搜索物料 */ /** 搜索物料 */
const getMaterialTree = async value => { const getMaterialTree = async value => {
@ -617,7 +625,7 @@ const getMaterialTree = async value => {
console.log('data :>> ', data); console.log('data :>> ', data);
}; };
getMaterialTree(); getMaterialTree('');
/** 物料变化时 */ /** 物料变化时 */
const handleChangeMaterial = value => { const handleChangeMaterial = value => {
@ -691,8 +699,7 @@ const handleRemove = ({ row }) => {
/** 下载模板 */ /** 下载模板 */
const handleDownloadTemplate = async () => { const handleDownloadTemplate = async () => {
try { try {
console.log('this.$refs :>> ', this.$refs); myUpload.value.details.loadingObj.UploadLoadong = true;
this.$refs.myUpload.details.loadingObj.UploadLoadong = true;
const res = await getDownTemplate(); const res = await getDownTemplate();
@ -700,13 +707,13 @@ const handleDownloadTemplate = async () => {
if (status !== 200) return; if (status !== 200) return;
downloadXls(data, '产品导入模板'); downloadXls(data, '三方物料导入模板');
console.log('res :>> ', res); console.log('res :>> ', res);
} catch (error) { } catch (error) {
console.log('error :>> ', error); console.log('error :>> ', error);
} finally { } finally {
this.$refs.myUpload.details.loadingObj.UploadLoadong = false; myUpload.value.details.loadingObj.UploadLoadong = false;
} }
}; };
</script> </script>

8
src/views/basicdata/brand/basicdataCategory.vue

@ -72,6 +72,12 @@
templateSrc="" templateSrc=""
uploadAddress="/api/logpm-basicdata/basicdataCategory/import" uploadAddress="/api/logpm-basicdata/basicdataCategory/import"
isDefined isDefined
:success="
() => {
popUpShow.UploadPackageDelivery = false;
onLoad(page);
}
"
> >
<el-button type="danger" icon="Download" @click="handleDownloadTemplate"> <el-button type="danger" icon="Download" @click="handleDownloadTemplate">
下载模板 下载模板
@ -381,6 +387,4 @@ export default {
margin-right: 0; margin-right: 0;
} }
} }
</style> </style>

217
src/views/waybill/CreateZeroOrder.vue

@ -7,7 +7,7 @@
:inline="true" :inline="true"
:rules="details.rules" :rules="details.rules"
:model="query" :model="query"
class="el-fr-d" class="table_form"
label-width="100px" label-width="100px"
> >
<!-- 顶部 --> <!-- 顶部 -->
@ -843,6 +843,63 @@
<!-- <el-button type="primary" icon="Printer" @click="handlePrint"> </el-button> --> <!-- <el-button type="primary" icon="Printer" @click="handlePrint"> </el-button> -->
</div> </div>
</el-dialog> </el-dialog>
<!-- 改单原因 -->
<el-dialog
title="修改信息"
:center="true"
:align-center="true"
:close-on-click-modal="false"
:close-on-press-escape="false"
:show-close="false"
:visible.sync="details.popUpShow.causeVisited"
width="50%"
v-model="details.popUpShow.causeVisited"
>
<el-form :model="details.causeForm" ref="causeFormRef" label-width="120px">
<el-form-item
label="修改原因:"
style="margin-right: 0"
prop="editResonCode"
:rules="[{ required: true, message: '请选择修改原因', trigger: ['blur', 'change'] }]"
>
<el-select
v-model="details.causeForm.editResonCode"
clearable
placeholder="请选择修改原因"
style="width: 100%"
>
<el-option
v-for="item in query.editWaybillReasonTypeList"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
</el-form-item>
<el-form-item label="备注:" style="margin-right: 0">
<el-input type="textarea" v-model="details.causeForm.remark" placeholder="请输入描述" />
</el-form-item>
</el-form>
<tablecmt
style="height: 40vh"
ref="tableNode"
:columnList="details.changeColumnList"
:tableData="details.changeData"
:loading="loadingObj.list"
>
<template #default="slotProps"> </template>
</tablecmt>
<div class="flex-c-c mt20">
<el-button icon="CircleClose" @click="() => (details.popUpShow.causeVisited = false)"
> </el-button
>
<el-button type="primary" icon="CircleCheck" @click="handleSubmitCause"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -862,7 +919,7 @@ import dayjs from 'dayjs';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
/** 获取字典 */ /** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict'; 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 { getLazyTreeAll } from '@/api/base/region';
import { ElMessage, ElMessageBox } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
import type { FormInstance, FormRules } from 'element-plus'; import type { FormInstance, FormRules } from 'element-plus';
@ -888,6 +945,7 @@ const instance = getCurrentInstance();
// //
const ruleFormRef = ref<FormInstance>(); const ruleFormRef = ref<FormInstance>();
const causeFormRef = ref<FormInstance>();
// vuex // vuex
const $store = useStore(); const $store = useStore();
@ -1205,6 +1263,8 @@ const details = reactive<any>({
popUpShow: { popUpShow: {
/** 是否继续开单 */ /** 是否继续开单 */
titleVisited: false, titleVisited: false,
/** 改单原因 */
titleVisited: false,
}, },
itemRules: { itemRules: {
/** 计价方式 */ /** 计价方式 */
@ -1265,6 +1325,43 @@ const details = reactive<any>({
/** 装卸费 */ /** 装卸费 */
// { name: '', key: 'storageFee' }, // { 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); const { query, data, drawerShow, loadingObj } = toRefs(details);
@ -1912,33 +2009,43 @@ const handleSubmit = (formEl: FormInstance | undefined) => {
// //
details.submitData = submitData; 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(';', ' <br /> '), '', {
// 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); const response = await postUpdateWaybillVerify(submitData);
if (response.data.code !== 200) return; if (response.data.code !== 200) return;
if (!response.data.data) return ElMessage.warning('没有更改的数据'); if (!response.data.data || response.data.data.length === 0)
return ElMessage.warning('没有更改的数据');
ElMessageBox.alert(response.data.data.replaceAll(';', ' <br /> '), '被更改数据', {
// if you want to disable its autofocus details.changeData = response.data.data;
// autofocus: false, details.popUpShow.causeVisited = true;
dangerouslyUseHTMLString: true, await nextTick();
confirmButtonText: '确认',
callback: async (action: Action) => { setNodeHeight(tableNode.value.$el, '40vh');
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 { code, msg } = res.data; 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( watch(
() => $route.query, () => $route.query,
() => { () => {
@ -2100,14 +2240,20 @@ watch(
<style scoped lang="scss"> <style scoped lang="scss">
$borderColor: #172e60; $borderColor: #172e60;
:deep(.el-date-editor.el-input, .el-date-editor.el-input__wrapper) { .table_form {
height: 100% !important; :deep(.el-date-editor.el-input, .el-date-editor.el-input__wrapper) {
} height: 100% !important;
}
:deep(.el-input__wrapper) { :deep(.el-input__wrapper) {
box-shadow: none; box-shadow: none;
border-bottom: 1px solid #777; border-bottom: 1px solid $borderColor;
border-radius: 0; border-radius: 0;
}
}
:deep(.table_form .el-form-item) {
flex: 1 !important;
margin: 0 !important;
} }
// //
@ -2246,11 +2392,6 @@ $borderColor: #172e60;
width: 100%; width: 100%;
} }
:deep(.el-form-item) {
flex: 1;
margin: 0;
}
:deep(.el-radio) { :deep(.el-radio) {
margin: 0; margin: 0;
} }

Loading…
Cancel
Save