Commit 8f13d4ed by 1377875331@qq.com

明细页事件添加

parent ed63efc7
......@@ -176,6 +176,8 @@ export default {
"didgrp.beb.pts.bankno": [
{ type: "string", required: false, message: "必输项" },
//TODO 三位汉字的判断没加
{ pattern: /^[0-9A-Za-z]{6,}$/, message: "至少输入3个字或6位行号" },
{ max: 20, message: "长度不能超过20" }
],
......
......@@ -10,7 +10,7 @@
</c-select>
</el-form-item>
<el-form-item label="付款期限" prop="didgrp.rec.tenmaxday">
<el-form-item label="付款期限" prop="didgrp.rec.tenmaxday" @keyup.enter.native="recTenmaxdayEvent">
<c-input :disabled="model.didgrp.rec.avbby == 'P'" v-model="model.didgrp.rec.tenmaxday" placeholder="请输入"></c-input>
</el-form-item>
......@@ -33,7 +33,7 @@
</el-form-item>
<el-form-item label="货物运输或交货方式/服务方式" prop="didgrp.rec.tratyp">
<c-select v-model="model.didgrp.rec.tratyp" style="width:100%" placeholder="请选择">
<c-select v-model="model.didgrp.rec.tratyp" style="width:100%" placeholder="请选择" @change="recTratypChange" :disabled="model.didgrp.rec.mytype == 'F'">
<el-option v-for="item in codes.tratyp" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
......@@ -41,13 +41,13 @@
</el-form-item>
<el-form-item v-if="model.didgrp.rec.mytype == 'H'" label="手输运输方式" prop="didgrp.rec.sdsrfs">
<c-input type="textarea" v-model="model.didgrp.rec.sdsrfs" :disabled="model.didgrp.rec.mytype == 'H'" maxlength="140" show-word-limit placeholder="请输入"></c-input>
<c-input type="textarea" v-model="model.didgrp.rec.sdsrfs" :disabled="this.mytypeFlag" maxlength="140" show-word-limit placeholder="请输入"></c-input>
</el-form-item>
<el-form-item v-if="model.didgrp.rec.mytype == 'F'" label="服务提供方式" prop="didgrp.rec.sdsrfs">
<c-input type="textarea" v-model="model.didgrp.rec.sdsrfs" maxlength="140" show-word-limit placeholder="请输入"></c-input>
</el-form-item>
<el-form-item v-if="model.didgrp.rec.mytype == '3'" label="手输运输方式/服务提供方式" prop="didgrp.rec.sdsrfs">
<c-input type="textarea" v-model="model.didgrp.rec.sdsrfs" :disabled="true" maxlength="140" show-word-limit placeholder="请输入"></c-input>
<c-input type="textarea" v-model="model.didgrp.rec.sdsrfs" :disabled="this.mytypeFlag" maxlength="140" show-word-limit placeholder="请输入"></c-input>
</el-form-item>
......@@ -85,9 +85,9 @@
</el-form-item>
<el-form-item label="转运" prop="didgrp.rec.shptrs">
<c-select v-model="model.didgrp.rec.shptrs" style="width:100%" placeholder="请选择">
<el-option label="NOT ALLOWED" value="1"></el-option>
<el-option label="ALL OWED" value="2"></el-option>
<c-select v-model="model.didgrp.rec.shptrs" style="width:100%" placeholder="请选择" :disabled="model.didgrp.rec.mytype == 'F'">
<el-option label="不允许" value="1"></el-option>
<el-option label="允许" value="2"></el-option>
</c-select>
</el-form-item>
......@@ -126,33 +126,57 @@
import Api from "~/service/Api"
import CodeTable from "~/config/CodeTable"
import Event from "~/model/Ditopn/Event"
import Utils from "~/utils";
export default {
props:["model","codes"],
data(){
return {
flag:false,
mytypeFlag:true,
}
},
methods:{...Event,
preperflgExtkeyEvent(){
this.flag = !this.model.didgrp.blk.preperflg
if (this.flag === true){
this.model.didgrp.blk.preper = "货物装运日后15天";
}
},
avbbykeyEvent(){
if(this.model.didgrp.rec.avbby == 'P'){
this.model.didgrp.rec.tenmaxday = 0;
this.model.didgrp.blk.defdet = "";
}
Api.post("ditopn/default/didgrp.rec.tenmaxday", this.model).then(
const arg = Utils.flatObject(this.model);
Api.post("ditopn/default/didgrp.rec.avbby", arg).then(
(res) => {
if (res.respCode = "AAAAAA"){
const data = res.data;
this.model.didgrp.blk.defdet = data.didgrp_blk_defdet;
}
}
);
},
recTenmaxdayEvent(){
const arg = Utils.flatObject(this.model);
Api.post("ditopn/default/didgrp.rec.tenmaxday", arg).then(
(res) => {
if (res.respCode = "AAAAAA"){
const data = res.data;
this.model.didgrp.blk.defdet = data.didgrp_blk_defdet;
}
}
);
},
recTratypChange(){
if (this.model.didgrp.rec.tratyp == "08"){
this.model.didgrp.rec.sdsrfs = "";
this.mytypeFlag = false;
}else{
this.model.didgrp.rec.sdsrfs = "";
this.mytypeFlag = true;
}
}
},
......
......@@ -178,6 +178,7 @@
v-model="model.didgrp.rec.mytype"
style="width: 100%"
placeholder="请选择贸易类型"
@change="mytypeChange"
>
<el-option
v-for="item in codes.mylx"
......@@ -192,6 +193,7 @@
v-model="model.didgrp.rec.mytype"
style="width: 100%"
placeholder="请选择贸易类型"
@change="mytypeChange"
>
<el-option
v-for="item in codes.mytype"
......@@ -215,7 +217,25 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="最迟货物装运日" prop="didgrp.rec.shpdat">
<el-form-item v-if="model.didgrp.rec.mytype == 'H'" label="最迟货物装运日" prop="didgrp.rec.shpdat">
<c-date-picker
type="date"
v-model="model.didgrp.rec.shpdat"
value-format="yyyy-MM-dd"
style="width: 100%"
placeholder="请选择Shipment Date"
></c-date-picker>
</el-form-item>
<el-form-item v-if="model.didgrp.rec.mytype == 'F'" label="最迟服务提供日" prop="didgrp.rec.shpdat">
<c-date-picker
type="date"
v-model="model.didgrp.rec.shpdat"
value-format="yyyy-MM-dd"
style="width: 100%"
placeholder="请选择Shipment Date"
></c-date-picker>
</el-form-item>
<el-form-item label="最迟货物装运日/服务提供日" v-if="model.didgrp.rec.mytype == '3'" prop="didgrp.rec.shpdat">
<c-date-picker
type="date"
v-model="model.didgrp.rec.shpdat"
......@@ -363,6 +383,7 @@
<el-col :span="16">
<el-form-item label="Extkey" prop="didgrp.apl.pts.extkey">
<c-input
id = "extkey"
v-model="model.didgrp.apl.pts.extkey"
maxlength="16"
placeholder="请输入External Key of Address"
......@@ -640,6 +661,7 @@
v-model="model.didgrp.beb.pts.bankno"
maxlength="20"
placeholder="请输入Number of bank"
@keyup.enter.native="banknoEvent"
></c-input>
</el-form-item>
</el-col>
......@@ -689,6 +711,8 @@ export default {
Api.post("ditopn/executeRule/didgrp.apl.pts.extkey", data).then(
(res) => {
if (res.respCode = "AAAAAA"){
//失去焦点,避免多次触发
document.getElementById('extkey').blur();
const data = res.data;
this.model.didgrp.apl.namelc = data.didgrp_apl_namelc;
this.model.didgrp.apl.adrelc = data.didgrp_apl_adrelc;
......@@ -698,7 +722,6 @@ export default {
this.model.didgrp.apl.pts.extact = data.didgrp_apl_pts_extact; //申请人账号
this.flag = false;
}
}
);
},
......@@ -716,6 +739,41 @@ export default {
}
);
},
banknoEvent() {
const data = Utils.flatObject(this.model);
var temp = this.model.didgrp.beb.pts.bankno;
if (temp.length < 6){
return;
}
// 011451000006
Api.post("ditopn/executeRule/didgrp.beb.pts.bankno", data).then(
(res) => {
if (res.respCode = "AAAAAA"){
if (JSON.stringify(res.fieldErrors) != '{}'){
this.$notify({
title: '提示',
message: res.fieldErrors['didgrp.beb.pts.bankno'],
type: 'error'
});
}else{
const data = res.data;
this.model.didgrp.beb.pts.bankno = data.didgrp_beb_pts_bankno;
this.model.didgrp.beb.pts.jigomc = data.didgrp_beb_pts_jigomc;
}
}
}
)
},
mytypeChange(){
if (this.model.didgrp.rec.mytype == "F"){
this.model.didgrp.rec.tratyp = "";
this.model.didgrp.rec.sdsrfs = "";
this.model.didgrp.rec.shptrs = "";
this.model.didgrp.rec.shpfro = "";
this.model.didgrp.rec.shpto = "";
this.model.didgrp.rec.shppro = "";
}
},
},
created: function () {},
watch: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment