style:申请材料目录
Showing
2 changed files
with
89 additions
and
105 deletions
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-09-13 11:10:27 | 4 | * @LastEditTime: 2023-09-13 13:48:47 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="clmlmx-box"> | 7 | <div class="clmlmx-box"> |
... | @@ -58,7 +58,7 @@ | ... | @@ -58,7 +58,7 @@ |
58 | label: "材料名称", | 58 | label: "材料名称", |
59 | render: (h, scope) => { | 59 | render: (h, scope) => { |
60 | return ( | 60 | return ( |
61 | (this.formData.ableOperation && scope.row.isrequired != '1') ? | 61 | (this.formData.ableOperation && scope.row.sfxjcl == '1') ? |
62 | <el-input value={scope.row.sjmc} onInput={(val) => { scope.row.sjmc = val }}></el-input> : <span>{scope.row.sjmc}</span> | 62 | <el-input value={scope.row.sjmc} onInput={(val) => { scope.row.sjmc = val }}></el-input> : <span>{scope.row.sjmc}</span> |
63 | ) | 63 | ) |
64 | } | 64 | } |
... | @@ -143,19 +143,16 @@ | ... | @@ -143,19 +143,16 @@ |
143 | width: "100", | 143 | width: "100", |
144 | render: (h, scope) => { | 144 | render: (h, scope) => { |
145 | return ( | 145 | return ( |
146 | <div> | 146 | <el-button |
147 | <el-button | 147 | type="text" |
148 | type="text" | 148 | icon="el-icon-delete" |
149 | icon="el-icon-delete" | 149 | disabled={!(scope.row.ys == 0 && scope.row.sfxjcl == '1') || !this.formData.ableOperation} |
150 | disabled={!(scope.row.ys == 0 && scope.row.sfxjcl == '1') || !this.formData.ableOperation} | 150 | onClick={() => { |
151 | onClick={() => { | 151 | this.handleDelete(scope.$index, scope.row); |
152 | this.handleDelete(scope.$index, scope.row); | 152 | }} |
153 | }} | 153 | > |
154 | > | 154 | 删除 |
155 | 删除 | 155 | </el-button> |
156 | </el-button> | ||
157 | |||
158 | </div > | ||
159 | ) | 156 | ) |
160 | } | 157 | } |
161 | } | 158 | } | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-09-13 09:18:13 | 4 | * @LastEditTime: 2023-09-13 13:46:03 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="clmlmx-box"> | 7 | <div class="clmlmx-box"> |
8 | <lb-table :column="column" :key="key" :heightNumSetting="true" :calcHeight="500" :pagination="false" :data="tableData"> | 8 | <lb-table :column="column" :key="key" row-key="bsmMaterial" ref="listTable" :heightNumSetting="true" :calcHeight="500" :pagination="false" |
9 | :data="tableData"> | ||
9 | </lb-table> | 10 | </lb-table> |
10 | <div class="text-center"> | 11 | <div class="text-center"> |
11 | <el-button @click="handleCancel">取消</el-button> | 12 | <el-button @click="handleCancel">取消</el-button> |
... | @@ -30,23 +31,27 @@ | ... | @@ -30,23 +31,27 @@ |
30 | data () { | 31 | data () { |
31 | return { | 32 | return { |
32 | loading: false, | 33 | loading: false, |
34 | sortable: null, | ||
33 | column: [ | 35 | column: [ |
34 | { | 36 | { |
35 | width: '50', | 37 | prop: "isrequired", |
36 | renderHeader: (h, scope) => { | 38 | label: "是否必选", |
37 | return <div> { | 39 | width: "80", |
38 | <i class="el-icon-plus pointer" onClick={() => { this.handleAdd() }}></i> | ||
39 | } | ||
40 | </div> | ||
41 | }, | ||
42 | render: (h, scope) => { | 40 | render: (h, scope) => { |
43 | return ( | 41 | if (scope.row.isrequired === "1") { |
44 | <div> | 42 | return ( |
45 | { | 43 | <div> |
46 | <i class="el-icon-minus pointer" onClick={() => { this.handleDelete(scope.$index, scope.row) }}></i> | 44 | <span>必选</span> |
47 | } | 45 | </div> |
48 | </div> | 46 | ); |
49 | ) | 47 | } |
48 | else { | ||
49 | return ( | ||
50 | <div> | ||
51 | <span>可选</span> | ||
52 | </div> | ||
53 | ) | ||
54 | } | ||
50 | } | 55 | } |
51 | }, | 56 | }, |
52 | { | 57 | { |
... | @@ -85,6 +90,15 @@ | ... | @@ -85,6 +90,15 @@ |
85 | } | 90 | } |
86 | }, | 91 | }, |
87 | { | 92 | { |
93 | label: "扫描时间", | ||
94 | width: "140", | ||
95 | render: (h, scope) => { | ||
96 | return ( | ||
97 | <span>{scope.row.sjsj}</span> | ||
98 | ) | ||
99 | } | ||
100 | }, | ||
101 | { | ||
88 | label: "页数", | 102 | label: "页数", |
89 | width: "80", | 103 | width: "80", |
90 | render: (h, scope) => { | 104 | render: (h, scope) => { |
... | @@ -104,30 +118,35 @@ | ... | @@ -104,30 +118,35 @@ |
104 | }, | 118 | }, |
105 | }, | 119 | }, |
106 | { | 120 | { |
121 | label: "是否新建材料", | ||
122 | width: "80", | ||
123 | render: (h, scope) => { | ||
124 | if (scope.row.sfxjcl && scope.row.sfxjcl == '1') { | ||
125 | return ( | ||
126 | <span>是</span> | ||
127 | ); | ||
128 | } else { | ||
129 | return ( | ||
130 | <span>否</span> | ||
131 | ); | ||
132 | } | ||
133 | }, | ||
134 | }, | ||
135 | { | ||
107 | label: "操作", | 136 | label: "操作", |
108 | width: "100", | 137 | width: "100", |
109 | render: (h, scope) => { | 138 | render: (h, scope) => { |
110 | return ( | 139 | return ( |
111 | <div> | 140 | <el-button |
112 | <el-button | 141 | type="text" |
113 | type="text" | 142 | icon="el-icon-delete" |
114 | disabled={scope.$index == 0} | 143 | disabled={!(scope.row.count == 0 && scope.row.sfxjcl == '1') || !this.formData.ableOperation} |
115 | onClick={() => { | 144 | onClick={() => { |
116 | this.moveUpward(scope.$index, scope.row); | 145 | this.handleDelete(scope.$index, scope.row); |
117 | }} | 146 | }} |
118 | > | 147 | > |
119 | 上移 | 148 | 删除 |
120 | </el-button> | 149 | </el-button> |
121 | <el-button | ||
122 | type="text" | ||
123 | disabled={scope.$index + 1 == this.tableData.length} | ||
124 | onClick={() => { | ||
125 | this.moveDown(scope.$index, scope.row); | ||
126 | }} | ||
127 | > | ||
128 | 下移 | ||
129 | </el-button> | ||
130 | </div > | ||
131 | ) | 150 | ) |
132 | } | 151 | } |
133 | } | 152 | } |
... | @@ -136,6 +155,14 @@ | ... | @@ -136,6 +155,14 @@ |
136 | tableData: [] | 155 | tableData: [] |
137 | } | 156 | } |
138 | }, | 157 | }, |
158 | mounted () { | ||
159 | this.initSort() | ||
160 | }, | ||
161 | beforeDestroy () { | ||
162 | if (this.sortable) { | ||
163 | this.sortable.destroy(); | ||
164 | } | ||
165 | }, | ||
139 | watch: { | 166 | watch: { |
140 | 'formData.data': { | 167 | 'formData.data': { |
141 | handler: function (val, oldVal) { | 168 | handler: function (val, oldVal) { |
... | @@ -160,6 +187,7 @@ | ... | @@ -160,6 +187,7 @@ |
160 | }, | 187 | }, |
161 | handleSubmit () { | 188 | handleSubmit () { |
162 | this.loading = true | 189 | this.loading = true |
190 | store.dispatch('user/reWorkFresh', false) | ||
163 | updateClml(this.tableData).then(res => { | 191 | updateClml(this.tableData).then(res => { |
164 | this.loading = false | 192 | this.loading = false |
165 | if (res.code == 200) { | 193 | if (res.code == 200) { |
... | @@ -198,60 +226,6 @@ | ... | @@ -198,60 +226,6 @@ |
198 | }) | 226 | }) |
199 | }, | 227 | }, |
200 | /** | 228 | /** |
201 | * @description: 上移 | ||
202 | * @param {*} index | ||
203 | * @param {*} row | ||
204 | * @author: renchao | ||
205 | */ | ||
206 | moveUpward (index, row) { | ||
207 | let obj = { | ||
208 | xh: row.xh, | ||
209 | bsmSlsq: row.bsmSlsq, | ||
210 | moveDirection: "UP", | ||
211 | }; | ||
212 | // 接口待调 | ||
213 | moveClml(obj).then(async (res) => { | ||
214 | if (res.code == 200) { | ||
215 | let res = await this.clmlInitList() | ||
216 | if (res == 200) { | ||
217 | this.$message({ | ||
218 | message: '上移成功', | ||
219 | type: 'success' | ||
220 | }) | ||
221 | } | ||
222 | } else { | ||
223 | this.$message.error(res.message); | ||
224 | } | ||
225 | }) | ||
226 | }, | ||
227 | /** | ||
228 | * @description: 下移 | ||
229 | * @param {*} index | ||
230 | * @param {*} row | ||
231 | * @author: renchao | ||
232 | */ | ||
233 | moveDown (index, row) { | ||
234 | let obj = { | ||
235 | xh: row.xh, | ||
236 | bsmSlsq: row.bsmSlsq, | ||
237 | moveDirection: "DOWN", | ||
238 | } | ||
239 | // 接口待调 | ||
240 | moveClml(obj).then(async (res) => { | ||
241 | if (res.code == 200) { | ||
242 | let res = await this.clmlInitList() | ||
243 | if (res == 200) { | ||
244 | this.$message({ | ||
245 | message: '下移成功', | ||
246 | type: 'success' | ||
247 | }) | ||
248 | } | ||
249 | } else { | ||
250 | this.$message.error(res.message); | ||
251 | } | ||
252 | }) | ||
253 | }, | ||
254 | /** | ||
255 | * @description: 材料目录删除 | 229 | * @description: 材料目录删除 |
256 | * @param {*} index | 230 | * @param {*} index |
257 | * @param {*} row | 231 | * @param {*} row |
... | @@ -281,6 +255,19 @@ | ... | @@ -281,6 +255,19 @@ |
281 | message: '已取消删除' | 255 | message: '已取消删除' |
282 | }) | 256 | }) |
283 | }) | 257 | }) |
258 | }, | ||
259 | initSort () { | ||
260 | const el = this.$refs.listTable.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0] | ||
261 | this.sortable = Sortable.create(el, { | ||
262 | ghostClass: 'sortable-ghost', | ||
263 | setData: function (dataTransfer) { | ||
264 | dataTransfer.setData('Text', '') | ||
265 | }, | ||
266 | onEnd: evt => { | ||
267 | const targetRow = this.tableData.splice(evt.oldIndex, 1)[0]; | ||
268 | this.tableData.splice(evt.newIndex, 0, targetRow); | ||
269 | } | ||
270 | }) | ||
284 | } | 271 | } |
285 | } | 272 | } |
286 | } | 273 | } | ... | ... |
-
Please register or sign in to post a comment