Commit 7b8bb360 by 潘际乾
parents 94d4ea66 9b789de7
<template> <template>
<el-dialog :title="promptData.title" :visible.sync="show" <el-dialog
custom-class="grid-ety" :title="promptData.title"
:highlight-current-row="true" :visible.sync="show"
width="60%" custom-class="grid-ety"
:before-close="beforeClose"> :highlight-current-row="true"
<el-table :data="tableData.slice((currentPage - 1) * pageSize, currentPage * pageSize)" width="60%"
border :before-close="beforeClose"
@row-dblclick="selectEty"> >
<el-table-column v-for="(item,idx) in tableColumn" :key="idx" <el-table
:property="item.prop" :data="
:label="item.label" tableData.slice((currentPage - 1) * pageSize, currentPage * pageSize)
:width="item.width"> "
</el-table-column> border
</el-table> @row-dblclick="selectEty"
<el-pagination >
layout="prev, pager, next, total, jumper" <el-table-column
:total="tableData.length" v-for="(item, idx) in tableColumn"
:page-sizes="pageSizes" :key="idx"
:page-size="pageSize" :property="item.prop"
:current-page="currentPage" :label="item.label"
@current-change="currentChange" :width="item.width"
> >
</el-pagination> </el-table-column>
</el-dialog> </el-table>
<el-pagination
layout="prev, pager, next, total, jumper"
:total="tableData.length"
:page-sizes="pageSizes"
:page-size="pageSize"
:current-page="currentPage"
@current-change="currentChange"
>
</el-pagination>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
promptData: { promptData: {
required: true, required: true,
type: Object, type: Object,
default: () => { default: () => {
return {
title: '',
columnStr: '',
data: [],
rulePath: ''
}
}
}
},
data() {
return { return {
show: false, title: "",
currentPage: 1, columnStr: "",
pageSizes: [5, 10, 20, 30, 40, 50, 100], data: [],
pageSize: 5 rulePath: "",
modelUrl: "", //非机构处理需要回填的字段路劲信息,isPty为false时必输
};
},
},
isPty: {
//默认为机构处理
type: Boolean,
default: true,
},
},
data() {
return {
show: false,
currentPage: 1,
pageSizes: [5, 10, 20, 30, 40, 50, 100],
pageSize: 5,
};
},
computed: {
tableColumn() {
return this.dealExtKeyTableColumn();
},
tableData() {
return this.dealExtKeyTableData();
},
},
methods: {
dealExtKeyTableColumn() {
const columnArr = [];
const lines = this.promptData.columnStr.split("\r\n");
const etyReg = /\"([^\"]*)\"/;
const obj = {};
for (let i = 0; i < lines.length; i++) {
let line = lines[i];
if (etyReg.test(line)) {
const gs = line.match(etyReg);
const columnName = gs[1];
const newLine = line.replace(gs[0], " _ ");
const colPropArr = newLine.split(/\s+/);
const positionArr = colPropArr[1].split(":");
if (!obj[positionArr[0]]) {
obj[positionArr[0]] = [];
}
obj[positionArr[0]].push({
idx: colPropArr[0],
prop: columnName,
width: colPropArr[3],
});
} }
}
for (const k in obj) {
if (Object.hasOwnProperty.call(obj, k)) {
const o = obj[k];
const tableColumn = o.map((item) => item.prop).join("\n");
columnArr.push({
prop: tableColumn,
label: tableColumn,
// width: o[0].width,
width: "auto",
index: k,
children: o,
});
}
}
return columnArr.sort((a, b) => {
return parseInt(a.index) - parseInt(b.index);
});
}, },
computed: { dealExtKeyTableData() {
tableColumn() { const arr = [];
return this.dealExtKeyTableColumn() for (let i = 0; i < this.promptData.data.length; i++) {
}, const d = this.promptData.data[i];
tableData() { const items = d.split("\t");
return this.dealExtKeyTableData() const it = {};
for (let j = 0; j < this.tableColumn.length; j++) {
const column = this.tableColumn[j];
it[column["prop"]] = column.children
.map((c) => items[c["idx"]] || " ")
.join("\n");
} }
it["IDX"] = i;
//隐藏列,便于取值
if(typeof this.promptData.shadow==='object'){
for(let k in this.promptData.shadow){
it[k]=items[this.promptData.shadow[k]]
}
}
arr.push(it);
}
return arr;
},
currentChange(currentPage) {
this.currentPage = currentPage;
}, },
methods: { selectEty(row, column, event) {
dealExtKeyTableColumn() { // 默认第一列
const columnArr = [] if (this.isPty) {
const lines = this.promptData.columnStr.split("\r\n") const v = row[this.tableColumn[0].prop].split("\n")[0];
const etyReg = /\"([^\"]*)\"/ this.$emit("select-ety", v, this.promptData.rulePath);
const obj = {} } else {
for (let i = 0; i < lines.length; i++) { const { modelUrl,isCover, rulePath } = this.promptData;
let line = lines[i]; let v = {};
if (etyReg.test(line)) { for (let k in modelUrl) {
const gs = line.match(etyReg) row[k] &&(v[k] = row[k]);
const columnName = gs[1]
const newLine = line.replace(gs[0], " _ ")
const colPropArr = newLine.split(/\s+/)
const positionArr = colPropArr[1].split(":")
if (!obj[positionArr[0]]) {
obj[positionArr[0]] = []
}
obj[positionArr[0]].push({
idx: colPropArr[0],
prop: columnName,
width: colPropArr[3]
})
}
}
for (const k in obj) {
if (Object.hasOwnProperty.call(obj, k)) {
const o = obj[k];
const tableColumn = o.map(item => item.prop).join("\n")
columnArr.push({
prop: tableColumn,
label: tableColumn,
// width: o[0].width,
width: "auto",
index: k,
children: o
})
}
}
return columnArr.sort((a,b) => {
return parseInt(a.index) - parseInt(b.index)
})
},
dealExtKeyTableData() {
const arr = []
for (let i = 0; i < this.promptData.data.length; i++) {
const d = this.promptData.data[i];
const items = d.split("\t")
const it = {}
for (let j = 0; j < this.tableColumn.length; j++) {
const column = this.tableColumn[j];
it[column['prop']] = column.children.map(c => items[c['idx']] || " ").join("\n")
}
it['IDX'] = i
arr.push(it)
}
return arr
},
currentChange(currentPage) {
this.currentPage = currentPage;
},
selectEty(row, column, event) {
// 默认第一列
const v = row[this.tableColumn[0].prop].split("\n")[0]
this.$emit("select-ety", v, this.promptData.rulePath)
this.show = false;
this.currentPage = 1;
},
beforeClose(done) {
this.show = false;
this.currentPage = 1;
done()
} }
} this.$emit("select-ety", v, modelUrl,isCover, rulePath);
} }
this.show = false;
this.currentPage = 1;
},
beforeClose(done) {
this.show = false;
this.currentPage = 1;
done();
},
},
};
</script> </script>
<style> <style>
.grid-ety .el-table .cell{ .grid-ety .el-table .cell {
white-space: pre-wrap; white-space: pre-wrap;
} }
</style> </style>
\ No newline at end of file
import commonDeclare from "./commonDeclare" import commonDeclare from "./commonDeclare"
import commonApi from "./commonApi" import commonApi from "./commonApi"
import Utils from "~/utils" import Utils from "~/utils"
import _ from "~/utils/Lodash.js";
export default { export default {
mixins: [commonApi, commonDeclare], mixins: [commonApi, commonDeclare],
...@@ -163,9 +164,13 @@ export default { ...@@ -163,9 +164,13 @@ export default {
}, },
/** /**
* 弹出机构选择框 * 弹出机构选择框
* @param {String} rulePath 路径 * @param {String} rulePath
* @param {String} columns 自定义需要展示列
* @param {String} shadow 自定义列后需要保留的影藏字段
* @param {String} modelUrl 非机构双击后需要回填的字段路劲,k:对应列,value:应用model路劲,如{TXT:'ledgrp.blk.lcrgod'}
* @param {String} isCover 非机构双击后需要回填的字段值是覆盖还是叠加,部分覆盖值为对象,false为叠加,如{TXT:false},k值为modelUrl的k,如全部覆盖则isCover='T',如全部叠加则isCover='',默认全部覆盖
*/ */
showGridPromptDialog(rulePath, columns) { showGridPromptDialog(rulePath, columns, shadow, modelUrl, isCover = "T") {
this.executeRule(rulePath).then((res) => { this.executeRule(rulePath).then((res) => {
if (res.respCode = SUCCESS) { if (res.respCode = SUCCESS) {
if (res.data.params) { if (res.data.params) {
...@@ -175,8 +180,11 @@ export default { ...@@ -175,8 +180,11 @@ export default {
this.root.promptData = { this.root.promptData = {
title: res.data.title, title: res.data.title,
columnStr: columns ? columns : res.data.columns, columnStr: columns ? columns : res.data.columns,
shadow: shadow,
data: res.data.vals.rows, data: res.data.vals.rows,
rulePath: rulePath, rulePath: rulePath,
modelUrl: modelUrl,
isCover: isCover,
} }
} }
} }
...@@ -198,6 +206,25 @@ export default { ...@@ -198,6 +206,25 @@ export default {
} }
}); });
}, },
/**
* 货物条款等非机构栏位回填
* @param {Object} val 选种行的值
* @param {Object} url 字段路劲 需要回填的字段路劲
* @param {Object} url 对应字段值是否覆盖 ,需要为true,否则合并叠加
* @param {String} rulePath 路径
*/
selectMsg(val, modelUrl, isCover, rulePath) {
for (let k in val) {
let msg = val[k]
if ((typeof isCover === 'string' && isCover === '') || !isCover[k]) {
let ms = _.get(this.model, modelUrl[k], '')
msg = (ms ? ms + '\r\n' : '') + msg
}
_.set(this.model, modelUrl[k], msg);
this[modelUrl[k]] = msg
}
},
/** /**
* 改变表单项的是否必填属性 * 改变表单项的是否必填属性
* @param {String} property 属性 * @param {String} property 属性
......
...@@ -161,7 +161,7 @@ export default { ...@@ -161,7 +161,7 @@ export default {
} }
}, },
async onLcrdocButtxmsel() { async onLcrdocButtxmsel() {
let rtnmsg = await this.executeRule("lcrdoc.buttxmsel") let rtnmsg = await this.executeRule("letp.lcrdoc.buttxmsel")
if (rtnmsg.respCode == SUCCESS) { if (rtnmsg.respCode == SUCCESS) {
//TODO 处理数据逻辑 //TODO 处理数据逻辑
......
<template> <template>
<c-row> <c-row>
<c-blkTextarea :model="model" v-bind="blk"> </c-blkTextarea>
<!-- Description of Goods --> <!-- Description of Goods -->
<c-col :span="19"> <!-- <c-col :span="19">
<el-form-item label="货物说明" prop="ledgrp.blk.lcrgod"> <el-form-item label="货物说明" prop="ledgrp.blk.lcrgod">
<c-input <c-input
type="textarea" type="textarea"
...@@ -14,17 +15,16 @@ ...@@ -14,17 +15,16 @@
</el-form-item> </el-form-item>
</c-col> </c-col>
<c-col :span="2" class="letopn_dogp_button"> <c-col :span="2" class="letopn_dogp_button">
<!-- @click="onLcrgodButtxmsel" -->
<c-button <c-button
size="small" size="small"
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="showGridPromptDialog('letp.lcrgod.buttxmsel',columns)" @click="showGridPromptDialog(...dialogArg)"
> >
... ...
</c-button> </c-button>
</c-col> </c-col> -->
<!-- @click="onLcrgodButtxmsel" -->
<br /> <br />
<c-col :span="12"> <c-col :span="12">
<el-form-item label="货物类型" prop="ledgrp.rec.stagod"> <el-form-item label="货物类型" prop="ledgrp.rec.stagod">
...@@ -43,14 +43,23 @@ import Api from "~/service/Api"; ...@@ -43,14 +43,23 @@ import Api from "~/service/Api";
import CommonProcess from "~/mixin/CommonProcess"; import CommonProcess from "~/mixin/CommonProcess";
import CodeTable from "~/config/CodeTable"; import CodeTable from "~/config/CodeTable";
import Event from "~/model/Letopn/Event"; import Event from "~/model/Letopn/Event";
import BlkTextarea from "~/views/Public/BlkTextarea";
export default { export default {
inject: ["root"], inject: ["root"],
props: ["model", "codes"], props: ["model", "codes"],
components: { "c-blkTextarea": BlkTextarea },
mixins: [CommonProcess], mixins: [CommonProcess],
data() { data() {
return { return {
columns: "1 2 \"EXTKEY\" 410 50\r\n2 1 \"NAM\" 410 50\r\n3 3 \"TXT\" 410 50\r\nUIL\r\nVER\r\nETGEXTKEY\r\nP COLORED TRUE\r\nP VERTLINES TRUE\r\nP HORZLINES TRUE\r\nP MULTISELECT FALSE\r\nP COLUMNSIZING TRUE" blk: {
blkMsg: {
title: "货物说明",
dataUrl: "ledgrp.blk.lcrgod", //字段所在model路劲
rows: 20,
},
rulePath: "letp.lcrgod.buttxmsel",
},
}; };
}, },
methods: { ...Event }, methods: { ...Event },
......
<template> <template>
<div class="eibs-tab"> <div class="eibs-tab">
<c-col :span="19"> <c-blkTextarea :model="model" v-bind="blk"> </c-blkTextarea>
<!-- <c-col :span="19">
<el-form-item label="单据要求" prop="ledgrp.blk.lcrdoc"> <el-form-item label="单据要求" prop="ledgrp.blk.lcrdoc">
<c-input <c-input
type="textarea" type="textarea"
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
> >
... ...
</c-button> </c-button>
</c-col> </c-col> -->
</div> </div>
</template> </template>
<script> <script>
...@@ -30,13 +31,24 @@ import Api from "~/service/Api"; ...@@ -30,13 +31,24 @@ import Api from "~/service/Api";
import CommonProcess from "~/mixin/CommonProcess"; import CommonProcess from "~/mixin/CommonProcess";
import CodeTable from "~/config/CodeTable"; import CodeTable from "~/config/CodeTable";
import Event from "~/model/Letopn/Event"; import Event from "~/model/Letopn/Event";
import BlkTextarea from "~/views/Public/BlkTextarea";
export default { export default {
inject: ["root"], inject: ["root"],
props: ["model", "codes"], props: ["model", "codes"],
components: { "c-blkTextarea": BlkTextarea },
mixins: [CommonProcess], mixins: [CommonProcess],
data() { data() {
return {}; return {
blk: {
blkMsg: {
title: "单据要求",
dataUrl: "ledgrp.blk.lcrdoc", //字段所在model路劲
rows: 20,
},
rulePath: "letp.lcrdoc.buttxmsel",
},
};
}, },
methods: { ...Event }, methods: { ...Event },
created: function () {}, created: function () {},
......
...@@ -13,9 +13,12 @@ ...@@ -13,9 +13,12 @@
</el-form-item> </el-form-item>
</c-col> </c-col>
<c-col :span="3"> <c-col :span="3">
<c-button size="small" type="primary" @click="onSeainf" icon="el-icon-search" <c-button
></c-button size="small"
> type="primary"
@click="onSeainf"
icon="el-icon-search"
></c-button>
<c-button <c-button
size="small" size="small"
type="primary" type="primary"
...@@ -158,10 +161,10 @@ ...@@ -158,10 +161,10 @@
<c-col :span="12"> <c-col :span="12">
<el-form-item label="" label-width="20px" prop="ledgrp.cbs.max.amt"> <el-form-item label="" label-width="20px" prop="ledgrp.cbs.max.amt">
<c-input <c-input-currency
v-model="model.ledgrp.cbs.max.amt" v-model="model.ledgrp.cbs.max.amt"
placeholder="请输入最大金额" placeholder="请输入最大金额"
></c-input> ></c-input-currency>
</el-form-item> </el-form-item>
</c-col> </c-col>
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
:handleCheck="handleCheck" :handleCheck="handleCheck"
:handleStash="handleStash" :handleStash="handleStash"
> >
<el-button size="small">流程附言</el-button>
<el-button size="small">交易历史</el-button>
<el-button size="small">备忘录</el-button> <el-button size="small">备忘录</el-button>
<el-button size="small">影像信息</el-button> <el-button size="small">影像信息</el-button>
<el-button size="small">保存模板</el-button> <el-button size="small">保存模板</el-button>
...@@ -130,8 +128,9 @@ ...@@ -130,8 +128,9 @@
</el-form> </el-form>
<c-grid-ety-prompt-dialog <c-grid-ety-prompt-dialog
ref="etyDialog" ref="etyDialog"
:isPty="false"
:promptData="promptData" :promptData="promptData"
v-on:select-ety="selectEty" @select-ety="selectMsg"
> >
</c-grid-ety-prompt-dialog> </c-grid-ety-prompt-dialog>
</div> </div>
...@@ -144,6 +143,7 @@ import Utils from "~/utils/index"; ...@@ -144,6 +143,7 @@ import Utils from "~/utils/index";
import CodeTable from "~/config/CodeTable"; import CodeTable from "~/config/CodeTable";
import Letopn from "~/model/Letopn"; import Letopn from "~/model/Letopn";
import CommonProcess from "~/mixin/CommonProcess"; import CommonProcess from "~/mixin/CommonProcess";
import CommonFuncs from "~/mixin/CommonFuncs";
import Check from "~/model/Letopn/Check"; import Check from "~/model/Letopn/Check";
import Default from "~/model/Letopn/Default"; import Default from "~/model/Letopn/Default";
import Pattern from "~/model/Letopn/Pattern"; import Pattern from "~/model/Letopn/Pattern";
...@@ -195,7 +195,7 @@ export default { ...@@ -195,7 +195,7 @@ export default {
root: this, root: this,
}; };
}, },
mixins: [CommonProcess], // 里面包含了Default、Check等的公共处理 mixins: [CommonProcess, CommonFuncs], // 里面包含了Default、Check等的公共处理
data() { data() {
return { return {
tabVal: "ovwp", tabVal: "ovwp",
......
<template>
<div>
<!-- Description of Goods -->
<c-col :span="19">
<el-form-item :label="blkMsg.title" :prop="blkMsg.dataUrl">
<c-input
type="textarea"
:rows="blkMsg.rows"
v-model="blkTextarea"
maxlength="2000"
show-word-limit
:placeholder="`请输入${blkMsg.title}`"
></c-input>
</el-form-item>
</c-col>
<c-col :span="2" class="BlkTextarea_button">
<c-button
size="small"
type="primary"
icon="el-icon-search"
@click="
showGridPromptDialog(rulePath, columns, shadow, modelUrl, isCover)
"
>
...
</c-button>
</c-col>
</div>
</template>
<script>
import Api from "~/service/Api";
import CommonProcess from "~/mixin/CommonProcess";
import _ from "~/utils/Lodash.js";
/**
*
* @param {String} rulePath 请求路径
* @param {String} columns 自定义需要展示列
* @param {String} shadow 自定义列后需要保留的影藏字段
* @param {String} modelUrl 非机构双击后需要回填的字段路劲,k:对应列,value:应用model路劲,如{TXT:'ledgrp.blk.lcrgod'}
* @param {String} isCover 非机构双击后需要回填的字段值是覆盖还是叠加,部分覆盖值为对象,false为叠加,如{TXT:false},k值为modelUrl的k,如全部覆盖则isCover='T',如全部叠加则isCover='',默认全部覆盖
*/
export default {
inject: ["root"],
props: {
model: {
type: Object,
default: undefined,
},
blkMsg: {
//大字段信息
type: Object,
default: function () {
return {
title: "货物说明",
dataUrl: "ledgrp.blk.lcrgod", //字段所在model路劲
rows: 20,
};
},
},
rulePath: {
type: String,
default: "",
},
columns: {
type: String,
default:'1 2 "EXTKEY" 410 50\r\n2 1 "NAM" 410 50\r\nTXT\r\nUIL\r\n5 3 "VER" 410 50\r\nETGEXTKEY\r\nP COLORED TRUE\r\nP VERTLINES TRUE\r\nP HORZLINES TRUE\r\nP MULTISELECT FALSE\r\nP COLUMNSIZING TRUE',
},
shadow: {
type: Object,
default: () => {
return { TXT: 3 };
},
},
modelUrl: {
type: Object,
default: function () {
let obj = { TXT: this.blkMsg.dataUrl };
return obj;
},
},
isCover: {
type: Object,
default: undefined,
},
},
mixins: [CommonProcess],
data() {
return {
blkTextarea: _.get(this.model, this.blkMsg.dataUrl, ""),
};
},
watch: {
getBlk: {
handler(val, oldVal) {
this.blkTextarea = _.get(this.model, this.blkMsg.dataUrl, "");
// console.log("blkTextarea is:", this.blkTextarea);
},
immediate: false,
},
blkTextarea: {
handler(val, oldVal) {
_.set(this.model, this.blkMsg.dataUrl, val);
// console.log("blkTextarea is 2:", this.blkTextarea);
},
immediate: false,
},
},
computed: {
getBlk() {
return _.get(this.model, this.blkMsg.dataUrl, "");
},
},
created: function () {},
};
</script>
<style>
.BlkTextarea_button {
margin: 20px 0 0 0px;
}
</style>
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