cloud-web-corejs 1.0.54-dev.797 → 1.0.54-dev.799
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.
- package/package.json +3 -1
- package/src/components/baseTabs/mixins.js +11 -12
- package/src/components/bizTab/BizBillActions.vue +129 -0
- package/src/components/bizTab/BizTabListPage.vue +391 -0
- package/src/components/bizTab/README.md +378 -0
- package/src/components/bizTab/billTableUtil.js +48 -0
- package/src/components/bizTab/billValidators.js +136 -0
- package/src/components/bizTab/bizBillDetailMixin.js +687 -0
- package/src/components/bizTab/index.js +24 -0
- package/src/components/excelExport/exportFieldDialog.vue +373 -367
- package/src/components/excelExport/exportType.js +49 -0
- package/src/components/excelExport/mixins.js +1153 -1141
- package/src/components/vb-tabs/x-tabs.vue +167 -143
- package/src/components/wf/wfUtil.js +327 -292
- package/src/components/xform/form-designer/designer.js +56 -8
- package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +59 -5
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +60 -8
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +8 -2
- package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +120 -92
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +63 -94
- package/src/components/xform/form-designer/index.vue +0 -1
- package/src/components/xform/form-designer/setting-panel/dataSource-setting.vue +397 -397
- package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +602 -602
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +13 -13
- package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +585 -585
- package/src/components/xform/form-designer/setting-panel/property-editor/a-link-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/a-text-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/alignType-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/censusClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/colorClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +1154 -1154
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +96 -80
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail-plain/detail-plain-editor.vue +75 -75
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/colHeight-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-height-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/container-h5-card/h5-card-editor.vue +124 -124
- package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/height-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/width-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue +119 -119
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tabClass-editor.vue +45 -45
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +344 -344
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tree/tree-customClass-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tree-pane/tree-pane-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/cancelButtonLabel-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/okButtonLabel-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/title-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/width-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/containerClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/customClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/descriptionsItems-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/dsName-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/echartHeight-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-accessUrl/accessUrl-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaDataType-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaMinLevel-editor.vue +50 -50
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaName-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-autocomplete/autocomplete-vabSearchName-editor.vue +7 -7
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/addTableData-event-editor.vue +84 -84
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +97 -97
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/form-host-event-editor.vue +188 -188
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +237 -237
- package/src/components/xform/form-designer/setting-panel/property-editor/field-common/keyName-editor.vue +74 -67
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-dateLimit-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultTime-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-menu-editor.vue +59 -59
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +11 -11
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +10 -10
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-pie-editor.vue +12 -12
- package/src/components/xform/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue +44 -44
- package/src/components/xform/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue +29 -29
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +6 -6
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue +44 -44
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +115 -115
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +115 -115
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-script/script-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/fontSize-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/inactiveText-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-button-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +74 -71
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-timeLimit-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchField-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchName-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vue-page/vue-page-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesSelect.vue +176 -176
- package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +2 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/formatType-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +972 -972
- package/src/components/xform/form-designer/setting-panel/property-editor/iconClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/label-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelAlign-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelColor-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/limit-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/max-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/maxLength-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/min-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/minLength-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +178 -178
- package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/placeholder-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/precision-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +6 -6
- package/src/components/xform/form-designer/setting-panel/property-editor/requiredHint-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/rows-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/space-editor-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/step-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/styleTableClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/styleTitClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/tempStorage-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/uploadTip-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/uploadURL-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/urlValueEnabled-editor.vue +91 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/validation-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/validationHint-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/widgetWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -0
- package/src/components/xform/form-designer/widget-panel/index.vue +3 -1
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +55 -13
- package/src/components/xform/form-render/container-item/data-table-mixin copy.js +5910 -0
- package/src/components/xform/form-render/container-item/data-table-mixin.js +59 -13
- package/src/components/xform/form-render/container-item/detail-item.vue +52 -11
- package/src/components/xform/form-render/container-item/tab-item.vue +6 -2
- package/src/components/xform/form-render/indexMixin.js +56 -16
- package/src/components/xform/lang/zh-CN.js +2 -1
- package/src/components/xform/utils/attachmentValueUtil.js +239 -0
- package/src/components/xform/utils/util.js +27 -0
- package/src/mixins/wf/index.js +40 -38
- package/src/router/modules/customer.js +50 -0
- package/src/store/config/index.js +46 -0
- package/src/utils/scrollUtil.js +25 -0
- package/src/views/demo/bizTab/bill/billConfig.js +41 -0
- package/src/views/demo/bizTab/bill/detail.vue +436 -0
- package/src/views/demo/bizTab/bill/list.vue +288 -0
- package/src/views/demo/bizTab/bill/productDialog.vue +176 -0
- package/src/views/demo/bizTab/simple/billApi.js +123 -0
- package/src/views/demo/bizTab/simple/detail.vue +407 -0
- package/src/views/demo/bizTab/simple/list.vue +217 -0
- package/src/views/demo/bizTab/standalone/index.vue +121 -0
- package/src/views/demo/bizTab/wf/billConfig.js +44 -0
- package/src/views/demo/bizTab/wf/detail.vue +661 -0
- package/src/views/demo/bizTab/wf/list.vue +242 -0
- package/src/views/user/outLink/cc_form_view.vue +185 -0
|
@@ -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>
|