Commit 5e055384 by liyixun

Merge branch 'development-202206' of http://114.115.138.98:8900/fukai/vue-gjjs…

Merge branch 'development-202206' of http://114.115.138.98:8900/fukai/vue-gjjs into development-202206
parents d27fe681 e5463418
......@@ -21,7 +21,7 @@ export default {
},
mounted() {
if (!this.isInDisplay) {
this.ruleCheck()
this.generateFormRules()
}
},
methods: {
......@@ -29,7 +29,16 @@ export default {
* 表单校验 rules 的赋值
* @returns void
*/
ruleCheck() {
generateFormRules() {
if (this.root) {
if (!this.root.rules) {
return;
} else {
// 新添加的表单项,需要重新确定下 validator 的触发 trigger
this.updateRulesTrigger();
return
}
}
if (!this.pattern)
return
// const keySet = new Set(Object.keys(this.pattern).concat(Object.keys(this.checkRules).concat(Object.keys(this.defaultRules))))
......@@ -76,7 +85,8 @@ export default {
* @returns
*/
getTriggerType(prop) {
const fields = this.$refs.modelForm.fields;
const modelForm = this.root ? this.root.$refs.modelForm : this.$refs.modelForm
const fields = modelForm.fields;
for (let i = 0; i < fields.length; i++) {
const field = fields[i];
if (field.prop === prop) {
......@@ -90,6 +100,24 @@ export default {
return "blur";
},
/**
* 表单有些 tab 是通过 v-if 控制的,这些表单项初始时的 trigger 均为 blur,需要手动更新
*/
updateRulesTrigger() {
const rules = this.root.rules
for (const key in rules) {
if (Object.hasOwnProperty.call(rules, key)) {
const rule = rules[key];
const triggerType = this.getTriggerType(key)
for (let i = 0; i < rule.length; i++) {
const r = rule[i];
if (r.validator && r.trigger !== triggerType) {
r.trigger = triggerType;
}
}
}
}
},
/**
* Tabs切换事件
* @param {VM} tab
*/
......
......@@ -219,8 +219,12 @@
grp: 'botp',
code: 'docpre',
}"
:disabledDocnam="model.rejtypsel != 'R'"
:disabledCmail2="model.rejtypsel != 'R'"
:disabledCmail1="model.rejtypsel != 'R'"
:ifShowAdd="model.rejtypsel == 'R'"
:ifShowDelete="model.rejtypsel == 'R'"></c-docpre>
:ifShowDelete="model.rejtypsel == 'R'">
</c-docpre>
</c-col>
......@@ -251,50 +255,6 @@ export default {
mixins: [commonProcess],
data() {
return {
codeTable: [
{ label: "Airway Bills", value: "Airway Bills" },
{ label: "Beneficiary's Declaration", value: "Beneficiary's Declaration" },
{ label: "Bill of Lading Copies", value: "Bill of Lading Copies" },
{ label: "Bill of Lading Originals", value: "Bill of Lading Originals" },
{ label: "Certificate", value: "Certificate" },
{ label: "Certificate of Analysis", value: "Certificate of Analysis" },
{ label: "Certificate of Origin", value: "Certificate of Origin" },
{ label: "Certificate of Quality", value: "Certificate of Quality" },
{ label: "Certificate of Quantity", value: "Certificate of Quantity" },
{ label: "Commercial Invoice", value: "Commercial Invoice" },
{ label: "Courier Receipt", value: "Courier Receipt" },
{ label: "Draft", value: "Draft" },
{ label: "Export Licence", value: "Export Licence" },
{ label: "Fax Report", value: "Fax Report" },
{ label: "Inspection Cert", value: "Inspection Cert" },
{ label: "Insurance Policy", value: "Insurance Policy" },
{ label: "Packing List", value: "Packing List" },
{ label: "Shipment Advice", value: "Shipment Advice" },
{ label: "Weight List", value: "Weight List" },
],
TableValue: [
{
id: 0,
cmail1: "",
cmail2: "",
docnam: "",
description: "",
serialNum: "",
tableName: "",
tcddoc: "",
},
],
newValue: {
id: 0,
cmail1: "",
cmail2: "",
docnam: "",
description: "",
serialNum: "",
tableName: "",
tcddoc: "",
},
}
},
computed: {
......@@ -309,15 +269,6 @@ export default {
},
methods: {
...Event,
addTableValue(index) {
var newTableValue = Object.assign({}, this.newValue);
const serial = Utils.generateUUID();
newTableValue.serialNum = serial;
this.model.botp.docgrdm.docgrd.splice(index - 1, 0, newTableValue);
},
deleteTable(index) {
this.model.botp.docgrdm.docgrd.splice(index, 1);
},
},
created: function () {
......
......@@ -70,6 +70,11 @@
<m-setpan :model="model" :codes="codes" />
</c-content>
</el-tab-pane>
<el-tab-pane label="分录" name="glepan">
<m-glepan :model="model" :codes="codes" ref="glepan" />
</el-tab-pane>
<el-tab-pane label="声明" name="stamet">
<m-stamet :model="model" :codes="codes" />
</el-tab-pane>
......@@ -97,7 +102,7 @@
<m-docpan :model="model" :codes="codes" ref="docpan" />
</el-tab-pane>
<el-tab-pane label="MT799" name="mt799" >
<el-tab-pane label="MT799" name="mt799">
<!--PD000361 -->
<m-mt799 :model="model" :codes="codes" />
</el-tab-pane>
......@@ -135,6 +140,7 @@ import Litapll1 from "./Litapll1";
import Litrmbl1 from "./Litrmbl1";
import Addbcb from "./Addbcb";
import Glepan from "~/views/Public/Glepan";
import Setpan from "~/views/Public/Setpan";
import Stamet from "./Stamet";
import Engp from "~/views/Public/Engp";
......@@ -164,6 +170,7 @@ export default {
"m-limitbody": Limitbody,
"m-coninfp": Coninfp,
"m-ccvpan": Ccvpan,
"m-glepan": Glepan,
},
provide() {
return {
......
......@@ -36,8 +36,8 @@
</c-col>
<c-col :span="12">
<div style="float: right;">
<span class="add_del_button add_button" @click="addTableValue">+</span>
<span class="add_del_button" @click="deleteTable">-</span>
<span class="add_del_button add_button" @click="addTableValue" v-if="ifShowAdd">+</span>
<span class="add_del_button" @click="deleteTable" v-if="ifShowDelete">-</span>
</div>
</c-col>
</row>
......
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