@lambo-design/workflow-approve 1.0.0-beta.128 → 1.0.0-beta.129

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": "@lambo-design/workflow-approve",
3
- "version": "1.0.0-beta.128",
3
+ "version": "1.0.0-beta.129",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -1,224 +1,224 @@
1
- <template>
2
- <div>
3
- <Row>
4
- <Row>
5
- <span v-for="(item, index) in attachmentdata" :key="index" style="font-size: 14px">
6
- <span v-if="index>0">、</span>
7
- <span style="color:#2D8cF0 "> {{ item.fileName }}</span>
8
- <a @click="forRemoveAttachment(index)" style="font-size: 13px;">.删除</a>
9
- </span>
10
- <div>
11
- <div slot="buttons">
12
- <Upload :action="actionUrl" :on-error="handleError" :before-upload="handleUpload" :show-upload-list="false"
13
- multiple
14
- :on-success="handleSuccess" :on-progress="handleProgress"
15
- :on-format-error="handleFormatError"
16
- :format="['xlsx', 'xls','txt','rar','zip','doc','docx','jpg','pdf','gif','png']">
17
- <Button :loading="loading" icon="ios-arrow-round-up" type="primary"
18
- style="color: #808080;border-color:#e0e0e0;" ghost>添加附件
19
- </Button>
20
- </Upload>
21
- </div>
22
- </div>
23
- </Row>
24
- <Row style="margin-top: 10px">
25
- <span style="color: red;font-size: 14px">* 支持扩展名: .rar .zip .doc .docx .pdf .jpg...</span>
26
- </Row>
27
- </Row>
28
- </div>
29
- </template>
30
-
31
- <script>
32
-
33
-
34
- export default {
35
- name: "attachment",
36
- components: {},
37
- props: {
38
- actionUrl: {
39
- default: "/api/oss-server/file/put",
40
- },
41
- attachmentdata: {
42
- type: Array,
43
- default: function () {
44
- return []
45
- }
46
- },
47
- attachmentColumn: {
48
- default: function () {
49
- let column = [
50
- {title: "序号", type: 'index', width: 80, align: "center"},
51
- {
52
- title: "相关附件", key: "fileName", minWidth: 200, align: 'left', tooltip: true,
53
- render: (h, {row}) => {
54
- return h("a", {
55
- on: {
56
- 'click': () => {
57
- let reg = /\.(gif|jpg|jpeg|bmp|png)$/
58
- let regs = /\.pdf$/
59
- if (reg.test(row.fileName)) {
60
- let imgs = [];
61
- let url = this.ossServerContext + "/file/get/" + row.fileId;
62
- this.imgPreview(url);
63
- } else if (regs.test(row.fileName)) {
64
- window.open(this.ossServerContext + "/file/getFileStream?fileId=" + row.fileId, "_blank");
65
- } else {
66
- window.open(this.ossServerContext + "/file/get/" + row.fileId, "_blank");
67
- }
68
- }
69
- }
70
- }, row.fileName);
71
- }
72
- },
73
- {
74
- title: "操作", width: 80, align: "center",
75
- render: (h, {index}) => {
76
- return h('div', [
77
- h('Button', {
78
- props: {
79
- type: 'warning',
80
- size: 'small',
81
- ghost: true
82
- },
83
- on: {
84
- click: () => {
85
- this.forRemoveAttachment(index)
86
- }
87
- }
88
- }, '删除')
89
- ]);
90
- }
91
- }
92
- ];
93
- return column
94
- }
95
- },
96
- },
97
- data() {
98
- return {
99
- loading: false,
100
- modalImg: false,
101
- image: "",
102
- tempFileArr: [],
103
- percentage: null,
104
- file_name: '',
105
- fileList: [],
106
- }
107
- },
108
- methods: {
109
- openAttachment(item) {
110
- let reg = /\.(gif|jpg|jpeg|bmp|png)$/;
111
- let regs = /\.pdf$/;
112
-
113
- if (reg.test(item.fileName)) {
114
- let imgs = [];
115
- let url = this.ossServerContext + "/file/get/" + item.fileId;
116
- this.imgPreview(url);
117
- } else if (regs.test(item.fileName)) {
118
- window.open(this.ossServerContext + "/file/getFileStream?fileId=" + item.fileId, "_blank");
119
- } else {
120
- window.open(this.ossServerContext + "/file/get/" + item.fileId, "_blank");
121
- }
122
- },
123
- handleSuccess: function (response, file, fileList) {
124
- let self = this;
125
- let tempArr = JSON.parse(JSON.stringify(this.tempFileArr))
126
-
127
- tempArr.forEach(function (value, index, array) {
128
- if (value == file.name) {
129
- self.tempFileArr.splice(index, 1)
130
- }
131
- });
132
-
133
- if (response.code == 1 && self.tempFileArr && self.tempFileArr.length < 1) {
134
- self.loading = false;
135
- self.$Message.success("上传成功");
136
- }
137
-
138
- if (response.code == 1) {
139
- if (response.data != undefined && response.data != null && response.data.length > 0) {
140
- let tempData = [].concat(response.data);
141
- this.attachmentdata.push({
142
- fileName: tempData[0].originalName,
143
- fileId: tempData[0].fileName,
144
- });
145
- }
146
-
147
- this.fileList = fileList
148
-
149
- } else {
150
- self.loading = false;
151
- this.$Message.error({
152
- content: file.name + '上传失败!',
153
- });
154
- //this.$Message.error("上传失败!");
155
-
156
- let j = 0;
157
- for (let i = 0; i < fileList.length; i++) {
158
- if (fileList[i].canceled) {
159
- continue;
160
- }
161
- if (fileList[i].name === file.name && fileList[i].timestamp === file.timestamp) {
162
- j = i;
163
- }
164
- }
165
-
166
- //console.log(fileList)
167
- fileList.splice(j, 1);
168
-
169
- }
170
-
171
- },
172
- handleError: function (error, file, fileList) {
173
- this.loading = false
174
- this.$Message.error({
175
- content: fileList.name + ' 上传失败!',
176
- });
177
- },
178
- handleUpload: function (file) {
179
- if (!file.canceled) {
180
- this.tempFileArr.push(file.name)
181
- }
182
- },
183
- forRemoveAttachment: function (index) {
184
- this.attachmentdata.splice(index, 1);
185
- this.$refs.attachmentTable.tableRefresh()
186
- },
187
- //查看附件
188
- imgPreview: function (img) {
189
- this.modalImg = true
190
- this.image = img;
191
- },
192
- //查看附件
193
- cancelUpload: function (item, fileList) {
194
- item.showProgress = false;
195
- item.canceled = true;
196
- },
197
- handleProgress(event, file, fileList) {
198
- this.loading = true
199
-
200
-
201
- },
202
- handleFormatError(file) {
203
- this.loading = false
204
- this.$Notice.warning({
205
- title: "文件格式不正确",
206
- desc: "文件 " + file.name + " 格式不支持,请上传其他格式的文件。",
207
- });
208
- },
209
-
210
- }
211
- }
212
- </script>
213
-
214
- <style scoped>
215
- .demo-spin-icon-load {
216
- animation: ani-demo-spin 1s linear infinite;
217
- }
218
-
219
- /deep/ .ivu-icon {
220
- zoom: 130%;
221
- color: #808080;
222
- margin-right: -1px;
223
- }
224
- </style>
1
+ <template>
2
+ <div>
3
+ <Row>
4
+ <Row>
5
+ <span v-for="(item, index) in attachmentdata" :key="index" style="font-size: 14px">
6
+ <span v-if="index>0">、</span>
7
+ <span style="color:#2D8cF0 "> {{ item.fileName }}</span>
8
+ <a @click="forRemoveAttachment(index)" style="font-size: 13px;">.删除</a>
9
+ </span>
10
+ <div>
11
+ <div slot="buttons">
12
+ <Upload :action="actionUrl" :on-error="handleError" :before-upload="handleUpload" :show-upload-list="false"
13
+ multiple
14
+ :on-success="handleSuccess" :on-progress="handleProgress"
15
+ :on-format-error="handleFormatError"
16
+ :format="['xlsx', 'xls','txt','rar','zip','doc','docx','jpg','pdf','gif','png']">
17
+ <Button :loading="loading" icon="ios-arrow-round-up" type="primary"
18
+ style="color: #808080;border-color:#e0e0e0;" ghost>添加附件
19
+ </Button>
20
+ </Upload>
21
+ </div>
22
+ </div>
23
+ </Row>
24
+ <Row style="margin-top: 10px">
25
+ <span style="color: red;font-size: 14px">* 支持扩展名: .rar .zip .doc .docx .pdf .jpg...</span>
26
+ </Row>
27
+ </Row>
28
+ </div>
29
+ </template>
30
+
31
+ <script>
32
+
33
+
34
+ export default {
35
+ name: "attachment",
36
+ components: {},
37
+ props: {
38
+ actionUrl: {
39
+ default: "/api/oss-server/file/put",
40
+ },
41
+ attachmentdata: {
42
+ type: Array,
43
+ default: function () {
44
+ return []
45
+ }
46
+ },
47
+ attachmentColumn: {
48
+ default: function () {
49
+ let column = [
50
+ {title: "序号", type: 'index', width: 80, align: "center"},
51
+ {
52
+ title: "相关附件", key: "fileName", minWidth: 200, align: 'left', tooltip: true,
53
+ render: (h, {row}) => {
54
+ return h("a", {
55
+ on: {
56
+ 'click': () => {
57
+ let reg = /\.(gif|jpg|jpeg|bmp|png)$/
58
+ let regs = /\.pdf$/
59
+ if (reg.test(row.fileName)) {
60
+ let imgs = [];
61
+ let url = this.ossServerContext + "/file/get/" + row.fileId;
62
+ this.imgPreview(url);
63
+ } else if (regs.test(row.fileName)) {
64
+ window.open(this.ossServerContext + "/file/getFileStream?fileId=" + row.fileId, "_blank");
65
+ } else {
66
+ window.open(this.ossServerContext + "/file/get/" + row.fileId, "_blank");
67
+ }
68
+ }
69
+ }
70
+ }, row.fileName);
71
+ }
72
+ },
73
+ {
74
+ title: "操作", width: 80, align: "center",
75
+ render: (h, {index}) => {
76
+ return h('div', [
77
+ h('Button', {
78
+ props: {
79
+ type: 'warning',
80
+ size: 'small',
81
+ ghost: true
82
+ },
83
+ on: {
84
+ click: () => {
85
+ this.forRemoveAttachment(index)
86
+ }
87
+ }
88
+ }, '删除')
89
+ ]);
90
+ }
91
+ }
92
+ ];
93
+ return column
94
+ }
95
+ },
96
+ },
97
+ data() {
98
+ return {
99
+ loading: false,
100
+ modalImg: false,
101
+ image: "",
102
+ tempFileArr: [],
103
+ percentage: null,
104
+ file_name: '',
105
+ fileList: [],
106
+ }
107
+ },
108
+ methods: {
109
+ openAttachment(item) {
110
+ let reg = /\.(gif|jpg|jpeg|bmp|png)$/;
111
+ let regs = /\.pdf$/;
112
+
113
+ if (reg.test(item.fileName)) {
114
+ let imgs = [];
115
+ let url = this.ossServerContext + "/file/get/" + item.fileId;
116
+ this.imgPreview(url);
117
+ } else if (regs.test(item.fileName)) {
118
+ window.open(this.ossServerContext + "/file/getFileStream?fileId=" + item.fileId, "_blank");
119
+ } else {
120
+ window.open(this.ossServerContext + "/file/get/" + item.fileId, "_blank");
121
+ }
122
+ },
123
+ handleSuccess: function (response, file, fileList) {
124
+ let self = this;
125
+ let tempArr = JSON.parse(JSON.stringify(this.tempFileArr))
126
+
127
+ tempArr.forEach(function (value, index, array) {
128
+ if (value == file.name) {
129
+ self.tempFileArr.splice(index, 1)
130
+ }
131
+ });
132
+
133
+ if (response.code == 1 && self.tempFileArr && self.tempFileArr.length < 1) {
134
+ self.loading = false;
135
+ self.$Message.success("上传成功");
136
+ }
137
+
138
+ if (response.code == 1) {
139
+ if (response.data != undefined && response.data != null && response.data.length > 0) {
140
+ let tempData = [].concat(response.data);
141
+ this.attachmentdata.push({
142
+ fileName: tempData[0].originalName,
143
+ fileId: tempData[0].fileName,
144
+ });
145
+ }
146
+
147
+ this.fileList = fileList
148
+
149
+ } else {
150
+ self.loading = false;
151
+ this.$Message.error({
152
+ content: file.name + '上传失败!',
153
+ });
154
+ //this.$Message.error("上传失败!");
155
+
156
+ let j = 0;
157
+ for (let i = 0; i < fileList.length; i++) {
158
+ if (fileList[i].canceled) {
159
+ continue;
160
+ }
161
+ if (fileList[i].name === file.name && fileList[i].timestamp === file.timestamp) {
162
+ j = i;
163
+ }
164
+ }
165
+
166
+ //console.log(fileList)
167
+ fileList.splice(j, 1);
168
+
169
+ }
170
+
171
+ },
172
+ handleError: function (error, file, fileList) {
173
+ this.loading = false
174
+ this.$Message.error({
175
+ content: fileList.name + ' 上传失败!',
176
+ });
177
+ },
178
+ handleUpload: function (file) {
179
+ if (!file.canceled) {
180
+ this.tempFileArr.push(file.name)
181
+ }
182
+ },
183
+ forRemoveAttachment: function (index) {
184
+ this.attachmentdata.splice(index, 1);
185
+ this.$refs.attachmentTable.tableRefresh()
186
+ },
187
+ //查看附件
188
+ imgPreview: function (img) {
189
+ this.modalImg = true
190
+ this.image = img;
191
+ },
192
+ //查看附件
193
+ cancelUpload: function (item, fileList) {
194
+ item.showProgress = false;
195
+ item.canceled = true;
196
+ },
197
+ handleProgress(event, file, fileList) {
198
+ this.loading = true
199
+
200
+
201
+ },
202
+ handleFormatError(file) {
203
+ this.loading = false
204
+ this.$Notice.warning({
205
+ title: "文件格式不正确",
206
+ desc: "文件 " + file.name + " 格式不支持,请上传其他格式的文件。",
207
+ });
208
+ },
209
+
210
+ }
211
+ }
212
+ </script>
213
+
214
+ <style scoped>
215
+ .demo-spin-icon-load {
216
+ animation: ani-demo-spin 1s linear infinite;
217
+ }
218
+
219
+ /deep/ .ivu-icon {
220
+ zoom: 130%;
221
+ color: #808080;
222
+ margin-right: -1px;
223
+ }
224
+ </style>
@@ -1,263 +1,263 @@
1
- <template>
2
- <div>
3
- <Select v-model="auditOpinionText" style="width:190px" clearable transfer>
4
- <Option v-for="item in auditOpinionForSelect" :value="item.value" :key="item.value">
5
- <span>{{ item.label }}</span>
6
- <span style="float:right;color:#ccc">{{ item.type }}</span>
7
- </Option>
8
- </Select>
9
- <Button style="margin-left: 10px" @click="customCommentListModal = true">自定义我的意见</Button>
10
- <Input v-model="auditOpinion" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }" show-word-limit
11
- :maxlength="200" placeholder="处理意见" style="margin-top: 15px"
12
- ></Input>
13
-
14
- <Modal v-model="customCommentListModal" title="常用意见" width="800px" footer-hide>
15
- <LamboPagingTable :requestSuccessCodes="requestSuccessCodes" ref="customCommentTable" :dataUrl="dataUrl"
16
- :columns="tableColumn">
17
- <div slot="buttons">
18
- <Button type="primary" ghost icon="md-add" @click="openDetailModal('create')">新增</Button>
19
- </div>
20
- </LamboPagingTable>
21
- </Modal>
22
- <Modal v-model="customCommentDetailModal" :title="customCommentDetailTitle" width="700px"
23
- @on-cancel="customCommentDetailCancel"
24
- @on-ok="customCommentDetailOk">
25
- <Card v-model="customCommentDetailModal" width="600px" dis-hover>
26
- <Form ref="customCommentForm" :model="customCommentDetailForm" :rules="customCommentRuleValidate"
27
- :label-width="100" label-position="right">
28
- <FormItem label="常用意见:" prop="commentContent">
29
- <Input type="textarea" v-model="customCommentDetailForm.commentContent" show-word-limit :maxlength="1000"
30
- style="width: 500px"/>
31
- </FormItem>
32
- <FormItem label="排序码:">
33
- <Input style="width: 100px" v-model="customCommentDetailForm.orders"/>
34
- </FormItem>
35
- </Form>
36
- </Card>
37
- </Modal>
38
- </div>
39
- </template>
40
-
41
- <script>
42
- import ajax from "@lambo-design/shared/utils/ajax";
43
- import LamboPagingTable from "@lambo-design/paging-table/index";
44
- import { operateHref } from '@lambo-design/shared/utils/assist'
45
-
46
- // 引入docx-preview插件
47
- let docx = require('docx-preview');
48
- export default {
49
- components: {
50
- LamboPagingTable
51
- },
52
- props: {
53
- smartFlowServerContext: {
54
- type: String,
55
- default: '/api/smart-flow-server',
56
- },
57
- },
58
- data() {
59
- return {
60
- requestSuccessCodes: [200, "200"],
61
- auditOpinionText: '',
62
- auditOpinionForSelect: [{
63
- label: '',
64
- value: ''
65
- }],
66
- customCommentListModal: false,
67
- auditOpinion: '',
68
- customCommentDetailModal: false,
69
- customCommentDetailTitle: '',
70
- dataUrl: this.smartFlowServerContext + '/manage/smartflowCustomComment/list?commentType=10',
71
- customCommentDetailForm: {
72
- id: '',
73
- commentContent: '',
74
- orders: 10
75
- },
76
- customCommentRuleValidate: {
77
- commentContent: [
78
- {required: true, trigger: "blur", message: "意见不能为空"},
79
- {max: 1000, message: "意见不能大于1000位", trigger: "blur"}
80
- ]
81
- },
82
- }
83
- },
84
- computed: {
85
- tableColumn() {
86
- let column = [];
87
- let self = this;
88
- column.push({
89
- title: '常用意见',
90
- key: "commentContent",
91
- minWidth: 150,
92
- align: 'center',
93
- });
94
- column.push({
95
- title: "排序码",
96
- key: "orders",
97
- width: 170,
98
- align: "center",
99
- });
100
-
101
- column.push({
102
- title: "修改时间",
103
- key: "updateTime",
104
- width: 170,
105
- align: "center",
106
- render: (v, param) => {
107
- if (param.row.updateTime) {
108
- let date = new Date(param.row.updateTime)
109
- let y = date.getFullYear() // 年
110
- let MM = date.getMonth() + 1 // 月
111
- MM = MM < 10 ? ('0' + MM) : MM
112
- let d = date.getDate() // 日
113
- d = d < 10 ? ('0' + d) : d
114
- let h = date.getHours() // 时
115
- h = h < 10 ? ('0' + h) : h
116
- let m = date.getMinutes()// 分
117
- m = m < 10 ? ('0' + m) : m
118
- let s = date.getSeconds()// 秒
119
- s = s < 10 ? ('0' + s) : s
120
- let state = y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
121
- return v("span", state);
122
- }
123
- return v("span", '')
124
- }
125
- });
126
-
127
- column.push({
128
- title: "操作", width: 160, align: 'center', tooltip: true,
129
- render: (h, {row}) => {
130
- return h("div", [
131
- operateHref(this, h, row, "修改", () => {
132
- this.openDetailModal('update', row);
133
- }, "primary"),
134
- operateHref(this, h, row, "删除", () => {
135
- this.deleteCustomComment(row);
136
- }, "error")
137
- ]);
138
-
139
- }
140
-
141
- });
142
-
143
- return column;
144
- },
145
- },
146
- methods: {
147
- openDetailModal(type, row) {
148
- this.customCommentDetailModal = true
149
- if (type === 'create') {
150
- this.customCommentDetailTitle = '新增常用意见'
151
- } else {
152
- this.customCommentDetailTitle = '修改常用意见'
153
- this.customCommentDetailForm.id = row.id
154
- this.customCommentDetailForm.commentContent = row.commentContent
155
- this.customCommentDetailForm.orders = row.orders
156
- }
157
- },
158
- customCommentDetailCancel() {
159
- this.getAuditOpinionForSelect()
160
- this.customCommentDetailForm = {
161
- id: '',
162
- commentContent: '',
163
- orders: 10
164
- }
165
- this.customCommentDetailModal = false
166
- },
167
- customCommentDetailOk() {
168
- const self = this
169
- self.$refs.customCommentForm.validate((valid) => {
170
- if (valid) {
171
- if (self.customCommentDetailForm.id) {
172
- ajax.post(this.smartFlowServerContext + "/manage/smartflowCustomComment/update", self.customCommentDetailForm).then((resp) => {
173
- if (resp.data.code === "200") {
174
- self.customCommentDetailForm = {
175
- id: '',
176
- commentContent: '',
177
- orders: 10
178
- }
179
- self.refreshTable()
180
- }
181
- }).catch(err => {
182
- console.log(err);
183
- })
184
- } else {
185
- ajax.post(this.smartFlowServerContext + "/manage/smartflowCustomComment/insert", self.customCommentDetailForm).then((resp) => {
186
- if (resp.data.code === "200") {
187
- self.customCommentDetailForm = {
188
- id: '',
189
- commentContent: '',
190
- orders: 10
191
- }
192
- self.refreshTable()
193
- }
194
- }).catch(err => {
195
- console.log(err);
196
- })
197
- }
198
- this.getAuditOpinionForSelect()
199
- this.customCommentDetailModal = false
200
- }
201
- })
202
- },
203
- getAuditOpinionForSelect() {
204
- const self = this
205
- let auditOpinionForSelect = []
206
- ajax.get(this.smartFlowServerContext + "/manage/smartflowCustomComment/list", {params: {limit: 100}}).then((resp) => {
207
- if (resp.data.code == "200" && resp.data.data) {
208
- resp.data.data.rows.forEach(item =>
209
- auditOpinionForSelect.push({
210
- value: item.commentContent,
211
- label: item.commentContent,
212
- type: item.commentType === '10' ? '自定义' : '系统预置'
213
- })
214
- )
215
- self.auditOpinionForSelect = auditOpinionForSelect
216
- }
217
- }).catch(err => {
218
- console.log(err);
219
- })
220
- },
221
- deleteCustomComment(row) {
222
- const self = this
223
- this.$Modal.confirm({
224
- title: '提示',
225
- content: `<p>确定要删除${row.commentContent}吗?</p>`,
226
- onOk: () => {
227
- ajax.post(this.smartFlowServerContext + "/manage/smartflowCustomComment/delete/" + row.id).then(function (resp) {
228
- if (resp.data.code === "200") {
229
- self.refreshTable()
230
- } else {
231
- self.$Message.error(resp.data.data);
232
- }
233
- }).catch(function (err) {
234
- self.$Message.error('删除失败,请联系应用管理员');
235
- });
236
- }
237
- });
238
- },
239
- refreshTable() {
240
- this.$refs.customCommentTable.tableRefresh()
241
- },
242
- updateValue() {
243
- this.$emit('input', this.auditOpinion);
244
- }
245
- },
246
- mounted() {
247
- this.getAuditOpinionForSelect()
248
- },
249
- watch: {
250
- auditOpinionText(label) {
251
- this.auditOpinion = label;
252
- },
253
- auditOpinion(val) {
254
- this.$emit('input', val)
255
- }
256
- }
257
-
258
- }
259
- </script>
260
-
261
- <style scoped>
262
-
263
- </style>
1
+ <template>
2
+ <div>
3
+ <Select v-model="auditOpinionText" style="width:190px" clearable transfer>
4
+ <Option v-for="item in auditOpinionForSelect" :value="item.value" :key="item.value">
5
+ <span>{{ item.label }}</span>
6
+ <span style="float:right;color:#ccc">{{ item.type }}</span>
7
+ </Option>
8
+ </Select>
9
+ <Button style="margin-left: 10px" @click="customCommentListModal = true">自定义我的意见</Button>
10
+ <Input v-model="auditOpinion" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }" show-word-limit
11
+ :maxlength="200" placeholder="处理意见" style="margin-top: 15px"
12
+ ></Input>
13
+
14
+ <Modal v-model="customCommentListModal" title="常用意见" width="800px" footer-hide>
15
+ <LamboPagingTable :requestSuccessCodes="requestSuccessCodes" ref="customCommentTable" :dataUrl="dataUrl"
16
+ :columns="tableColumn">
17
+ <div slot="buttons">
18
+ <Button type="primary" ghost icon="md-add" @click="openDetailModal('create')">新增</Button>
19
+ </div>
20
+ </LamboPagingTable>
21
+ </Modal>
22
+ <Modal v-model="customCommentDetailModal" :title="customCommentDetailTitle" width="700px"
23
+ @on-cancel="customCommentDetailCancel"
24
+ @on-ok="customCommentDetailOk">
25
+ <Card v-model="customCommentDetailModal" width="600px" dis-hover>
26
+ <Form ref="customCommentForm" :model="customCommentDetailForm" :rules="customCommentRuleValidate"
27
+ :label-width="100" label-position="right">
28
+ <FormItem label="常用意见:" prop="commentContent">
29
+ <Input type="textarea" v-model="customCommentDetailForm.commentContent" show-word-limit :maxlength="1000"
30
+ style="width: 500px"/>
31
+ </FormItem>
32
+ <FormItem label="排序码:">
33
+ <Input style="width: 100px" v-model="customCommentDetailForm.orders"/>
34
+ </FormItem>
35
+ </Form>
36
+ </Card>
37
+ </Modal>
38
+ </div>
39
+ </template>
40
+
41
+ <script>
42
+ import ajax from "@lambo-design/shared/utils/ajax";
43
+ import LamboPagingTable from "@lambo-design/paging-table/index";
44
+ import { operateHref } from '@lambo-design/shared/utils/assist'
45
+
46
+ // 引入docx-preview插件
47
+ let docx = require('docx-preview');
48
+ export default {
49
+ components: {
50
+ LamboPagingTable
51
+ },
52
+ props: {
53
+ smartFlowServerContext: {
54
+ type: String,
55
+ default: '/api/smart-flow-server',
56
+ },
57
+ },
58
+ data() {
59
+ return {
60
+ requestSuccessCodes: [200, "200"],
61
+ auditOpinionText: '',
62
+ auditOpinionForSelect: [{
63
+ label: '',
64
+ value: ''
65
+ }],
66
+ customCommentListModal: false,
67
+ auditOpinion: '',
68
+ customCommentDetailModal: false,
69
+ customCommentDetailTitle: '',
70
+ dataUrl: this.smartFlowServerContext + '/manage/smartflowCustomComment/list?commentType=10',
71
+ customCommentDetailForm: {
72
+ id: '',
73
+ commentContent: '',
74
+ orders: 10
75
+ },
76
+ customCommentRuleValidate: {
77
+ commentContent: [
78
+ {required: true, trigger: "blur", message: "意见不能为空"},
79
+ {max: 1000, message: "意见不能大于1000位", trigger: "blur"}
80
+ ]
81
+ },
82
+ }
83
+ },
84
+ computed: {
85
+ tableColumn() {
86
+ let column = [];
87
+ let self = this;
88
+ column.push({
89
+ title: '常用意见',
90
+ key: "commentContent",
91
+ minWidth: 150,
92
+ align: 'center',
93
+ });
94
+ column.push({
95
+ title: "排序码",
96
+ key: "orders",
97
+ width: 170,
98
+ align: "center",
99
+ });
100
+
101
+ column.push({
102
+ title: "修改时间",
103
+ key: "updateTime",
104
+ width: 170,
105
+ align: "center",
106
+ render: (v, param) => {
107
+ if (param.row.updateTime) {
108
+ let date = new Date(param.row.updateTime)
109
+ let y = date.getFullYear() // 年
110
+ let MM = date.getMonth() + 1 // 月
111
+ MM = MM < 10 ? ('0' + MM) : MM
112
+ let d = date.getDate() // 日
113
+ d = d < 10 ? ('0' + d) : d
114
+ let h = date.getHours() // 时
115
+ h = h < 10 ? ('0' + h) : h
116
+ let m = date.getMinutes()// 分
117
+ m = m < 10 ? ('0' + m) : m
118
+ let s = date.getSeconds()// 秒
119
+ s = s < 10 ? ('0' + s) : s
120
+ let state = y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
121
+ return v("span", state);
122
+ }
123
+ return v("span", '')
124
+ }
125
+ });
126
+
127
+ column.push({
128
+ title: "操作", width: 160, align: 'center', tooltip: true,
129
+ render: (h, {row}) => {
130
+ return h("div", [
131
+ operateHref(this, h, row, "修改", () => {
132
+ this.openDetailModal('update', row);
133
+ }, "primary"),
134
+ operateHref(this, h, row, "删除", () => {
135
+ this.deleteCustomComment(row);
136
+ }, "error")
137
+ ]);
138
+
139
+ }
140
+
141
+ });
142
+
143
+ return column;
144
+ },
145
+ },
146
+ methods: {
147
+ openDetailModal(type, row) {
148
+ this.customCommentDetailModal = true
149
+ if (type === 'create') {
150
+ this.customCommentDetailTitle = '新增常用意见'
151
+ } else {
152
+ this.customCommentDetailTitle = '修改常用意见'
153
+ this.customCommentDetailForm.id = row.id
154
+ this.customCommentDetailForm.commentContent = row.commentContent
155
+ this.customCommentDetailForm.orders = row.orders
156
+ }
157
+ },
158
+ customCommentDetailCancel() {
159
+ this.getAuditOpinionForSelect()
160
+ this.customCommentDetailForm = {
161
+ id: '',
162
+ commentContent: '',
163
+ orders: 10
164
+ }
165
+ this.customCommentDetailModal = false
166
+ },
167
+ customCommentDetailOk() {
168
+ const self = this
169
+ self.$refs.customCommentForm.validate((valid) => {
170
+ if (valid) {
171
+ if (self.customCommentDetailForm.id) {
172
+ ajax.post(this.smartFlowServerContext + "/manage/smartflowCustomComment/update", self.customCommentDetailForm).then((resp) => {
173
+ if (resp.data.code === "200") {
174
+ self.customCommentDetailForm = {
175
+ id: '',
176
+ commentContent: '',
177
+ orders: 10
178
+ }
179
+ self.refreshTable()
180
+ }
181
+ }).catch(err => {
182
+ console.log(err);
183
+ })
184
+ } else {
185
+ ajax.post(this.smartFlowServerContext + "/manage/smartflowCustomComment/insert", self.customCommentDetailForm).then((resp) => {
186
+ if (resp.data.code === "200") {
187
+ self.customCommentDetailForm = {
188
+ id: '',
189
+ commentContent: '',
190
+ orders: 10
191
+ }
192
+ self.refreshTable()
193
+ }
194
+ }).catch(err => {
195
+ console.log(err);
196
+ })
197
+ }
198
+ this.getAuditOpinionForSelect()
199
+ this.customCommentDetailModal = false
200
+ }
201
+ })
202
+ },
203
+ getAuditOpinionForSelect() {
204
+ const self = this
205
+ let auditOpinionForSelect = []
206
+ ajax.get(this.smartFlowServerContext + "/manage/smartflowCustomComment/list", {params: {limit: 100}}).then((resp) => {
207
+ if (resp.data.code == "200" && resp.data.data) {
208
+ resp.data.data.rows.forEach(item =>
209
+ auditOpinionForSelect.push({
210
+ value: item.commentContent,
211
+ label: item.commentContent,
212
+ type: item.commentType === '10' ? '自定义' : '系统预置'
213
+ })
214
+ )
215
+ self.auditOpinionForSelect = auditOpinionForSelect
216
+ }
217
+ }).catch(err => {
218
+ console.log(err);
219
+ })
220
+ },
221
+ deleteCustomComment(row) {
222
+ const self = this
223
+ this.$Modal.confirm({
224
+ title: '提示',
225
+ content: `<p>确定要删除${row.commentContent}吗?</p>`,
226
+ onOk: () => {
227
+ ajax.post(this.smartFlowServerContext + "/manage/smartflowCustomComment/delete/" + row.id).then(function (resp) {
228
+ if (resp.data.code === "200") {
229
+ self.refreshTable()
230
+ } else {
231
+ self.$Message.error(resp.data.data);
232
+ }
233
+ }).catch(function (err) {
234
+ self.$Message.error('删除失败,请联系应用管理员');
235
+ });
236
+ }
237
+ });
238
+ },
239
+ refreshTable() {
240
+ this.$refs.customCommentTable.tableRefresh()
241
+ },
242
+ updateValue() {
243
+ this.$emit('input', this.auditOpinion);
244
+ }
245
+ },
246
+ mounted() {
247
+ this.getAuditOpinionForSelect()
248
+ },
249
+ watch: {
250
+ auditOpinionText(label) {
251
+ this.auditOpinion = label;
252
+ },
253
+ auditOpinion(val) {
254
+ this.$emit('input', val)
255
+ }
256
+ }
257
+
258
+ }
259
+ </script>
260
+
261
+ <style scoped>
262
+
263
+ </style>
@@ -1,24 +1,24 @@
1
- <template>
2
- <div class="model-header">
3
- <slot></slot>
4
- </div>
5
- </template>
6
-
7
- <script>
8
- export default {
9
- name: "model-title"
10
- }
11
- </script>
12
-
13
- <style scoped lang="less">
14
- .model-header{
15
- background: #F2F2F2;
16
- line-height: 24px;
17
- padding: 10px 15px;
18
- font-size: 14px;
19
- font-weight: bolder;
20
- overflow: hidden;
21
- margin: 5px 0;
22
- color: #989898;
23
- }
24
- </style>
1
+ <template>
2
+ <div class="model-header">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: "model-title"
10
+ }
11
+ </script>
12
+
13
+ <style scoped lang="less">
14
+ .model-header{
15
+ background: #F2F2F2;
16
+ line-height: 24px;
17
+ padding: 10px 15px;
18
+ font-size: 14px;
19
+ font-weight: bolder;
20
+ overflow: hidden;
21
+ margin: 5px 0;
22
+ color: #989898;
23
+ }
24
+ </style>
package/src/portrait.vue CHANGED
@@ -73,7 +73,7 @@
73
73
  <div ref="processTraceTab" v-if="inHorizontal && currentTab === 'processTrace'">
74
74
  <Workflow_Diagram ref="processTrace" :instanceId="process.instanceId" :applyId="process.applyId" :key="currentTab"
75
75
  :procId="process.procId" :table-columns="diagramTableColumns" :scroll-element="scrollElement"
76
- :tableData="process.tableData" :hisAudit="hisAudit"
76
+ :tableData="process.tableData" :hisAudit="hisAudit" :handle-name="handleName"
77
77
  :currentTaskId="curTaskId"
78
78
  :approve-detail-show-way="approveDetailShowWay"
79
79
  :smart-flow-server-context="smartFlowServerContext"
@@ -90,7 +90,7 @@
90
90
  <div ref="processTraceTab" v-if="currentTab === 'processTrace'">
91
91
  <Workflow_Diagram ref="processTrace" :instanceId="process.instanceId" :applyId="process.applyId" :key="currentTab"
92
92
  :procId="process.procId" :table-columns="diagramTableColumns" :scroll-element="scrollElement"
93
- :tableData="process.tableData" :hisAudit="hisAudit"
93
+ :tableData="process.tableData" :hisAudit="hisAudit" :handle-name="handleName"
94
94
  :currentTaskId="curTaskId"
95
95
  :approve-detail-show-way="approveDetailShowWay"
96
96
  :smart-flow-server-context="smartFlowServerContext"
@@ -1814,6 +1814,7 @@ export default {
1814
1814
  onCancel: () => {
1815
1815
  self.loading = false
1816
1816
  self.disable = false
1817
+ self.$Spin.hide();
1817
1818
  }
1818
1819
  })
1819
1820
 
@@ -1823,6 +1824,7 @@ export default {
1823
1824
  if (self.auditResult === '82' && (self.targetTaskNode == '' || self.targetTaskNode == null)) {
1824
1825
  self.auditResult = ''
1825
1826
  self.$Message.error(`请选择${self.handleName}节点!`)
1827
+ self.loading = false
1826
1828
  } else {
1827
1829
  self.loading = true
1828
1830
  self.disable = true
@@ -1893,6 +1895,7 @@ export default {
1893
1895
  bus.$emit('triggerTimer')
1894
1896
  })
1895
1897
  }
1898
+ self.$Spin.hide();
1896
1899
  },
1897
1900
  execute(successMessage, auditResult) {
1898
1901
  const self = this
@@ -1921,6 +1924,7 @@ export default {
1921
1924
  })
1922
1925
  },
1923
1926
  doJump() {
1927
+ this.$Spin.show();
1924
1928
  if (this.auditResult === '90') {
1925
1929
  this.auditParams.rejectAttribute = this.rejectAttribute ? this.rejectAttribute : 'inSequence'
1926
1930
  }
@@ -2401,7 +2405,7 @@ export default {
2401
2405
  }
2402
2406
  if (self.auditParams.auditResult == '90') {
2403
2407
  self.showProcessControl = self.rejectAttributeList.length > 0 && self.handleButtons && self.handleButtons.includes('rejectProcessControl')
2404
- } else {
2408
+ } else if (self.auditParams.auditResult == '70' || self.auditParams.auditResult == '40') {
2405
2409
  self.rejectAttributesBoxShow = self.handleButtons && self.handleButtons.includes('rejectProcessControl')
2406
2410
  }
2407
2411
  }
@@ -87,9 +87,9 @@
87
87
  <Tag color="green" v-else-if="item.auditResult == '12'">与发起人相同自动跳过</Tag>
88
88
  <Tag color="green" v-else-if="item.auditResult == '13'">办理人为空自动跳过</Tag>
89
89
  <Tag color="green" v-else-if="item.auditResult == '14'">符合流程变量条件自动跳过</Tag>
90
- <Tag color="green" v-else-if="item.auditResult == '30'">{{item.handleName ? item.handleName : '通过'}}</Tag>
91
- <Tag color="green" v-else-if="item.auditResult == '31'">{{`${item.handleName ? item.handleName : '通过'}`}}</Tag>
92
- <Tag color="volcano" v-else-if="item.auditResult == '32'">{{`不${item.handleName ? item.handleName : '通过'}`}}</Tag>
90
+ <Tag color="green" v-else-if="item.auditResult == '30'">{{item.handleName && item.handleName !== '审批' ? item.handleName : '通过'}}</Tag>
91
+ <Tag color="green" v-else-if="item.auditResult == '31'">{{`${item.handleName && item.handleName !== '审批' ? item.handleName : '通过'}`}}</Tag>
92
+ <Tag color="volcano" v-else-if="item.auditResult == '32'">{{`不${item.handleName && item.handleName !== '审批' ? item.handleName : '通过'}`}}</Tag>
93
93
  <Tag color="volcano" v-else-if="item.auditResult == '40'">{{item.rejectName ? item.rejectName : '驳回'}}上一节点</Tag>
94
94
  <Tag color="red" v-else-if="item.auditResult=='50'">{{item.rejectName ? item.rejectName : '驳回'}}到原点</Tag>
95
95
  <Tag color="purple" v-else-if="item.auditResult=='51'">流程终止</Tag>