--no commit message
Showing
4 changed files
with
267 additions
and
264 deletions
... | @@ -20,7 +20,8 @@ | ... | @@ -20,7 +20,8 @@ |
20 | 此环节为流程最后环节,转出后流程将结束 | 20 | 此环节为流程最后环节,转出后流程将结束 |
21 | </el-form-item> | 21 | </el-form-item> |
22 | </el-form> | 22 | </el-form> |
23 | <div class="invalid-reson">审批意见:</div> | 23 | <div v-if="this.formData.showidea"> |
24 | <div class="invalid-reson">审批意见:</div> | ||
24 | <el-input | 25 | <el-input |
25 | class="opinion" | 26 | class="opinion" |
26 | v-model="shyj" | 27 | v-model="shyj" |
... | @@ -28,6 +29,8 @@ | ... | @@ -28,6 +29,8 @@ |
28 | type="textarea" | 29 | type="textarea" |
29 | :rows="4" | 30 | :rows="4" |
30 | ></el-input> | 31 | ></el-input> |
32 | </div> | ||
33 | |||
31 | <!-- <el-button class="opinion_btn" @click="commonOpinion">常用意见</el-button> --> | 34 | <!-- <el-button class="opinion_btn" @click="commonOpinion">常用意见</el-button> --> |
32 | <el-button style="float: right" @click="cancelBack">取消转出</el-button> | 35 | <el-button style="float: right" @click="cancelBack">取消转出</el-button> |
33 | <el-button type="primary" @click="submitForm" style="float: right" | 36 | <el-button type="primary" @click="submitForm" style="float: right" | ... | ... |
... | @@ -387,7 +387,6 @@ export default { | ... | @@ -387,7 +387,6 @@ export default { |
387 | dname: "历史", | 387 | dname: "历史", |
388 | }, | 388 | }, |
389 | ], | 389 | ], |
390 | tdxz: null, | ||
391 | isShow: false, | 390 | isShow: false, |
392 | disabled: true, | 391 | disabled: true, |
393 | czrOptions: [], | 392 | czrOptions: [], |
... | @@ -462,11 +461,11 @@ export default { | ... | @@ -462,11 +461,11 @@ export default { |
462 | this.ssqlxxshow = false; | 461 | this.ssqlxxshow = false; |
463 | } | 462 | } |
464 | this.$endLoading(); | 463 | this.$endLoading(); |
465 | if (this.ruleForm.tdytqxList.length > 0) { | 464 | // if (this.ruleForm.tdytqxList.length > 0) { |
466 | this.tdxz = this.ruleForm.tdytqxList[0].qlxzbm; | 465 | // this.tdxz = this.ruleForm.tdytqxList[0].qlxzbm; |
467 | } else { | 466 | // } else { |
468 | this.tdxz = null; | 467 | // this.tdxz = null; |
469 | } | 468 | // } |
470 | this.isShow = true; | 469 | this.isShow = true; |
471 | } | 470 | } |
472 | }); | 471 | }); | ... | ... |
... | @@ -19,7 +19,7 @@ import { | ... | @@ -19,7 +19,7 @@ import { |
19 | } from "@/api/workFlow.js"; | 19 | } from "@/api/workFlow.js"; |
20 | import { mapGetters } from 'vuex' | 20 | import { mapGetters } from 'vuex' |
21 | export default { | 21 | export default { |
22 | data () { | 22 | data() { |
23 | return { | 23 | return { |
24 | //是否开启材料分屏 | 24 | //是否开启材料分屏 |
25 | splitScreen: false, | 25 | splitScreen: false, |
... | @@ -35,10 +35,12 @@ export default { | ... | @@ -35,10 +35,12 @@ export default { |
35 | batchButtonName: '', | 35 | batchButtonName: '', |
36 | // 受理申请信息 | 36 | // 受理申请信息 |
37 | slsq: {}, | 37 | slsq: {}, |
38 | ableOperation: true | 38 | ableOperation: true, |
39 | showidea: false | ||
40 | |||
39 | } | 41 | } |
40 | }, | 42 | }, |
41 | mounted () { | 43 | mounted() { |
42 | this.flowInitParam(); | 44 | this.flowInitParam(); |
43 | }, | 45 | }, |
44 | methods: { | 46 | methods: { |
... | @@ -47,7 +49,7 @@ export default { | ... | @@ -47,7 +49,7 @@ export default { |
47 | * @description: 加载流程初始参数 | 49 | * @description: 加载流程初始参数 |
48 | * @author: renchao | 50 | * @author: renchao |
49 | */ | 51 | */ |
50 | flowInitParam () { | 52 | flowInitParam() { |
51 | var formdata = new FormData(); | 53 | var formdata = new FormData(); |
52 | 54 | ||
53 | formdata.append("bsmSlsq", this.bsmSlsq); | 55 | formdata.append("bsmSlsq", this.bsmSlsq); |
... | @@ -58,6 +60,10 @@ export default { | ... | @@ -58,6 +60,10 @@ export default { |
58 | stepExpandInfo(formdata).then((res) => { | 60 | stepExpandInfo(formdata).then((res) => { |
59 | if (res.code === 200) { | 61 | if (res.code === 200) { |
60 | this.leftButtonList = res.result.button; | 62 | this.leftButtonList = res.result.button; |
63 | if (res.result.properties.length) { | ||
64 | this.showidea = res.result.properties[0].value | ||
65 | } | ||
66 | |||
61 | this.rightButtonList = res.result.operation; | 67 | this.rightButtonList = res.result.operation; |
62 | let arr = this.rightButtonList.filter((item) => { | 68 | let arr = this.rightButtonList.filter((item) => { |
63 | return item.name == "删除" | 69 | return item.name == "删除" |
... | @@ -79,7 +85,7 @@ export default { | ... | @@ -79,7 +85,7 @@ export default { |
79 | * @param {*} item | 85 | * @param {*} item |
80 | * @author: renchao | 86 | * @author: renchao |
81 | */ | 87 | */ |
82 | operation (item) { | 88 | operation(item) { |
83 | //按钮 B0:选择不动产单元 B1:流程图 B2:材料分屏 B3:材料导入 B4:登记簿 B5:证书预览 B6:打印申请书 B7:证书领取 B8:楼盘表 B9:登簿 | 89 | //按钮 B0:选择不动产单元 B1:流程图 B2:材料分屏 B3:材料导入 B4:登记簿 B5:证书预览 B6:打印申请书 B7:证书领取 B8:楼盘表 B9:登簿 |
84 | //操作按钮 登簿:record 转件:transfer 退回:back 退出:signout | 90 | //操作按钮 登簿:record 转件:transfer 退回:back 退出:signout |
85 | let that = this; | 91 | let that = this; |
... | @@ -107,21 +113,21 @@ export default { | ... | @@ -107,21 +113,21 @@ export default { |
107 | }) | 113 | }) |
108 | break; | 114 | break; |
109 | case "B2": //材料分屏按钮 | 115 | case "B2": //材料分屏按钮 |
110 | this.splitScreen = this.splitScreen ? false : true; | 116 | this.splitScreen = this.splitScreen ? false : true; |
111 | this.$store.dispatch("app/settScreen", this.splitScreen); | 117 | this.$store.dispatch("app/settScreen", this.splitScreen); |
112 | if (this.splitScreen) { | 118 | if (this.splitScreen) { |
113 | 119 | ||
114 | //如果当前选项卡为材料信息内容,递减到上一个选项卡内容 | 120 | //如果当前选项卡为材料信息内容,递减到上一个选项卡内容 |
115 | if (this.tabName == this.clxxTab.value) { | 121 | if (this.tabName == this.clxxTab.value) { |
116 | this.tabName = this.tabList[this.clxxIndex - 1].value; | 122 | this.tabName = this.tabList[this.clxxIndex - 1].value; |
117 | this.getFromRouter(this.tabList[this.clxxIndex - 1].value); | 123 | this.getFromRouter(this.tabList[this.clxxIndex - 1].value); |
124 | } | ||
125 | //删除材料信息选项卡数据 | ||
126 | this.tabList.splice(this.clxxIndex, 1); | ||
127 | } else { | ||
128 | //新增材料信息选项卡数据 | ||
129 | this.tabList.splice(this.clxxIndex, 0, this.clxxTab); | ||
118 | } | 130 | } |
119 | //删除材料信息选项卡数据 | ||
120 | this.tabList.splice(this.clxxIndex, 1); | ||
121 | } else { | ||
122 | //新增材料信息选项卡数据 | ||
123 | this.tabList.splice(this.clxxIndex, 0, this.clxxTab); | ||
124 | } | ||
125 | // this.closefp() | 131 | // this.closefp() |
126 | 132 | ||
127 | // if (this.splitScreen) { | 133 | // if (this.splitScreen) { |
... | @@ -289,7 +295,7 @@ export default { | ... | @@ -289,7 +295,7 @@ export default { |
289 | * @description: del | 295 | * @description: del |
290 | * @author: renchao | 296 | * @author: renchao |
291 | */ | 297 | */ |
292 | del () { | 298 | del() { |
293 | let formdata = new FormData(); | 299 | let formdata = new FormData(); |
294 | formdata.append("bsmSlsq", this.bsmSlsq); | 300 | formdata.append("bsmSlsq", this.bsmSlsq); |
295 | this.$confirm("确定要删除吗, 是否继续?", "提示", { | 301 | this.$confirm("确定要删除吗, 是否继续?", "提示", { |
... | @@ -324,24 +330,27 @@ export default { | ... | @@ -324,24 +330,27 @@ export default { |
324 | * @param {*} obj | 330 | * @param {*} obj |
325 | * @author: renchao | 331 | * @author: renchao |
326 | */ | 332 | */ |
327 | sendToNext (obj) { | 333 | sendToNext(obj) { |
328 | this.$popupDialog("转出", "djbworkflow/components/zc", { | 334 | this.$popupDialog("转出", "djbworkflow/components/zc", { |
329 | obj:obj, | 335 | obj: obj, |
330 | bsmSlsq: this.bsmSlsq, | 336 | bsmSlsq: this.bsmSlsq, |
331 | tabList: this.tabList | 337 | tabList: this.tabList, |
332 | }, '800px', true) | 338 | tshowidea: this.showidea |
339 | }, '600px', true) | ||
333 | }, | 340 | }, |
334 | //转出最后一个流程 | 341 | //转出最后一个流程 |
335 | /** | 342 | /** |
336 | * @description: 转出最后一个流程 | 343 | * @description: 转出最后一个流程 |
337 | * @author: renchao | 344 | * @author: renchao |
338 | */ | 345 | */ |
339 | sendToEnd () { | 346 | sendToEnd() { |
340 | this.$popupDialog("转出", "djbworkflow/components/zc", { | 347 | this.$popupDialog("转出", "djbworkflow/components/zc", { |
341 | obj:"", | 348 | obj: "", |
342 | bsmSlsq: this.bsmSlsq, | 349 | bsmSlsq: this.bsmSlsq, |
343 | tabList: this.tabList | 350 | tabList: this.tabList, |
344 | }, '800px', true) | 351 | showidea: this.showidea |
352 | |||
353 | }, '600px', true) | ||
345 | }, | 354 | }, |
346 | 355 | ||
347 | //批量操作 | 356 | //批量操作 |
... | @@ -349,7 +358,7 @@ export default { | ... | @@ -349,7 +358,7 @@ export default { |
349 | * @description: 批量操作 | 358 | * @description: 批量操作 |
350 | * @author: renchao | 359 | * @author: renchao |
351 | */ | 360 | */ |
352 | handleBatchDel () { | 361 | handleBatchDel() { |
353 | this.$popupDialog("批量删除", "workflow/components/batchDel", { | 362 | this.$popupDialog("批量删除", "workflow/components/batchDel", { |
354 | width: "50%", | 363 | width: "50%", |
355 | btnShow: false, | 364 | btnShow: false, |
... | @@ -363,7 +372,7 @@ export default { | ... | @@ -363,7 +372,7 @@ export default { |
363 | * @param {*} file | 372 | * @param {*} file |
364 | * @author: renchao | 373 | * @author: renchao |
365 | */ | 374 | */ |
366 | handleChange (file) { | 375 | handleChange(file) { |
367 | var formdata = new FormData(); | 376 | var formdata = new FormData(); |
368 | formdata.append("file", file.raw); | 377 | formdata.append("file", file.raw); |
369 | formdata.append("bsmSldy", this.currentSelectProps.bsmSldy); | 378 | formdata.append("bsmSldy", this.currentSelectProps.bsmSldy); |
... | @@ -382,7 +391,7 @@ export default { | ... | @@ -382,7 +391,7 @@ export default { |
382 | * @param {*} file | 391 | * @param {*} file |
383 | * @author: renchao | 392 | * @author: renchao |
384 | */ | 393 | */ |
385 | beforeUpload (file) { | 394 | beforeUpload(file) { |
386 | return true; | 395 | return true; |
387 | } | 396 | } |
388 | } | 397 | } | ... | ... |
... | @@ -14,31 +14,34 @@ | ... | @@ -14,31 +14,34 @@ |
14 | :heightNumSetting="true" | 14 | :heightNumSetting="true" |
15 | :minHeight="150" | 15 | :minHeight="150" |
16 | height="150" | 16 | height="150" |
17 | style="width: 100%"> | 17 | style="width: 100%" |
18 | > | ||
18 | <el-table-column prop="index" width="50" :render-header="renderHeader"> | 19 | <el-table-column prop="index" width="50" :render-header="renderHeader"> |
19 | <template slot-scope="scope"> | 20 | <template slot-scope="scope"> |
20 | <i | 21 | <i |
21 | class="el-icon-minus pointer" | 22 | class="el-icon-minus pointer" |
22 | @click="deleClick(scope.$index, scope.row)" | 23 | @click="deleClick(scope.$index, scope.row)" |
23 | v-if="ableOperation"></i> | 24 | v-if="ableOperation" |
25 | ></i> | ||
24 | <div style="text-align: center" v-else> | 26 | <div style="text-align: center" v-else> |
25 | {{ scope.$index + 1 }} | 27 | {{ scope.$index + 1 }} |
26 | </div> | 28 | </div> |
27 | </template> | 29 | </template> |
28 | </el-table-column> | 30 | </el-table-column> |
29 | <el-table-column prop="tdyt" label="土地用途" min-width="100"> | 31 | <el-table-column prop="yt" label="土地用途" min-width="100"> |
30 | <template slot-scope="scope"> | 32 | <template slot-scope="scope"> |
31 | <treeselect | 33 | <treeselect |
32 | v-model="tdyt" | 34 | v-model="scope.row.yt" |
33 | :disabled="!ableOperation" | 35 | :disabled="!ableOperation" |
34 | noOptionsText="暂无数据" | 36 | noOptionsText="暂无数据" |
35 | placeholder='' | 37 | placeholder="" |
36 | :show-count="true" | 38 | :show-count="true" |
37 | :options="dictData['tdyt']" | 39 | :options="dictData['tdyt']" |
38 | :normalizer="normalizer" | 40 | :normalizer="normalizer" |
39 | :appendToBody="true" | 41 | :appendToBody="true" |
40 | z-index="9999" | 42 | z-index="9999" |
41 | @input="addrow(scope.row)" /> | 43 | @input="addrow(scope.$index)" |
44 | /> | ||
42 | </template> | 45 | </template> |
43 | </el-table-column> | 46 | </el-table-column> |
44 | <el-table-column prop="qssj" label="土地使用起始时间" min-width="100"> | 47 | <el-table-column prop="qssj" label="土地使用起始时间" min-width="100"> |
... | @@ -51,7 +54,8 @@ | ... | @@ -51,7 +54,8 @@ |
51 | placeholder="选择日期" | 54 | placeholder="选择日期" |
52 | value-format="yyyy-MM-dd HH:mm:ss" | 55 | value-format="yyyy-MM-dd HH:mm:ss" |
53 | format="yyyy-MM-dd" | 56 | format="yyyy-MM-dd" |
54 | @input="startTime(scope.$index)"> | 57 | @input="startTime(scope.$index)" |
58 | > | ||
55 | </el-date-picker> | 59 | </el-date-picker> |
56 | </template> | 60 | </template> |
57 | </el-table-column> | 61 | </el-table-column> |
... | @@ -65,7 +69,8 @@ | ... | @@ -65,7 +69,8 @@ |
65 | placeholder="选择日期" | 69 | placeholder="选择日期" |
66 | value-format="yyyy-MM-dd HH:mm:ss" | 70 | value-format="yyyy-MM-dd HH:mm:ss" |
67 | format="yyyy-MM-dd" | 71 | format="yyyy-MM-dd" |
68 | @input="endTime(scope.$index)"> | 72 | @input="endTime(scope.$index)" |
73 | > | ||
69 | </el-date-picker> | 74 | </el-date-picker> |
70 | </template> | 75 | </template> |
71 | </el-table-column> | 76 | </el-table-column> |
... | @@ -74,246 +79,233 @@ | ... | @@ -74,246 +79,233 @@ |
74 | <el-input | 79 | <el-input |
75 | class="item" | 80 | class="item" |
76 | :disabled="!ableOperation" | 81 | :disabled="!ableOperation" |
77 | v-model="scope.row.syqx" | 82 | v-model="scope.row.tdsyqx" |
83 | oninput="value = (value.match(/^\d*(\.?\d{0,2})/g)[0]) || null" | ||
78 | placeholder="请输入内容" | 84 | placeholder="请输入内容" |
79 | @input="sumTime(scope.$index,scope.row.syqx)"> | 85 | @input="sumTime(scope.$index, scope.row.tdsyqx)" |
80 | ></el-input> | 86 | > |
87 | ></el-input | ||
88 | > | ||
81 | </template> | 89 | </template> |
82 | </el-table-column> | 90 | </el-table-column> |
83 | </el-table> | 91 | </el-table> |
84 | </div> | 92 | </div> |
85 | </template> | 93 | </template> |
86 | <script> | 94 | <script> |
87 | import { mapGetters } from "vuex"; | 95 | import { mapGetters } from "vuex"; |
88 | export default { | 96 | export default { |
89 | computed: { | 97 | computed: { |
90 | ...mapGetters(["dictData"]), | 98 | ...mapGetters(["dictData"]), |
99 | }, | ||
100 | props: { | ||
101 | tableData: { | ||
102 | type: Array, | ||
103 | default: function () { | ||
104 | return []; | ||
105 | }, | ||
91 | }, | 106 | }, |
92 | props: { | 107 | ableOperation: { |
93 | tableData: { | 108 | type: Boolean, |
94 | type: Array, | 109 | default: true, |
95 | default: function () { | 110 | }, |
96 | return []; | 111 | }, |
97 | }, | 112 | data() { |
113 | return { | ||
114 | // 键名转换,方法默认是label和children进行树状渲染 | ||
115 | key: 0, | ||
116 | newdata: { | ||
117 | yt: null, | ||
118 | qssj: "", | ||
119 | jssj: "", | ||
120 | tdsyqx: "", | ||
121 | }, | ||
122 | tableDataList: [], | ||
123 | // 起始时间选择范围 | ||
124 | pickerStart: {}, | ||
125 | pickerEnd: {}, | ||
126 | normalizer(node) { | ||
127 | if (node.children == null || node.children == "null") { | ||
128 | delete node.children; | ||
129 | } | ||
130 | return { | ||
131 | id: node.dcode, | ||
132 | label: node.dname, | ||
133 | children: node.children, | ||
134 | }; | ||
98 | }, | 135 | }, |
99 | ableOperation: { | 136 | }; |
100 | type: Boolean, | 137 | }, |
101 | default: true, | 138 | mounted() {}, |
139 | watch: { | ||
140 | tableData: { | ||
141 | handler: function (val, oldVal) { | ||
142 | let that = this; | ||
143 | this.$nextTick(() => { | ||
144 | if (val.length == 0 || !val) { | ||
145 | console.log("进了"); | ||
146 | that.tableDataList = _.cloneDeep([ | ||
147 | { | ||
148 | yt: null, | ||
149 | qssj: "", | ||
150 | jssj: "", | ||
151 | tdsyqx: "", | ||
152 | }, | ||
153 | ]); | ||
154 | } else { | ||
155 | that.tableDataList = _.cloneDeep(val); | ||
156 | } | ||
157 | }); | ||
102 | }, | 158 | }, |
159 | immediate: true, | ||
160 | deep: true, | ||
103 | }, | 161 | }, |
104 | data () { | 162 | }, |
105 | return { | 163 | methods: { |
106 | // 键名转换,方法默认是label和children进行树状渲染 | 164 | /** |
107 | tdyt: null, | 165 | * @description: renderHeader |
108 | key: 0, | 166 | * @author: renchao |
109 | newdata: { | 167 | */ |
110 | yt: "", | 168 | renderHeader() { |
111 | qssj: "", | 169 | return ( |
112 | jssj: "", | 170 | <div> |
113 | syqx: "", | 171 | {" "} |
114 | }, | 172 | {!this.ableOperation ? ( |
115 | tableDataList: [], | 173 | "序号" |
116 | // 起始时间选择范围 | 174 | ) : ( |
117 | pickerStart: {}, | 175 | <i |
118 | pickerEnd: {}, | 176 | class="el-icon-plus pointer" |
119 | normalizer (node) { | 177 | onClick={() => { |
120 | if (node.children == null || node.children == "null") { | 178 | this.addClick(); |
121 | delete node.children; | 179 | }} |
180 | ></i> | ||
181 | )} | ||
182 | </div> | ||
183 | ); | ||
184 | }, | ||
185 | // 修改事件 | ||
186 | /** | ||
187 | * @description: 修改事件 | ||
188 | * @author: renchao | ||
189 | */ | ||
190 | addrow(a) { | ||
191 | console.log(a); | ||
192 | // this.tableDataList = this.tableDataList.map((item) => { | ||
193 | // return { | ||
194 | // ...item, | ||
195 | // yt: this.tdyt, | ||
196 | // }; | ||
197 | // }); | ||
198 | // this.$emit("upDateTdytxxList", this.tableDataList); | ||
199 | }, | ||
200 | /** | ||
201 | * @description: startTime | ||
202 | * @param {*} index | ||
203 | * @author: renchao | ||
204 | */ | ||
205 | startTime(index) { | ||
206 | console.log("index", index); | ||
207 | // let startTime = this.tableDataList[index].tdsyqssj; | ||
208 | let endTime = this.tableDataList[index].jssj; | ||
209 | let startTime = this.tableDataList[index].qssj; | ||
210 | this.tableDataList[index].pickerEnd = { | ||
211 | disabledDate: (time) => { | ||
212 | if (Object.keys(startTime).length > 0) { | ||
213 | return new Date(startTime).getTime() > time.getTime(); | ||
214 | } else { | ||
215 | return time.getTime() < Date.now(); | ||
122 | } | 216 | } |
123 | return { | ||
124 | id: node.dcode, | ||
125 | label: node.dname, | ||
126 | }; | ||
127 | }, | 217 | }, |
128 | }; | 218 | }; |
219 | if (startTime && endTime) { | ||
220 | let startYear = new Date(startTime).getFullYear(); | ||
221 | let endYear = new Date(endTime).getFullYear(); | ||
222 | this.tableDataList[index].tdsyqx = endYear - startYear; | ||
223 | } | ||
224 | this.$emit("upDateTdytxxList", this.tableDataList); | ||
129 | }, | 225 | }, |
130 | mounted () { | 226 | /** |
131 | }, | 227 | * @description: endTime |
132 | watch: { | 228 | * @param {*} index |
133 | tableData: { | 229 | * @author: renchao |
134 | handler: function (val, oldVal) { | 230 | */ |
135 | let that = this; | 231 | endTime(index) { |
136 | this.$nextTick(() => { | 232 | // let startTime = this.tableDataList[index].tdsyqssj; |
137 | if (val.length == 0 || !val) { | 233 | let startTime = this.tableDataList[index].qssj; |
138 | that.tableDataList = _.cloneDeep([ | 234 | let endTime = this.tableDataList[index].jssj; |
139 | { | 235 | this.tableDataList[index].pickerStart = { |
140 | yt: "", | 236 | disabledDate: (time) => { |
141 | qssj: "", | 237 | if (Object.keys(endTime).length > 0) { |
142 | jssj: "", | 238 | return new Date(endTime).getTime() < time.getTime(); |
143 | syqx: "", | 239 | } else { |
144 | }, | 240 | return time.getTime() > Date.now(); |
145 | ]); | 241 | } |
146 | if (that.tableDataList.length > 0) { | ||
147 | this.tdyt = that.tableDataList[0].yt | ||
148 | ? that.tableDataList[0].yt | ||
149 | : null; | ||
150 | } else { | ||
151 | this.tdyt = null; | ||
152 | } | ||
153 | } else { | ||
154 | that.tableDataList = _.cloneDeep(val); | ||
155 | if (that.tableDataList.length > 0) { | ||
156 | this.tdyt = that.tableDataList[0].yt | ||
157 | ? that.tableDataList[0].yt | ||
158 | : null; | ||
159 | } else { | ||
160 | this.tdyt = null; | ||
161 | } | ||
162 | } | ||
163 | }); | ||
164 | }, | 242 | }, |
165 | immediate: true, | 243 | }; |
166 | deep: true, | 244 | if (startTime && endTime) { |
167 | }, | 245 | let startYear = new Date(startTime).getFullYear(); |
246 | let endYear = new Date(endTime).getFullYear(); | ||
247 | this.tableDataList[index].tdsyqx = endYear - startYear; | ||
248 | } | ||
249 | this.$emit("upDateTdytxxList", this.tableDataList); | ||
168 | }, | 250 | }, |
169 | methods: { | 251 | /** |
170 | /** | 252 | * @description: sumTime |
171 | * @description: renderHeader | 253 | * @param {*} index |
172 | * @author: renchao | 254 | * @param {*} tdsyqx |
173 | */ | 255 | * @author: renchao |
174 | renderHeader () { | 256 | */ |
175 | return ( | 257 | sumTime(index, tdsyqx) { |
176 | <div> | 258 | let startTime = this.tableDataList[index].qssj; |
177 | {" "} | 259 | this.tableDataList[index].jssj = |
178 | {!this.ableOperation ? ( | 260 | Number(startTime.substring(0, 4)) + |
179 | "序号" | 261 | Number(tdsyqx) + |
180 | ) : ( | 262 | startTime.slice(4, 19); |
181 | <i | 263 | this.$emit("upDateTdytxxList", this.tableDataList); |
182 | class="el-icon-plus pointer" | 264 | }, |
183 | onClick={() => { | 265 | // 新增 |
184 | this.addClick(); | 266 | /** |
185 | }} | 267 | * @description: 新增 |
186 | ></i> | 268 | * @author: renchao |
187 | )} | 269 | */ |
188 | </div> | 270 | addClick() { |
189 | ); | 271 | this.tableDataList[this.tableDataList.length] = _.cloneDeep(this.newdata); |
190 | }, | ||
191 | // 修改事件 | ||
192 | /** | ||
193 | * @description: 修改事件 | ||
194 | * @author: renchao | ||
195 | */ | ||
196 | addrow () { | ||
197 | this.tableDataList = this.tableDataList.map((item) => { | ||
198 | return { | ||
199 | ...item, | ||
200 | yt: this.tdyt, | ||
201 | }; | ||
202 | }); | ||
203 | this.$emit("upDateTdytxxList", this.tableDataList); | ||
204 | }, | ||
205 | /** | ||
206 | * @description: startTime | ||
207 | * @param {*} index | ||
208 | * @author: renchao | ||
209 | */ | ||
210 | startTime (index) { | ||
211 | // let startTime = this.tableDataList[index].tdsyqssj; | ||
212 | let endTime = this.tableDataList[index].jssj; | ||
213 | let startTime = this.tableDataList[index].qssj; | ||
214 | this.tableDataList[index].pickerEnd = { | ||
215 | disabledDate: (time) => { | ||
216 | if (Object.keys(startTime).length > 0) { | ||
217 | return new Date(startTime).getTime() > time.getTime(); | ||
218 | } else { | ||
219 | return time.getTime() < Date.now(); | ||
220 | } | ||
221 | }, | ||
222 | }; | ||
223 | if ( | ||
224 | Object.keys(startTime).length > 0 && | ||
225 | Object.keys(endTime).length > 0 | ||
226 | ) { | ||
227 | let startYear = new Date(startTime).getFullYear(); | ||
228 | let endYear = new Date(endTime).getFullYear(); | ||
229 | this.tableDataList[index].syqx = endYear - startYear; | ||
230 | } | ||
231 | }, | ||
232 | /** | ||
233 | * @description: endTime | ||
234 | * @param {*} index | ||
235 | * @author: renchao | ||
236 | */ | ||
237 | endTime (index) { | ||
238 | // let startTime = this.tableDataList[index].tdsyqssj; | ||
239 | let startTime = this.tableDataList[index].qssj; | ||
240 | let endTime = this.tableDataList[index].jssj; | ||
241 | this.tableDataList[index].pickerStart = { | ||
242 | disabledDate: (time) => { | ||
243 | if (Object.keys(endTime).length > 0) { | ||
244 | return new Date(endTime).getTime() < time.getTime(); | ||
245 | } else { | ||
246 | return time.getTime() > Date.now(); | ||
247 | } | ||
248 | }, | ||
249 | }; | ||
250 | if ( | ||
251 | Object.keys(startTime).length > 0 && | ||
252 | Object.keys(endTime).length > 0 | ||
253 | ) { | ||
254 | let startYear = new Date(startTime).getFullYear(); | ||
255 | let endYear = new Date(endTime).getFullYear(); | ||
256 | this.tableDataList[index].syqx = endYear - startYear; | ||
257 | } | ||
258 | }, | ||
259 | /** | ||
260 | * @description: sumTime | ||
261 | * @param {*} index | ||
262 | * @param {*} syqx | ||
263 | * @author: renchao | ||
264 | */ | ||
265 | sumTime (index, syqx) { | ||
266 | |||
267 | let startTime = this.tableDataList[index].qssj; | ||
268 | this.tableDataList[index].jssj = | ||
269 | Number(startTime.substring(0, 4)) + | ||
270 | Number(syqx) + | ||
271 | startTime.slice(4, 19); | ||
272 | |||
273 | }, | ||
274 | // 新增 | ||
275 | /** | ||
276 | * @description: 新增 | ||
277 | * @author: renchao | ||
278 | */ | ||
279 | addClick () { | ||
280 | this.tableDataList[this.tableDataList.length] = _.cloneDeep(this.newdata); | ||
281 | 272 | ||
282 | this.$emit("upDateTdytxxList", this.tableDataList); | 273 | this.$emit("upDateTdytxxList", this.tableDataList); |
283 | }, | 274 | }, |
284 | 275 | ||
285 | // 删除 | 276 | // 删除 |
286 | /** | 277 | /** |
287 | * @description: 删除 | 278 | * @description: 删除 |
288 | * @param {*} index | 279 | * @param {*} index |
289 | * @param {*} row | 280 | * @param {*} row |
290 | * @author: renchao | 281 | * @author: renchao |
291 | */ | 282 | */ |
292 | deleClick (index, row) { | 283 | deleClick(index, row) { |
293 | this.$confirm("确定要删除吗, 是否继续?", "提示", { | 284 | this.$confirm("确定要删除吗, 是否继续?", "提示", { |
294 | confirmButtonText: "确定", | 285 | confirmButtonText: "确定", |
295 | cancelButtonText: "取消", | 286 | cancelButtonText: "取消", |
296 | type: "warning", | 287 | type: "warning", |
288 | }) | ||
289 | .then(() => { | ||
290 | this.tableData.splice(index, 1); | ||
297 | }) | 291 | }) |
298 | .then(() => { | 292 | .catch(() => {}); |
299 | this.tableData.splice(index, 1); | 293 | this.$emit("upDateTdytxxList", this.tableDataList); |
300 | }) | ||
301 | .catch(() => { }); | ||
302 | }, | ||
303 | }, | 294 | }, |
304 | }; | 295 | }, |
296 | }; | ||
305 | </script> | 297 | </script> |
306 | <style scoped lang="scss"> | 298 | <style scoped lang="scss"> |
307 | .el-input { | 299 | .el-input { |
308 | border: none !important; | 300 | border: none !important; |
309 | } | 301 | } |
310 | /deep/.el-table__row { | 302 | /deep/.el-table__row { |
311 | border: none !important; | 303 | border: none !important; |
312 | } | 304 | } |
313 | .el-date-editor.el-input { | 305 | .el-date-editor.el-input { |
314 | width: 100%; | 306 | width: 100%; |
315 | } | 307 | } |
316 | /deep/.el-table th { | 308 | /deep/.el-table th { |
317 | height: 30px !important; | 309 | height: 30px !important; |
318 | } | 310 | } |
319 | </style> | 311 | </style> | ... | ... |
-
Please register or sign in to post a comment