This commit is contained in:
linfso 2024-05-30 13:24:48 +08:00
parent bdf4810ac4
commit d488b7fb68
4 changed files with 29 additions and 54 deletions

View File

@ -62,22 +62,18 @@
}, },
methods: { methods: {
onFocus(){ onFocus(){
this.isFistInit=false;
this.searchProdCode=null; this.searchProdCode=null;
}, },
onBlur(val){ onBlur(val){
this.$emit("input", this.svalue); this.$emit("input", this.svalue);
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]); this.dispatch('ElFormItem', 'el.form.blur');
}, },
onChange() { onChange() {
this.$emit("input", this.svalue); this.$emit("input", this.svalue);
let itemData ={}; let itemData = this.optionItems.find(item=>item.prodCode == this.svalue);
this.optionItems.forEach(item=>{
if(item.prodCode === this.svalue){
itemData = item;
}
});
this.$emit("onChange",itemData); this.$emit("onChange",itemData);
this.dispatch('ElFormItem', 'el.form.change', [this.svalue]); this.dispatch('ElFormItem', 'el.form.change');
}, },
queryData() { queryData() {

View File

@ -16,6 +16,7 @@
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="产品类型" prop="productType"> <el-form-item label="产品类型" prop="productType">
<!-- :transLineCode="form.transLineType" -->
<TransProductPicker placeholder="产品类型" v-model="form.productType" :transLineCode="form.transLineType"></TransProductPicker> <TransProductPicker placeholder="产品类型" v-model="form.productType" :transLineCode="form.transLineType"></TransProductPicker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -69,7 +70,7 @@
<div slot="description"> <div slot="description">
<!-- <span><dict-tag :options="dict.type.emis_biz_shipping_method" :value="item.transType"/></span> --> <!-- <span><dict-tag :options="dict.type.emis_biz_shipping_method" :value="item.transType"/></span> -->
<span> 【{{item.destSiteName}}】</span> <span> 【{{item.destSiteName}}】</span>
<span>{{ dict.type.emis_biz_shipping_method.find(obj=>obj.value==item.transType).label }}</span> <span>{{ getTransTypeLable(item.transType) }}</span>
<span> {{item.estCostDay}}天</span> <span> {{item.estCostDay}}天</span>
</div> </div>
</el-step> </el-step>
@ -119,8 +120,8 @@ export default {
loading: true, loading: true,
// 表单参数 // 表单参数
form: {}, form: {},
stepsLabel:[], // stepsLabel:[],
stepsDesc:[], // stepsDesc:[],
// 表单校验 // 表单校验
rules: { rules: {
id: [ id: [
@ -155,6 +156,13 @@ export default {
this.form.status="1"; this.form.status="1";
} }
}, },
getTransTypeLable(value){
// item.transType
let item=this.dict.type.emis_biz_shipping_method.find(obj=>obj.value==value);
if(item){
return item.label;
}
},
onStepChange(){ onStepChange(){
}, },
@ -195,7 +203,7 @@ export default {
}); });
} else { } else {
addEmisTmsTransPlan(this.form).then(response => { addEmisTmsTransPlan(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("添加成功");
this.$emit("on-changed"); this.$emit("on-changed");
}); });
} }

View File

@ -118,7 +118,7 @@
<div >{{scope.row.transLineTypeName}}</div> <div >{{scope.row.transLineTypeName}}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('产品类型')" align="center" prop="productType" min-width="100" /> <el-table-column :label="$t('产品类型')" align="center" prop="productTypeName" min-width="100" />
<el-table-column :label="$t('国家')" align="center" prop="transLineTypeName1" min-width="100" > <el-table-column :label="$t('国家')" align="center" prop="transLineTypeName1" min-width="100" >
<template slot-scope="scope"> <template slot-scope="scope">
<div >{{scope.row.fromCountryName}}---{{ scope.row.countryName }}</div> <div >{{scope.row.fromCountryName}}---{{ scope.row.countryName }}</div>

View File

@ -223,8 +223,6 @@ export default {
let queryParams={ let queryParams={
planId:this.planId, planId:this.planId,
} }
console.log("======>");
console.log(queryParams);
listEmisTmsTransPlanDtl(queryParams).then(response => { listEmisTmsTransPlanDtl(queryParams).then(response => {
this.emisTmsTransPlanDtlList = response.rows; this.emisTmsTransPlanDtlList = response.rows;
@ -283,41 +281,22 @@ export default {
this.form.orderNum=orderNum; this.form.orderNum=orderNum;
if(orderNum>1){ if(orderNum>1){
// 获取上一条数据 // 获取上一条数据
const [lastData]= this.emisTmsTransPlanDtlList.slice(-1); // const [lastData]= this.emisTmsTransPlanDtlList.slice(-1);
console.log(lastData); // console.log(lastData);
this.form.startSiteCode=lastData.destSiteCode; // this.form.startSiteCode=lastData.destSiteCode;
this.form.destSiteCode=null; // this.form.destSiteCode=null;
this.form.transType=lastData.transType; // this.form.transType=lastData.transType;
this.form.estCostDay=1; // this.form.estCostDay=1;
} }
}, },
handleCopy(row){
this.reset();
this.open = true;
this.title = "复制节点";
console.log(row)
const orderNum=this.emisTmsTransPlanDtlList.length+1;
if(orderNum>1){
// 获取上一条数据
let newData =Object.assign({}, row);
console.log(newData)
this.form=newData;
this.form.orderNum=orderNum;
// this.form.startWeight=newData.endWeight;
// this.form.endWeight='';
// this.form.initialWeight=0;
// this.form.additionalWeight=0;
// this.form.calculateExpression=newData.calculateExpression;
}
},
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
if(this.quoteId != null && !this.isCopy){ if(this.planId != null){
this.handleUpdateByQuoteId(row); this.handleUpdateByPlanId(row);
}else{ }else{
this.currentRow = row; this.currentRow = row;
this.form = row; this.form = row;
@ -326,7 +305,7 @@ export default {
this.open = true; this.open = true;
this.title = "修改节点"; this.title = "修改节点";
}, },
handleUpdateByQuoteId(row){ handleUpdateByPlanId(row){
this.loading = true; this.loading = true;
getEmisTmsTransPlanDtl(row.id).then(response => { getEmisTmsTransPlanDtl(row.id).then(response => {
this.form = response.data; this.form = response.data;
@ -351,21 +330,11 @@ export default {
}, },
submitFormByPlanId(){ submitFormByPlanId(){
if (this.form.id != null) { if (this.form.id != null) {
console.log("=======1");
console.log(this.form);
updateEmisTmsTransPlanDtl(this.form).then(response => { updateEmisTmsTransPlanDtl(this.form).then(response => {
// this.$modal.msgSuccess("修改成功");
// this.$emit("on-changed");
this.getList(); this.getList();
}); });
} else { } else {
console.log("=======2");
console.log(this.form);
addEmisTmsTransPlanDtl(this.form).then(response => { addEmisTmsTransPlanDtl(this.form).then(response => {
// this.$modal.msgSuccess("添加成功");
// this.$emit("on-changed");
this.getList(); this.getList();
}); });
} }
@ -381,7 +350,9 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row,index,list) { handleDelete(row,index,list) {
if(this.quoteId != null && !this.isCopy){ console.log(this.planId);
if(this.planId != null ){
this.handleDeletePlanId(row); this.handleDeletePlanId(row);
}else{ }else{
this.handleDeleteByNew(row,index,list); this.handleDeleteByNew(row,index,list);