n20-common-lib 1.3.126 → 1.3.128

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "1.3.126",
3
+ "version": "1.3.128",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -4,7 +4,7 @@
4
4
  <el-form label-position="right" :label-width="_lang === 'zh' ? '5em' : '10em'">
5
5
  <div v-if="taskId && showBtn" class="flex-box">
6
6
  <div v-if="authList.includes('isCarboncopy')" class="flex-1">
7
- <el-form-item :label="'抄送' | $lc" class="m-b">
7
+ <el-form-item :label="'抄送' | $lc">
8
8
  <el-input
9
9
  :value="carbonCopyList.map((c) => c.uname).join(', ')"
10
10
  type="textarea"
@@ -14,7 +14,7 @@
14
14
  </el-form-item>
15
15
  </div>
16
16
  <div v-if="authList.includes('isAddtask')" class="flex-1">
17
- <el-form-item :label="'加签' | $lc" class="m-b">
17
+ <el-form-item :label="'加签' | $lc" :error="addMsg">
18
18
  <label slot="label">
19
19
  <span>{{ '加签' | $lc }}</span>
20
20
  <el-tooltip placement="top">
@@ -26,7 +26,7 @@
26
26
  </el-tooltip>
27
27
  </label>
28
28
  <div class="flex-box">
29
- <el-select v-model="addTaskType" :placeholder="'请选择审批方式' | $lc" style="width: 10em">
29
+ <el-select v-model="addTaskType" clearable :placeholder="'请选择审批方式' | $lc" style="width: 10em">
30
30
  <!-- <el-option :label="'普通节点' | $lc" value="1" /> -->
31
31
  <el-option :label="'会签并行' | $lc" value="2" />
32
32
  <el-option :label="'普通串行' | $lc" value="3" />
@@ -155,6 +155,7 @@ export default {
155
155
  showBtn: true,
156
156
  setCarboncopyV: false,
157
157
  carbonCopyList: [],
158
+ addMsg: undefined,
158
159
  setAddtaskV: false,
159
160
  addTaskList: [],
160
161
  addTaskType: undefined,
@@ -266,6 +267,12 @@ export default {
266
267
  this.goFrom()
267
268
  }
268
269
  },
270
+ addErrFn() {
271
+ this.addMsg = '审批方式不能为空'
272
+ setTimeout(() => {
273
+ this.addMsg = undefined
274
+ }, 1000)
275
+ },
269
276
  errMsgFn(str = '') {
270
277
  this.$refs['msg-input'].focus()
271
278
  this.errMsg = str + '操作,意见不能为空'
@@ -324,6 +331,10 @@ export default {
324
331
  },
325
332
  // 审批
326
333
  approvalFn() {
334
+ if (this.addTaskList.length > 0 && !this.addTaskType) {
335
+ return this.addErrFn()
336
+ }
337
+
327
338
  this.beforeFn(this.$attrs.beforeRatify, () => {
328
339
  axios.post('/bems/activiti/admin/todo/advance', this.getParam()).then(({ data }) => {
329
340
  this.thenMsg(data, $lc('批准'))
@@ -360,6 +371,7 @@ export default {
360
371
  },
361
372
  setAddtaskOk(list) {
362
373
  this.addTaskList = list
374
+ if (this.addTaskList.length > 0 && !this.addTaskType) this.addTaskType = '2'
363
375
 
364
376
  this.setAddtaskV = false
365
377
  }
@@ -35,7 +35,7 @@
35
35
  </div>
36
36
  <div class="flex-item bd-a">
37
37
  <div class="text-c" style="height: 44px; line-height: 44px; background: var(--background-color-base)">
38
- 抄送对象
38
+ {{ type != 'addtask' ? '抄送对象' : '加签对象' }}
39
39
  </div>
40
40
  <div v-for="item in selectArr" :key="item.uno" class="flex-box p-a-s">
41
41
  <span
@@ -393,6 +393,10 @@ export default {
393
393
  type: Function,
394
394
  default: undefined
395
395
  },
396
+ successCode: {
397
+ type: [String, Number],
398
+ default: 200
399
+ },
396
400
  getFileMethod: {
397
401
  type: Function,
398
402
  default: undefined
@@ -545,16 +549,25 @@ export default {
545
549
  this.$set(row, '_percent', percent <= 99 ? Math.round(percent) : 99)
546
550
  },
547
551
  onSuccessFn(response, file, fileList, row) {
548
- console.log(row)
549
552
  this.$set(row, '_name', file.name)
550
- this.$set(row, '_percent', 100)
553
+ if (typeof response.data === 'object') {
554
+ if (response.data.code === 200) {
555
+ this.$set(row, '_percent', 100)
556
+ this.$set(row, '_status', 'success')
557
+ } else {
558
+ this.$set(row, '_percent', 99)
559
+ this.$set(row, '_status', 'exception')
560
+ }
561
+ } else {
562
+ this.$set(row, '_status', 'success')
563
+ this.$set(row, '_percent', 100)
564
+ }
551
565
 
552
566
  row[this.keys.time] = dayjs().format('YYYY-MM-DD HH:mm:ss')
553
567
 
554
568
  row[this.keys.url] = response.data
555
569
  // if (!row[this.keys.name]) { row[this.keys.name] = file.name }
556
570
  row[this.keys.name] = file.name
557
- this.$set(row, '_status', 'success')
558
571
 
559
572
  this.$emit('on-success', file, row)
560
573
  },