Browse Source

干线模板新增

pre-production
马远东 1 year ago
parent
commit
6cac39b274
  1. 2
      src/views/financialsector/FinanceHome.vue
  2. 88
      src/views/financialsector/Financialse/FinancialTrunkLine.vue
  3. 7
      src/views/financialsector/Financialse/FinancialWarehousing.vue

2
src/views/financialsector/FinanceHome.vue

@ -61,7 +61,7 @@
<template v-for="item in ServiceList" :key="item.label"> <template v-for="item in ServiceList" :key="item.label">
<el-tab-pane :name="item.label" v-if="item.state" :label="item.label"> <el-tab-pane :name="item.label" v-if="item.state" :label="item.label">
<span v-if="item.label == '提货'"><FinancialBill /></span> <span v-if="item.label == '提货'"><FinancialBill /></span>
<span v-if="item.label == '干线'"><FinancialTrunkLine /></span> <span v-if="item.label == '干线'"><FinancialTrunkLine @request-data="provideData" :templateData="templateInfo"/></span>
<span v-if="item.label == '仓储'" <span v-if="item.label == '仓储'"
><FinancialWarehousing @request-data="provideData" :templateData="templateInfo" ><FinancialWarehousing @request-data="provideData" :templateData="templateInfo"
/></span> /></span>

88
src/views/financialsector/Financialse/FinancialTrunkLine.vue

@ -171,13 +171,21 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, getCurrentInstance, nextTick } from 'vue'; import { ref, reactive, getCurrentInstance, nextTick,defineEmits, defineComponent } from 'vue';
import { debounce, deepClone } from '@/utils/util'; import { debounce, deepClone } from '@/utils/util';
import { ElMessage, ElMessageBox } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
import { getDictionaryBiz } from '@/api/system/dict'; import { getDictionaryBiz } from '@/api/system/dict';
import { $_priceTemplate } from '@/api/financialsector/index'; //
import { postFindCategoryInfo } from '@/api/distribution/CreateOrder.js'; import { postFindCategoryInfo } from '@/api/distribution/CreateOrder.js';
const emit = defineEmits(['request-data']);
defineComponent({
emits: ['request-data'],
});
//
const props = defineProps({
templateData: Object,
});
console.log(props, '来自父页面参数');
const instance = getCurrentInstance(); const instance = getCurrentInstance();
// //
@ -274,15 +282,15 @@ const details = reactive({
/** 计价方式 */ /** 计价方式 */
trunklinePricingType: [], trunklinePricingType: [],
/** 是否统一区域计费 */ /** 是否统一区域计费 */
trunklineIsUnifyAreaBill: '1', trunklineIsUnifyAreaBill: '0',
/** 是否区分品类 */ /** 是否区分品类 */
trunklineIsByCategory: '1', trunklineIsByCategory: '0',
/** 是否特殊配置 */ /** 是否特殊配置 */
trunklineIsPeculiarSetup: '1', trunklineIsPeculiarSetup: '0',
/** 是否最低计费 */ /** 是否最低计费 */
trunklineIsMinCost: '1', trunklineIsMinCost: '0',
/** 最低计费类型 */ /** 最低计费类型 */
trunklineMinCostType: '0', trunklineMinCostType: '1',
/** 计费模版详情 */ /** 计费模版详情 */
billTemplateDetail: [] as BillTemplateDetail[], billTemplateDetail: [] as BillTemplateDetail[],
}, },
@ -324,7 +332,10 @@ const handleTrunkLinePricingType = response => {
const _billTemplateDetailArr = []; const _billTemplateDetailArr = [];
for (let i = 0; i < details.priceMethodType.length; i++) { for (let i = 0; i < details.priceMethodType.length; i++) {
const value = details.priceMethodType[i]; const value = details.priceMethodType[i];
console.log(value,'value');
if(value.dictKey !='2'){
console.log(value,'value====');
_billTemplateDetailArr.push({ _billTemplateDetailArr.push({
title: value.dictValue + '计费品类', title: value.dictValue + '计费品类',
code: value.dictKey, code: value.dictKey,
@ -342,6 +353,8 @@ const handleTrunkLinePricingType = response => {
}); });
} }
}
details.form.billTemplateDetail = _billTemplateDetailArr; details.form.billTemplateDetail = _billTemplateDetailArr;
}; };
@ -469,11 +482,68 @@ const resetFormData = () => {
}; };
/** 提交 */ /** 提交 */
const handleSubmit = () => { const handleSubmit = async() => {
if (details.form.trunklinePricingType.length === 0) ElMessage.error('请选择计价方式'); if (details.form.trunklinePricingType.length === 0) ElMessage.error('请选择计价方式');
formRef.value.validate(async valid => { formRef.value.validate(async valid => {
await emit('request-data'); //
if (!valid) return; if (!valid) return;
console.log(props, 'props');
if (!props.templateData.TemplateName) {
ElMessage({
message: '请输入模板名称',
type: 'warning',
});
return;
} else {
details.form.name = props.templateData.TemplateName; //
}
if (!props.templateData.brand) {
ElMessage({
message: '请选择品牌',
type: 'warning',
});
return;
} else {
details.form.brandId = props.templateData.brand; //ID
}
console.log(details.form,'初始表单');
const submitData = deepClone(details.form);//
//
submitData.trunklinePricingType= submitData.trunklinePricingType.join(',')
//
submitData.billTemplateDetail.forEach(item=>{
switch (item.code) {
case '1':
submitData.trunklinePieceCategory = item.categories.filter(res => res.goodsId).map(res => res.goodsId).join(',');
break;
case '3':
submitData.trunklineCubeCategory = item.categories.filter(res => res.goodsId).map(res => res.goodsId).join(',');
break;
case '4':
submitData.trunklineWeightCategory = item.categories.filter(res => res.goodsId).map(res => res.goodsId).join(',');
break;
default:
break;
}
})
submitData.serviceType = '2'; //线
delete submitData.billTemplateDetail;//
console.log(submitData,'处理好的参数');
let data={
...submitData,//
}
$_priceTemplate(data).then(res=>{
console.log(res,'提交成功返回值');
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
emit('request-data',res.data.data);//
}
})
}); });
}; };
</script> </script>

7
src/views/financialsector/Financialse/FinancialWarehousing.vue

@ -251,10 +251,9 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { defineProps, defineEmits } from 'vue'; import { defineProps, defineEmits ,defineComponent} from 'vue';
import { getDictionaryBiz } from '@/api/system/dict'; // import { getDictionaryBiz } from '@/api/system/dict'; //
import { $_priceTemplate, $_basicdataBrande } from '@/api/financialsector/index'; // import { $_priceTemplate, $_basicdataBrande } from '@/api/financialsector/index'; //
import { defineComponent } from 'vue';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { postFindCategoryInfo } from '@/api/distribution/CreateOrder.js'; import { postFindCategoryInfo } from '@/api/distribution/CreateOrder.js';
const SelectOpin = ref(null); // const SelectOpin = ref(null); //
@ -483,8 +482,6 @@ const onLoad = () => {
onLoad(); onLoad();
// //
const Submit = async () => { const Submit = async () => {
emit('request-data','123')
return
await emit('request-data'); // await emit('request-data'); //
console.log(props, 'props'); console.log(props, 'props');
if (!props.templateData.TemplateName) { if (!props.templateData.TemplateName) {
@ -554,7 +551,7 @@ const Submit = async () => {
message: res.data.msg, message: res.data.msg,
type: 'success', type: 'success',
}); });
$emit('data-to-parent',res.data.data); emit('request-data',res.data.data);//
} }
// res.data.data // res.data.data
}); });

Loading…
Cancel
Save