imeik-bizui 0.7.2 → 0.7.4

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.
@@ -83,11 +83,12 @@ const typeItems = {
83
83
  type: 'ImInput',
84
84
  prop: 'promiseTarget',
85
85
  label: '承诺目标',
86
+ span: 24,
86
87
  rules: [{ required: true, message: '请输入承诺目标' }],
87
88
  attrs: {
88
89
  type: 'textarea',
89
90
  rows: 4,
90
- maxlength: 5000,
91
+ maxlength: 500,
91
92
  'show-word-limit': true,
92
93
  placeholder: '注明:在上述时间断内可完成多少提货'
93
94
  }
@@ -13,7 +13,16 @@
13
13
  <template slot="materialCountInfo" slot-scope="{ row }">
14
14
  <div class="flex countView">
15
15
  <!-- <span class="materialCount">申请数量:</span> -->
16
- <el-input v-if="!isView" v-model="row.materialQuantity" type="number" style="margin-right: 30px" :min="0" placeholder="请输入数量" @input="handleInput(row)"></el-input>
16
+ <el-input
17
+ v-if="!isView"
18
+ v-model="row.materialQuantity"
19
+ type="number"
20
+ :class="{ 'is-error': !row.materialQuantity && row.valid === false }"
21
+ style="margin-right: 30px"
22
+ :min="0"
23
+ placeholder="请输入数量"
24
+ @input="handleInput(row)"
25
+ ></el-input>
17
26
  <p v-else>{{ row.materialQuantity || '-' }}</p>
18
27
  </div>
19
28
  <p class="materialSubName" style="margin-top: 8px">规格型号:{{ row.materialModel }}</p>
@@ -66,14 +75,20 @@
66
75
  </el-radio-group>
67
76
  <div v-else>{{ row.materialIsSpecifiedBatch === '1' ? '是' : '否' }}</div>
68
77
  <div v-if="row.materialIsSpecifiedBatch === '1' && !approvalInputBatch">
69
- <el-input v-if="!isView" v-model="row.materialBatch" style="margin-top: 16px" placeholder="请输入批次号"></el-input>
78
+ <el-input v-if="!isView" v-model="row.materialBatch" style="margin-top: 16px" :class="{ 'is-error': !row.materialBatch && row.valid === false }" placeholder="请输入批次号"></el-input>
79
+ <div v-else>{{ row.materialBatch || '-' }}</div>
80
+ </div>
81
+ <!-- 在审批时候要处理的输入框 -->
82
+ <div v-if="row.materialIsSpecifiedBatch === '1' && approvalInputBatch && fromApproval">
83
+ <el-input v-if="!row.materialBatch" v-model="row.materialBatch" style="margin-top: 16px" :class="{ 'is-error': !row.materialBatch && row.valid === false }" placeholder="请输入批次号"></el-input>
70
84
  <div v-else>{{ row.materialBatch || '-' }}</div>
71
85
  </div>
72
86
  </template>
73
87
  <template slot="warehouse" slot-scope="{ row }">
74
- <el-select v-if="!isView" v-model="row.warehouse" placeholder="请选择" @change="(val) => handleChangeWarehouse(val, row)">
88
+ <el-select v-if="fromApproval && !row.warehouseNumber" v-model="row.warehouseNumber" placeholder="请选择" :class="{ 'is-error': !row.materialBatch && row.valid === false }" @change="(val) => handleChangeWarehouse(val, row)">
75
89
  <el-option v-for="item in warehouseList || []" :key="item.warehouseNumber" style="width: 100%" :label="item.warehouseName" :value="item.warehouseNumber"> </el-option>
76
90
  </el-select>
91
+ <div v-else>{{ row.warehouseName || '-' }}</div>
77
92
  </template>
78
93
  <template slot="remarks" slot-scope="{ row }">
79
94
  <el-input v-if="!isView" v-model="row.materialRemark" type="textarea" :rows="5" show-word-limit maxlength="100" placeholder="请输入"></el-input>
@@ -119,6 +134,11 @@ export default {
119
134
  inject: {
120
135
  formProps: {
121
136
  default: () => {}
137
+ },
138
+ getPropControl: {
139
+ default() {
140
+ return () => {}
141
+ }
122
142
  }
123
143
  },
124
144
  props: {
@@ -205,6 +225,15 @@ export default {
205
225
  'min-width': '160'
206
226
  }
207
227
  },
228
+ warehouse: {
229
+ prop: 'warehouse',
230
+ label: '库房',
231
+ type: 'slot',
232
+ slot: 'warehouse',
233
+ attrs: {
234
+ 'min-width': '160'
235
+ }
236
+ },
208
237
  materialBatchInfo: {
209
238
  prop: 'materialBatchInfo',
210
239
  label: '是否指定批次',
@@ -256,6 +285,14 @@ export default {
256
285
  warehouseList: []
257
286
  }
258
287
  },
288
+ computed: {
289
+ /**
290
+ * 内嵌在审批流里的页面形式
291
+ */
292
+ fromApproval() {
293
+ return this.$route.query.from === 'approval'
294
+ }
295
+ },
259
296
  watch: {
260
297
  tableItemArr: {
261
298
  immediate: true,
@@ -552,4 +589,10 @@ export default {
552
589
  padding-left: 16px !important;
553
590
  padding-right: 16px !important;
554
591
  }
592
+ .is-error {
593
+ /deep/ .el-input__inner {
594
+ color: #f4334a;
595
+ border-color: #f4334a;
596
+ }
597
+ }
555
598
  </style>
@@ -86,6 +86,10 @@ export default {
86
86
  this.$bizui.bus.$on('applySubmit', (val) => {
87
87
  this.handleValidate()
88
88
  })
89
+ // 审批时候提交的处理
90
+ this.$bizui.bus.$on('approvalSubmit', (val) => {
91
+ this.handleApprovalValidate()
92
+ })
89
93
  // 监听主体切换的回调
90
94
  this.$bizui.bus.$on('formBelongCompanyChange', (val) => {
91
95
  this.tableData = []
@@ -100,13 +104,24 @@ export default {
100
104
  })
101
105
  }
102
106
  },
107
+ handleApprovalValidate() {
108
+ this.tableData.forEach((item) => {
109
+ if (!item.warehouseNumber && this.tableItemArr.includes('warehouse')) {
110
+ this.$message.warning('请检查库房')
111
+ item.valid = false
112
+ } else if (item.materialIsSpecifiedBatch === '1' && this.attrs.approvalInputBatch && !item.materialBatch) {
113
+ this.$message.warning('请检查批次号')
114
+ item.valid = false
115
+ }
116
+ })
117
+ },
103
118
  handleValidate() {
104
119
  this.tableData.forEach((item) => {
105
120
  if (!item.materialQuantity) {
106
- this.$message.error('请检查物料数量')
121
+ this.$message.warning('请检查物料数量')
107
122
  item.valid = false
108
123
  } else if (this.tableItemArr.includes('batch') && !this.attrs.approvalInputBatch && item.materialIsSpecifiedBatch === '1' && !item.materialBatch) {
109
- this.$message.error('请检查批次号信息')
124
+ this.$message.warning('请检查批次号信息')
110
125
  item.valid = false
111
126
  } else {
112
127
  item.valid = true