1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<template>
<div>
<el-dialog v-dialogDrag title="备忘录新增" :visible="visible" :modal-append-to-body="false" :append-to-body="true"
:close-on-click-modal="false" :before-close="beforeClose" center destroy-on-close width="70%" v-if="visible">
<el-form v-if="visible" ref="diaForm" :model="diaVo" :rules="rules" label-width="100px">
<c-col :span="12" style="padding-right: 20px;">
<c-col :span="24">
<el-form-item label="业务类型">
<c-select v-model="atpcod" dbCode="BUSTXT" :isShowKeyAndLabel="true" disabled placeholder="请选择业务类型">
</c-select>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="交易码" prop="frm">
<c-select v-model="diaVo.frm" dbCode="ATPTXT" :isShowKeyAndLabel="true" uil="CN" placeholder="请选择交易码">
</c-select>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="提示日期" prop="dat">
<c-date-picker type="date" v-model="diaVo.dat" placeholder="选择日期" format="yyyy-MM-dd" :picker-options="{
disabledDate: (time) =>
time.getTime() <
new Date(new Date().setHours(0, 0, 0, 0))
}" @change="customAddModify(diaVo, 'dat')"></c-date-picker>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="描述" prop="nam">
<c-input v-model="diaVo.nam"></c-input>
</el-form-item>
</c-col>
<!-- <c-col :span="24">
<el-form-item label="预计核验日期">
<c-date-picker type="date" v-model="diaVo.prechkdat" format="yyyy-MM-dd"></c-date-picker>
</el-form-item>
</c-col> -->
</c-col>
<c-col :span="12" style="padding-left: 20px;">
<c-col :span="24">
<el-form-item label="业务编号" prop="objref">
<c-input v-model="diaVo.objref" disabled></c-input>
</el-form-item>
</c-col>
<!-- <c-col :span="24">
<el-form-item label="交易码名称" prop="frmtxt">
<c-input v-model="diaVo.frmtxt" disabled></c-input>
</el-form-item>
</c-col> -->
<c-col :span="24">
<el-form-item label="备忘录原因" prop="cod">
<c-select v-model="diaVo.cod" dbCode="DIATXT" :isShowKeyAndLabel="true" placeholder="请选择备忘录原因"></c-select>
</el-form-item>
</c-col>
<!-- <c-col :span="24">
<el-form-item label="备忘录状态">
<c-select v-model="diaVo.diamodflg" dbCode="DIAMOD" disabled></c-select>
</el-form-item>
</c-col> -->
<c-col :span="24">
<el-form-item label="是否处理">
<el-radio v-model="diaVo.donflg" label="X">已处理</el-radio>
<el-radio v-model="diaVo.donflg" label="">未处理</el-radio>
</el-form-item>
</c-col>
</c-col>
<c-col :span="24">
<el-form-item label="详细信息">
<el-input type="textarea" :rows="5" placeholder="请输入内容" v-model="diaVo.inftxt">
</el-input>
</el-form-item>
</c-col>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveDialog()">确 定</el-button>
<el-button @click="closeDialog()">取 消</el-button>
</span>
</el-dialog>
<!--交易列表 弹窗 -->
<el-dialog v-dialogDrag width="50%" :title="dialogTitle" :append-to-body="true" :visible.sync="dialogTableVisible" v-if="dialogTableVisible">
<div v-if="!loadingFlag && tableList.length === 0">暂无数据</div>
<div v-else style="height: 100%;">
<el-table id='tableRef' height="calc(100% - 32px)" size="small" v-loading="loadingFlag" :data="tableList"
@row-dblclick="dbClickRow" :before-close="beforeCloseFrmDialog">
<el-table-column v-for="(item,key) in tableColumn" :key="key" :prop="item.prop" :width="item.width"
:label="item.label">
</el-table-column>
</el-table>
</div>
</el-dialog>
</div>
</template>
<script>
import commonDepend from "~/mixin/commonDepend.js";
import {
cloneDeep
} from "lodash";
import Api from '~/service/Api';
import moment from 'moment'
import {
debuglog
} from 'util';
export default {
mixins: [commonDepend],
props: {
codes: Object,
visible: {
type: Boolean,
default: false
},
diaVo: {
type: Object,
default: () => {}
},
},
computed: {
atpcod: {
get() {
return this.diaVo.frm ? this.diaVo.frm.substring(0, 2) : "";
},
set(value) {
return value;
}
}
},
data() {
return {
//交易
rules: {
"frm": [{
required: true,
message: "必输项"
}],
"cod": [{
required: true,
message: "必输项"
}],
"nam": [{
required: true,
message: "必输项"
}],
"dat": [{
required: true,
message: "必输项"
}],
"objref": [{
required: true,
message: "必输项"
}],
"frmtxt": [{
required: true,
message: "必输项"
}],
},
currentPage: 1,
total: 0,
pageSize: 5,
tableList: [],
loadingFlag: true,
dialogTitle: "",
dialogTableVisible: false,
tableColumn: [{
label: "序号",
prop: "index"
},
{
label: "交易代码",
prop: "cod"
},
{
label: "交易名称",
prop: "txt"
}
] //交易代码模态框--end
};
},
methods: {
saveDialog() {
this.$refs['diaForm'].validate((validStatic) => {
if (validStatic) {
this.$emit("insertDialog", this.diaVo);
this.$message.success("新增成功!");
}
})
},
closeDialog() {
this.$emit("closeInsertDialog");
},
beforeClose() {
this.$emit("closeInsertDialog");
},
toUpperCase() {
this.diaVo.frm = this.diaVo.frm.toUpperCase();
},
//交易代码
async onSeainf() {
this.dialogTitle = `交易列表`;
this.dialogTableVisible = true;
// 分层取值
this.loadingFlag = true;
this.tableList = [];
this.currentPage = 1;
this.pageSize = 10000;
this.total = 0;
// 获取table的表格数据
let params = {
//cod: this.model.atp.cod,
cod: this.diaVo.frm,
pageNo: this.currentPage,
pageSize: this.pageSize
};
const res = await Api.post("/public/quesel/getFrameList", params);
if (res.respCode === SUCCESS) {
if (res.data && res.data.list) {
this.total = res.data.total;
res.data.list.forEach((item, i) => {
item.index = i + 1;
});
this.tableList = res.data.list;
}
}
this.loadingFlag = false; //接口调完变成false
},
async dbClickRow(row, column, event) {
// 回填数据
this.diaVo.frm = row.cod;
this.diaVo.frmtxt = row.txt;
this.dialogTableVisible = false;
},
beforeCloseFrmDialog() {
this.dialogTableVisible = false;
this.currentPage = 1;
},
}
};
</script>
<style></style>