cloud-web-corejs 1.1.0-dev.27 → 1.1.0-dev.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/package.json +4 -11
  2. package/src/components/table/index.js +3 -0
  3. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +18 -1
  4. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +33 -20
  5. package/src/components/xform/form-render/container-item/data-table-mixin.js +16 -8
  6. package/src/components/xform/form-render/container-item/list-h5-item.vue +92 -309
  7. package/src/components/xform/utils/util.js +20 -0
  8. package/src/views/demo/bizTab/bill/billConfig.js +41 -0
  9. package/src/views/demo/bizTab/bill/detail.vue +436 -0
  10. package/src/views/demo/bizTab/bill/list.vue +288 -0
  11. package/src/views/demo/bizTab/bill/productDialog.vue +176 -0
  12. package/src/views/demo/bizTab/simple/billApi.js +123 -0
  13. package/src/views/demo/bizTab/simple/detail.vue +407 -0
  14. package/src/views/demo/bizTab/simple/list.vue +217 -0
  15. package/src/views/demo/bizTab/standalone/index.vue +121 -0
  16. package/src/views/demo/bizTab/wf/billConfig.js +44 -0
  17. package/src/views/demo/bizTab/wf/detail.vue +661 -0
  18. package/src/views/demo/bizTab/wf/list.vue +242 -0
  19. package/src/app-bootstrap.js +0 -523
  20. package/src/boot-assets.legacy.js +0 -7
  21. package/src/boot-assets.next.js +0 -7
  22. package/src/core-resources/css/h5.scss +0 -548
  23. package/src/core-resources/css/iconfont.css +0 -1447
  24. package/src/core-resources/font/iconfont.ttf +0 -0
  25. package/src/core-resources/font/iconfont.woff +0 -0
  26. package/src/core-resources/font/iconfont.woff2 +0 -0
  27. package/src/core-resources/images/default-header.png +0 -0
  28. package/src/core-resources/images/ico-default_wenjian.svg +0 -1
  29. package/src/core-resources/images/ico-excel.svg +0 -1
  30. package/src/core-resources/images/ico-ftl.svg +0 -7
  31. package/src/core-resources/images/ico-html.svg +0 -1
  32. package/src/core-resources/images/ico-java.svg +0 -1
  33. package/src/core-resources/images/ico-music.svg +0 -1
  34. package/src/core-resources/images/ico-pdf.svg +0 -1
  35. package/src/core-resources/images/ico-photo.svg +0 -1
  36. package/src/core-resources/images/ico-ppt.svg +0 -1
  37. package/src/core-resources/images/ico-psd.svg +0 -1
  38. package/src/core-resources/images/ico-service.png +0 -0
  39. package/src/core-resources/images/ico-txt.svg +0 -1
  40. package/src/core-resources/images/ico-video.svg +0 -1
  41. package/src/core-resources/images/ico-vue.svg +0 -8
  42. package/src/core-resources/images/ico-wenjianjia.svg +0 -1
  43. package/src/core-resources/images/ico-wrod.svg +0 -1
  44. package/src/core-resources/images/ico-xml.svg +0 -1
  45. package/src/core-resources/images/ico-yasuobao.svg +0 -1
  46. package/src/core-resources/images/icon-error.png +0 -0
  47. package/src/core-resources/images/icon-tips.png +0 -0
  48. package/src/core-resources/images/nodata.png +0 -0
  49. package/src/core-resources/images/nodata2.png +0 -0
  50. package/src/core-resources/js/base/common.js +0 -110
  51. package/src/icons/index.js +0 -9
  52. package/src/icons/svg/404.svg +0 -1
  53. package/src/icons/svg/alert.svg +0 -1
  54. package/src/icons/svg/bug.svg +0 -1
  55. package/src/icons/svg/button.svg +0 -1
  56. package/src/icons/svg/card.svg +0 -1
  57. package/src/icons/svg/cascader-field.svg +0 -1
  58. package/src/icons/svg/census.svg +0 -1
  59. package/src/icons/svg/chart.svg +0 -1
  60. package/src/icons/svg/checkbox-field.svg +0 -1
  61. package/src/icons/svg/clipboard.svg +0 -1
  62. package/src/icons/svg/color-field.svg +0 -1
  63. package/src/icons/svg/component.svg +0 -1
  64. package/src/icons/svg/custom-component.svg +0 -1
  65. package/src/icons/svg/dashboard.svg +0 -1
  66. package/src/icons/svg/data-table.svg +0 -1
  67. package/src/icons/svg/date-field.svg +0 -1
  68. package/src/icons/svg/date-range-field.svg +0 -1
  69. package/src/icons/svg/descriptions.svg +0 -1
  70. package/src/icons/svg/divider.svg +0 -1
  71. package/src/icons/svg/document.svg +0 -1
  72. package/src/icons/svg/documentation.svg +0 -1
  73. package/src/icons/svg/drag.svg +0 -1
  74. package/src/icons/svg/echart-category.svg +0 -1
  75. package/src/icons/svg/echart-pie.svg +0 -1
  76. package/src/icons/svg/echart.svg +0 -1
  77. package/src/icons/svg/edit.svg +0 -1
  78. package/src/icons/svg/education.svg +0 -1
  79. package/src/icons/svg/email.svg +0 -1
  80. package/src/icons/svg/example.svg +0 -1
  81. package/src/icons/svg/excel.svg +0 -1
  82. package/src/icons/svg/exit-fullscreen.svg +0 -1
  83. package/src/icons/svg/eye-open.svg +0 -1
  84. package/src/icons/svg/eye.svg +0 -1
  85. package/src/icons/svg/file-upload-field.svg +0 -1
  86. package/src/icons/svg/form.svg +0 -1
  87. package/src/icons/svg/fullscreen.svg +0 -1
  88. package/src/icons/svg/github.svg +0 -1
  89. package/src/icons/svg/grid.svg +0 -1
  90. package/src/icons/svg/guide.svg +0 -1
  91. package/src/icons/svg/html-text.svg +0 -1
  92. package/src/icons/svg/ico-more.svg +0 -1
  93. package/src/icons/svg/ico-wenjianjia.svg +0 -1
  94. package/src/icons/svg/icon.svg +0 -1
  95. package/src/icons/svg/input-batch.svg +0 -1
  96. package/src/icons/svg/international.svg +0 -1
  97. package/src/icons/svg/language.svg +0 -1
  98. package/src/icons/svg/link.svg +0 -1
  99. package/src/icons/svg/list-export.svg +0 -1
  100. package/src/icons/svg/list.svg +0 -1
  101. package/src/icons/svg/lock.svg +0 -1
  102. package/src/icons/svg/message.svg +0 -1
  103. package/src/icons/svg/money.svg +0 -1
  104. package/src/icons/svg/nested.svg +0 -1
  105. package/src/icons/svg/news-list.svg +0 -1
  106. package/src/icons/svg/node-tree.svg +0 -1
  107. package/src/icons/svg/number-field.svg +0 -1
  108. package/src/icons/svg/password.svg +0 -1
  109. package/src/icons/svg/pdf.svg +0 -1
  110. package/src/icons/svg/people.svg +0 -1
  111. package/src/icons/svg/peoples.svg +0 -1
  112. package/src/icons/svg/picture-upload-field.svg +0 -1
  113. package/src/icons/svg/qq.svg +0 -1
  114. package/src/icons/svg/query.svg +0 -1
  115. package/src/icons/svg/radio-field.svg +0 -1
  116. package/src/icons/svg/rate-field.svg +0 -1
  117. package/src/icons/svg/redo.svg +0 -1
  118. package/src/icons/svg/rich-editor-field.svg +0 -1
  119. package/src/icons/svg/search.svg +0 -1
  120. package/src/icons/svg/searchbox.svg +0 -1
  121. package/src/icons/svg/section.svg +0 -1
  122. package/src/icons/svg/select-field.svg +0 -1
  123. package/src/icons/svg/shopping.svg +0 -1
  124. package/src/icons/svg/size.svg +0 -1
  125. package/src/icons/svg/skill.svg +0 -1
  126. package/src/icons/svg/slider-field.svg +0 -1
  127. package/src/icons/svg/slot-component.svg +0 -1
  128. package/src/icons/svg/slot-field.svg +0 -1
  129. package/src/icons/svg/star.svg +0 -1
  130. package/src/icons/svg/static-text.svg +0 -1
  131. package/src/icons/svg/status.svg +0 -1
  132. package/src/icons/svg/sub-form.svg +0 -1
  133. package/src/icons/svg/switch-field.svg +0 -1
  134. package/src/icons/svg/tab.svg +0 -1
  135. package/src/icons/svg/table.svg +0 -1
  136. package/src/icons/svg/text-field.svg +0 -1
  137. package/src/icons/svg/text.svg +0 -1
  138. package/src/icons/svg/textarea-field.svg +0 -1
  139. package/src/icons/svg/theme.svg +0 -1
  140. package/src/icons/svg/time-field.svg +0 -1
  141. package/src/icons/svg/time-range-field.svg +0 -1
  142. package/src/icons/svg/tips-text.svg +0 -1
  143. package/src/icons/svg/title-head.svg +0 -1
  144. package/src/icons/svg/tree-pane.svg +0 -1
  145. package/src/icons/svg/tree-table.svg +0 -1
  146. package/src/icons/svg/tree.svg +0 -1
  147. package/src/icons/svg/undo.svg +0 -1
  148. package/src/icons/svg/uploadbox.svg +0 -1
  149. package/src/icons/svg/user.svg +0 -1
  150. package/src/icons/svg/vf-box.svg +0 -1
  151. package/src/icons/svg/vf-dialog.svg +0 -1
  152. package/src/icons/svg/vf-drawer.svg +0 -1
  153. package/src/icons/svg/vue-sfc.svg +0 -1
  154. package/src/icons/svg/wechat.svg +0 -1
  155. package/src/icons/svg/zip.svg +0 -1
  156. package/src/index.next.js +0 -5
  157. package/src/styles/btn.scss +0 -104
  158. package/src/styles/element-ui.scss +0 -155
  159. package/src/styles/element-variables.scss +0 -31
  160. package/src/styles/global.scss +0 -115
  161. package/src/styles/index.scss +0 -200
  162. package/src/styles/menu-icons.scss +0 -75
  163. package/src/styles/mixin.scss +0 -72
  164. package/src/styles/nprogress.scss +0 -14
  165. package/src/styles/sidebar.scss +0 -281
  166. package/src/styles/split-handle.scss +0 -52
  167. package/src/styles/theme-variables.scss +0 -7
  168. package/src/styles/transition.scss +0 -48
  169. package/src/styles/utilities.scss +0 -137
  170. package/src/styles/variables.scss +0 -44
@@ -0,0 +1,436 @@
1
+ <template>
2
+ <div class="detail-wrap">
3
+ <!--
4
+ 结构约定:wfUtil 默认把「流程信息」面板挂到 .el-form .d-cont,把侧边导航挂到
5
+ .el-form .slide-wrap,「修改单据」按钮塞进 .el-form .d-header > .fr,
6
+ 所以 el-form 必须包住 baseTabs。
7
+ :disabled="billDisabled" 一绑,表单里的字段就整片自动禁用,不用逐个绑。
8
+ -->
9
+ <el-form ref="editForm" :model="billModel" :disabled="billDisabled">
10
+ <!-- 这层空 el-form 用来隔断 disabled 注入(element 的 Form 是 provide elForm: this,
11
+ 嵌套一层就把外层 disabled 挡在外面),头部按钮不会被单据只读态带禁 -->
12
+ <el-form>
13
+ <div class="d-header clearfix">
14
+ <div class="fl">
15
+ <i class="el-icon-info" />
16
+ {{
17
+ isAdd
18
+ ? $t1("新增产品变更申请")
19
+ : $t1("产品变更申请") + " " + (billModel.sn || "")
20
+ }}
21
+ </div>
22
+ <!-- 翻单、提交流程、重置、保存,显隐与文案都由组件统一处理 -->
23
+ <biz-bill-actions :detail="_self" />
24
+ </div>
25
+ </el-form>
26
+
27
+ <baseTabs>
28
+ <baseTabPane :label="$t1('基本信息')">
29
+ <template #default>
30
+ <table class="table-detail">
31
+ <tbody>
32
+ <tr>
33
+ <th>{{ $t1("变更单号") }}</th>
34
+ <td>{{ billModel.sn || $t1("保存后自动生成") }}</td>
35
+ <th>{{ $t1("状态") }}</th>
36
+ <td>
37
+ <div :class="statusInfo.cls">{{ statusInfo.label }}</div>
38
+ </td>
39
+ <th>{{ $t1("变更类型") }}</th>
40
+ <td>
41
+ <el-form-item prop="type">
42
+ <el-select
43
+ v-model="billModel.type"
44
+ :placeholder="$t1('请选择')"
45
+ clearable
46
+ >
47
+ <el-option :label="$t1('产品变更')" :value="0" />
48
+ <el-option :label="$t1('零件变更')" :value="1" />
49
+ </el-select>
50
+ </el-form-item>
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <th><em class="f-red">*</em>{{ $t1("变更原因") }}</th>
55
+ <td colspan="5">
56
+ <el-form-item
57
+ prop="remark"
58
+ :rules="[
59
+ {
60
+ required: true,
61
+ message: $t1('变更原因不能为空'),
62
+ trigger: ['blur', 'change'],
63
+ },
64
+ ]"
65
+ >
66
+ <el-input
67
+ type="textarea"
68
+ :rows="1"
69
+ v-model="billModel.remark"
70
+ clearable
71
+ />
72
+ </el-form-item>
73
+ </td>
74
+ </tr>
75
+ <tr v-if="!isAdd">
76
+ <th>{{ $t1("创建人") }}</th>
77
+ <td>{{ billModel._createBy }}</td>
78
+ <th>{{ $t1("创建时间") }}</th>
79
+ <td>{{ billModel.create_date }}</td>
80
+ <th>{{ $t1("更新时间") }}</th>
81
+ <td>{{ billModel.modify_date }}</td>
82
+ </tr>
83
+ </tbody>
84
+ </table>
85
+ </template>
86
+ </baseTabPane>
87
+
88
+ <baseTabPane :label="$t1('变更明细')">
89
+ <!-- 子表可增删,新增的单据才存得下去(只读态不放按钮) -->
90
+ <template #button>
91
+ <el-button
92
+ v-if="!billDisabled"
93
+ class="button-sty"
94
+ icon="el-icon-plus"
95
+ @click="showProductDialog = true"
96
+ >{{ $t1("选择产品") }}</el-button
97
+ >
98
+ </template>
99
+ <template #default>
100
+ <vxe-grid
101
+ ref="itemGrid"
102
+ :data="itemRows"
103
+ v-bind="itemOption"
104
+ @resizable-change="$vxeTableUtil.onColumnWitchChange"
105
+ @custom="$vxeTableUtil.customHandle"
106
+ ></vxe-grid>
107
+ </template>
108
+ </baseTabPane>
109
+ </baseTabs>
110
+ </el-form>
111
+
112
+ <product-dialog
113
+ v-if="showProductDialog"
114
+ :visiable.sync="showProductDialog"
115
+ multi="true"
116
+ @confirm="confirmInsertProduct"
117
+ />
118
+ </div>
119
+ </template>
120
+
121
+ <script>
122
+ /**
123
+ * demo B 单据详情:formCode + 通用 bd_api(脚本 getOne / getList / saveUpdate / findItemPage)。
124
+ * 请求写法照 stdxx 的 views/pmd/product/product_change/edit.vue 逐条搬,那边能跑这边就能跑。
125
+ *
126
+ * 混入 bizBillDetailMixin 后,本文件只写四件业务的事:
127
+ * billOptions / buildLoadRequest / applyBillData / saveBill
128
+ * 保存并提交、提交后关页签、通过自动保存、翻单都由 mixin + 宿主负责。
129
+ *
130
+ * 这里没实现 isBillDirty():关页签时退回内置判断——只拦「还没存过的新增页签」。
131
+ * 想按实际改动拦,参考 ../simple/detail.vue 的快照对比写法。
132
+ */
133
+ import { bizBillDetailMixin } from "@base/components/bizTab";
134
+ import {
135
+ requiredHeader,
136
+ buildRowProp,
137
+ } from "@base/components/bizTab/billTableUtil";
138
+ import BizBillActions from "@base/components/bizTab/BizBillActions.vue";
139
+ import productDialog from "./productDialog.vue";
140
+ import { BILL, STATUS_MAP } from "./billConfig";
141
+
142
+ export default {
143
+ name: "demoBizTabBillDetail",
144
+ components: { BizBillActions, productDialog },
145
+ mixins: [bizBillDetailMixin],
146
+ data() {
147
+ return {
148
+ billModel: this.getDefaultModel(),
149
+ itemOption: {},
150
+ showProductDialog: false,
151
+ };
152
+ },
153
+ computed: {
154
+ billOptions() {
155
+ return {
156
+ prefix: BILL.prefix,
157
+ formCode: BILL.formCode,
158
+ taBm: BILL.taBm,
159
+ wfCode: BILL.wfCode,
160
+ titleField: BILL.titleField,
161
+ wfEnabled: true,
162
+ saveSubmitEnabled: true, // 新增页显示「保存并提交流程」
163
+ wfStartBindSave: true, // 点「提交流程」先校验并自动保存
164
+ wfAgreeBindSave: true, // 审批点「通过」自动保存单据
165
+ };
166
+ },
167
+ statusInfo() {
168
+ return STATUS_MAP[this.billModel.status] || { label: "-", cls: "" };
169
+ },
170
+ /**
171
+ * 子表数据放在 billModel[taBm] 里(和 stdxx 原页面一致),不单独挂一个 data 字段——
172
+ * 因为单元格里 el-form-item 的 prop 路径必须在 editForm 的 model 下真实可达,
173
+ * 挂在模型外面的话 element 会 warn「please transfer a valid prop path」且校验不生效。
174
+ */
175
+ itemRows() {
176
+ return this.billModel[BILL.itemTaBm] || [];
177
+ },
178
+ },
179
+ mounted() {
180
+ this.loadBill();
181
+ this.initItemTable();
182
+ },
183
+ methods: {
184
+ getDefaultModel() {
185
+ return {
186
+ id: null,
187
+ sn: null,
188
+ status: 0,
189
+ type: BILL.type,
190
+ remark: null,
191
+ _createBy: null,
192
+ create_date: null,
193
+ modify_date: null,
194
+ // 子表也放模型里,行内 form-item 的 prop 路径才可达(如 pcp_item_change_item.2.xxx)
195
+ [BILL.itemTaBm]: [],
196
+ };
197
+ },
198
+ setItemRows(rows) {
199
+ this.$set(this.billModel, BILL.itemTaBm, rows || []);
200
+ },
201
+
202
+ // ===== bizBillDetailMixin 要求实现的业务钩子 =====
203
+ buildLoadRequest(dataId) {
204
+ return {
205
+ url: BILL.prefix + `/bd_api/${BILL.formCode}/getOne`,
206
+ method: "post",
207
+ data: {
208
+ fixeData: {},
209
+ formCode: BILL.formCode,
210
+ taBm: BILL.taBm,
211
+ data: { id: dataId },
212
+ },
213
+ };
214
+ },
215
+ applyBillData(objx) {
216
+ if (!objx) {
217
+ this.billModel = this.getDefaultModel();
218
+ this.setItemRows([]);
219
+ return;
220
+ }
221
+ // getOne 不回子表,子表走 getList;先保住默认的空数组,别被 objx 覆盖掉
222
+ this.billModel = Object.assign(this.getDefaultModel(), objx, {
223
+ [BILL.itemTaBm]: [],
224
+ });
225
+ this.loadItems();
226
+ },
227
+ saveBill(options) {
228
+ let opts = options || {};
229
+ return new Promise((resolve) => {
230
+ let done = () => this.postSave(opts, resolve);
231
+ if (opts.confirm === false) {
232
+ done();
233
+ return;
234
+ }
235
+ this.$baseConfirm(this.$t1("您确定要保存吗?")).then(done, () =>
236
+ resolve(null)
237
+ );
238
+ });
239
+ },
240
+ // 数据级校验:子表是 scrollY gt:20 的虚拟滚动,屏外行的行内 form-item 不存在、校验不到,
241
+ // 所以按数据兜一遍(本单子表只有「变更后描述」可改)
242
+ validateBillData() {
243
+ return this.checkRowsRequired({
244
+ label: this.$t1("变更明细"),
245
+ rows: this.$refs.itemGrid
246
+ ? this.$refs.itemGrid.getTableData().fullData
247
+ : this.itemRows,
248
+ fields: [
249
+ { field: "change_itemdesc", label: this.$t1("变更后描述") },
250
+ ],
251
+ });
252
+ },
253
+ // 覆盖默认判据,叠加单据状态:mixin 默认只看流程(没启动就能改)。
254
+ // billDisabled(字段自动禁用)和「重置/保存」的显隐都以它为准。
255
+ canEditBill() {
256
+ if (this.hasWf) return !!(this.wfInfo && this.wfInfo.toModify);
257
+ return this.isAdd || this.billModel.status === 0;
258
+ },
259
+ // 已审核/审核中的单据不许再提交流程(mixin 默认放开,这里按状态卡住)
260
+ canStartWf() {
261
+ return this.billModel.status === 0 || this.billModel.status == null;
262
+ },
263
+
264
+ // ===== 业务内部 =====
265
+ postSave(opts, resolve) {
266
+ // 整表提交:data 里带哪几张表,后台就按哪几张表落库。
267
+ // 主表对象里不能再夹带子表数组和审计字段(照 stdxx 原页面的处理)。
268
+ let main = { ...this.billModel };
269
+ delete main._createBy;
270
+ delete main._modifyBy;
271
+ delete main[BILL.itemTaBm];
272
+ let itemRows = this.$refs.itemGrid
273
+ ? this.$refs.itemGrid.getTableData().fullData
274
+ : this.itemRows;
275
+ let data = {};
276
+ data[BILL.taBm] = main;
277
+ data[BILL.itemTaBm] = itemRows;
278
+ this.$http({
279
+ url: BILL.prefix + `/bd_api/${BILL.formCode}/saveUpdate`,
280
+ method: "post",
281
+ data: {
282
+ fixeData: {},
283
+ formCode: BILL.formCode,
284
+ taBm: BILL.taBm,
285
+ data: data,
286
+ },
287
+ isLoading: true,
288
+ success: (res) => {
289
+ // 新增返回新单号;更新时后台可能不回 objx,退回当前单号
290
+ let dataId = res && res.objx ? res.objx : this.dataId;
291
+ if (opts.successMsg !== false) {
292
+ this.$message({
293
+ message: res.content,
294
+ type: "success",
295
+ duration: 500,
296
+ });
297
+ }
298
+ resolve(dataId);
299
+ },
300
+ fail: () => resolve(null),
301
+ error: () => resolve(null),
302
+ });
303
+ },
304
+ loadItems() {
305
+ if (this.isAdd) return;
306
+ this.$http({
307
+ url: BILL.prefix + `/bd_api/${BILL.formCode}/getList`,
308
+ method: "post",
309
+ data: {
310
+ fixeData: {},
311
+ formCode: BILL.formCode,
312
+ taBm: BILL.itemTaBm,
313
+ data: { id: this.dataId },
314
+ },
315
+ success: (res) => {
316
+ this.setItemRows((res && res.objx) || []);
317
+ },
318
+ });
319
+ },
320
+ confirmInsertProduct(rows) {
321
+ if (!rows || !rows.length) return;
322
+ let exists = {};
323
+ this.itemRows.forEach((row) => {
324
+ exists[row.itemcode] = true;
325
+ });
326
+ let adds = [];
327
+ rows.forEach((row) => {
328
+ if (exists[row.itemcode]) return;
329
+ adds.push({
330
+ id: null,
331
+ itemcode: row.itemcode,
332
+ f_ref_itemdesc: row.itemdesc,
333
+ f_ref_category_name: row.category_name,
334
+ change_itemdesc: row.itemdesc,
335
+ });
336
+ });
337
+ if (!adds.length) {
338
+ this.$message.warning(this.$t1("所选产品都已在明细中"));
339
+ return;
340
+ }
341
+ this.setItemRows(this.itemRows.concat(adds));
342
+ },
343
+ initItemTable() {
344
+ let tableOption = {
345
+ vue: this,
346
+ tableRef: "itemGrid",
347
+ tableName: "demo-bizTab-bill-item",
348
+ columns: [
349
+ { type: "checkbox", fixed: "left", width: 48, resizable: false },
350
+ {
351
+ title: this.$t1("产品分类名称"),
352
+ field: "f_ref_category_name",
353
+ width: 200,
354
+ sortable: false,
355
+ filterType: false,
356
+ },
357
+ {
358
+ title: this.$t1("产品编码"),
359
+ field: "itemcode",
360
+ width: 150,
361
+ sortable: false,
362
+ filterType: false,
363
+ },
364
+ {
365
+ title: this.$t1("产品名称"),
366
+ field: "f_ref_itemdesc",
367
+ width: 220,
368
+ sortable: false,
369
+ filterType: false,
370
+ },
371
+ {
372
+ title: this.$t1("变更后描述"),
373
+ field: "change_itemdesc",
374
+ minWidth: 220,
375
+ sortable: false,
376
+ filterType: false,
377
+ slots: {
378
+ // 表头星号要自己加:element 的 * 是 el-form-item 按 label 渲染的,表格里没有 label
379
+ header: requiredHeader(this.$t1("变更后描述")),
380
+ default: ({ row, rowIndex }) => {
381
+ if (this.billDisabled) return [row.change_itemdesc];
382
+ // 必须套 el-form-item + 指向 model 的真实 prop 路径,element 才会加 is-error(红框);
383
+ // 裸着写 el-input 永远不会标红。show-message 关掉是因为单元格容不下错误文案,
384
+ // 具体是哪行哪个字段由 validateBillData() 的提示说明。
385
+ return [
386
+ <el-form-item
387
+ prop={buildRowProp(BILL.itemTaBm, rowIndex, "change_itemdesc")}
388
+ rules={[{ required: true, trigger: ["blur", "change"] }]}
389
+ show-message={false}
390
+ >
391
+ <el-input v-model={row.change_itemdesc} size="small" clearable />
392
+ </el-form-item>,
393
+ ];
394
+ },
395
+ },
396
+ },
397
+ {
398
+ width: 47,
399
+ fixed: "right",
400
+ title: "",
401
+ sortable: false,
402
+ slots: {
403
+ default: ({ rowIndex }) => {
404
+ if (this.billDisabled) return [];
405
+ return [
406
+ <a
407
+ href="javascript:void(0);"
408
+ class="a-link"
409
+ onclick={(e) => {
410
+ e.stopPropagation();
411
+ this.itemRows.splice(rowIndex, 1);
412
+ }}
413
+ >
414
+ <el-tooltip
415
+ enterable={false}
416
+ effect="dark"
417
+ content={this.$t1("删除")}
418
+ placement="top"
419
+ popper-class="tooltip-skin"
420
+ >
421
+ <i class="el-icon-delete" />
422
+ </el-tooltip>
423
+ </a>,
424
+ ];
425
+ },
426
+ },
427
+ },
428
+ ],
429
+ };
430
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
431
+ this.itemOption = opts;
432
+ });
433
+ },
434
+ },
435
+ };
436
+ </script>