diff --git a/src/api/basic/basicPdarecords.js b/src/api/basic/basicPdarecords.js index b5545256..b0c8f77b 100644 --- a/src/api/basic/basicPdarecords.js +++ b/src/api/basic/basicPdarecords.js @@ -12,6 +12,18 @@ export const getList = (current, size, params) => { }) } +export const getPage = (current, size, params) => { + return request({ + url: '/api/logpm-basic/basicPdarecords/page', + method: 'get', + params: { + ...params, + current, + size, + } + }) +} + export const getDetail = (id) => { return request({ url: '/api/logpm-basic/basicPdarecords/detail', diff --git a/src/option/basic/basicPdarecordslist.js b/src/option/basic/basicPdarecordslist.js new file mode 100644 index 00000000..711e8d8e --- /dev/null +++ b/src/option/basic/basicPdarecordslist.js @@ -0,0 +1,172 @@ +export default { + expand: false, + index: true, + border: true, + selection: true, + column: [ + { + label: "主键", + prop: "id", + display: false, + hide: true, + }, + { + label: "租户号", + prop: "tenantId", + display: false, + hide: true, + }, + { + label: "创建人", + prop: "createUser", + display: false, + hide: true, + }, + { + label: "创建时间", + prop: "createTime", + display: false, + hide: true, + }, + { + label: "更新人", + prop: "updateUser", + display: false, + hide: true, + }, + { + label: "更新时间", + prop: "updateTime", + display: false, + hide: true, + }, + { + label: "状态", + prop: "status", + display: false, + hide: true, + }, + { + label: "是否已删除", + prop: "isDeleted", + display: false, + hide: true, + }, + { + label: "创建部门", + prop: "createDept", + display: false, + hide: true, + }, + { + label: "预留1", + prop: "reserve1", + display: false, + hide: true, + }, + { + label: "预留2", + prop: "reserve2", + display: false, + hide: true, + }, + { + label: "预留3", + prop: "reserve3", + display: false, + hide: true, + }, + { + label: "预留4", + prop: "reserve4", + display: false, + hide: true, + }, + { + label: "预留5", + prop: "reserve5", + display: false, + hide: true, + }, + { + label: "pda品牌", + prop: "pdaName", + width:"100px" + }, + { + label: "pda型号", + prop: "pdaModel", + width:"100px" + }, + { + label: "反馈日期", + prop: "feedbackTime", + format: "yyyy-MM-dd", + valueFormat: "yyyy-MM-dd", + width:"100px" + }, + { + label: "营业部", + prop: "businessDepartment", + search: true, + width:"100px" + }, + { + label: "维修品牌", + prop: "brand", + search: true, + width:"100px" + }, + { + label: "采买经销商", + prop: "dealer", + search: true, + width:"150px" + }, + { + label: "维修公司", + prop: "maintenanceCompany", + search: true, + width:"150px" + }, + { + label: "寄检修快递单号", + prop: "repairTrackingNub", + search: true, + width:"150px" + }, + { + label: "是否保修期", + prop: "isLiability", + search: true, + width:"100px" + }, + { + label: "问题描述", + prop: "problemDescription", + width:"150px" + }, + { + label: "维修费(元)", + prop: "maintenanceCosts", + width:"100px" + }, + { + label: "寄回日期", + prop: "returnDate", + search: true, + width:"100px" + }, + { + label: "维修寄回单号", + prop: "returnOrderNub", + search: true, + width:"150px" + }, + { + label: "备注", + prop: "notes", + width:"150px" + }, + ] +} diff --git a/src/router/views/index.js b/src/router/views/index.js index e9682616..f1812070 100644 --- a/src/router/views/index.js +++ b/src/router/views/index.js @@ -134,12 +134,12 @@ export default [ { path: '/basic/pdarecords/basicPdarecords', component: Layout, - key:'$router.data', + key:'fullPath', redirect: '/basic/pdarecords', children: [ { path: '/basic/pdarecords/basicPdarecords', - name: 'pad维修记录', + name: '维修记录', meta: { data: 'data', }, diff --git a/src/views/basic/forklift/basicForklift.vue b/src/views/basic/forklift/basicForklift.vue index 236e1acf..c06793ea 100644 --- a/src/views/basic/forklift/basicForklift.vue +++ b/src/views/basic/forklift/basicForklift.vue @@ -277,13 +277,13 @@ - + - + diff --git a/src/views/basic/pda/basicPda.vue b/src/views/basic/pda/basicPda.vue index e2a37a50..8a930c70 100644 --- a/src/views/basic/pda/basicPda.vue +++ b/src/views/basic/pda/basicPda.vue @@ -4,8 +4,8 @@ - - + + @@ -106,8 +106,8 @@ - - + + @@ -191,14 +191,14 @@ - + - + @@ -338,27 +338,27 @@ export default { }, ], }, - validatorRules: { - name: [ - { required: true, message: '请输入名称!',trigger: 'blur'} - ], - model: [ - { required: true, message: '请输入型号!',trigger: 'blur'} - ], - deviceSerialNumber: [ - { required: true, message: '请输入序列号!',trigger: 'blur'} - ], - state: [ - { required: true, message: '请选择状态!',trigger: 'blur'} - ], - deposit: [ - { required: true, message: '请输入押金!',trigger: 'blur'},{pattern: /(^[1-9]\d{0,9}(\.\d{1,3})?$)|(^0(\.\d{1,2})?$)/, message: '押金格式不正确!'} - ], - purchaseAmount: [ - {pattern: /(^[1-9]\d{0,9}(\.\d{1,3})?$)|(^0(\.\d{1,2})?$)/, message: '押金格式不正确!'} - ], + validatorRules: { + name: [ + { required: true, message: '请输入名称!',trigger: 'blur'} + ], + model: [ + { required: true, message: '请输入型号!',trigger: 'blur'} + ], + deviceSerialNumber: [ + { required: true, message: '请输入序列号!',trigger: 'blur'} + ], + state: [ + { required: true, message: '请选择状态!',trigger: 'blur'} + ], + deposit: [ + { required: true, message: '请输入押金!',trigger: 'blur'},{pattern: /(^[1-9]\d{0,9}(\.\d{1,3})?$)|(^0(\.\d{1,2})?$)/, message: '押金格式不正确!'} + ], + purchaseAmount: [ + {pattern: /(^[1-9]\d{0,9}(\.\d{1,3})?$)|(^0(\.\d{1,2})?$)/, message: '押金格式不正确!'} + ], - }, + }, }; }, mounted() { @@ -384,7 +384,7 @@ export default { } }, action() { - return '/api/blade-resource/oss/endpoint/put-file' + return '/api/blade-resource/oss/endpoint/put-file-attach' } }, methods: { @@ -402,7 +402,7 @@ export default { }, handlePictureCardPreview(file) { console.log("file>>>>>>",file); - if (!!file.response){this.dialogImageUrl = file.response.data.link;} + if (!!file.data){this.dialogImageUrl = file.data.link;} else {this.dialogImageUrl=file.url} this.dialogVisible = true; @@ -589,7 +589,7 @@ export default { if(this.fileList.length>0){ let url=[] for (let i = 0; i < this.fileList.length; i++) { - if (!!this.fileList[i].response){url.push(this.fileList[i].response.data.link)}else { url.push(this.fileList[i].url)} + if (!!this.fileList[i].data){url.push(this.fileList[i].data.link)}else { url.push(this.fileList[i].url)} } this.form.photo= url.toString() } diff --git a/src/views/basic/pdarecords/basicPdarecords.vue b/src/views/basic/pdarecords/basicPdarecords.vue index 99360e24..854bbcaa 100644 --- a/src/views/basic/pdarecords/basicPdarecords.vue +++ b/src/views/basic/pdarecords/basicPdarecords.vue @@ -39,7 +39,7 @@
- 返 回 + 返 回 新 增 删 除
@@ -103,7 +103,7 @@ width="50%" :before-close="beforeClose" append-to-body> - + @@ -112,7 +112,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -219,6 +219,8 @@ export default { box: false, // 是否显示查询 search: true, + //是否显示新增 + isadd:false, // 加载中 loading: true, // 是否为查看模式 @@ -240,21 +242,35 @@ export default { option: option, // 表单列表 data: [], + //规则 + validatorRules: { + isLiability: [ + { required: true, message: '请填写是否保修期!',trigger: 'blur'} + ], + maintenanceCosts: [ + { required: true, message: '请输入维修费用!',trigger: 'blur'},{pattern: /(^[1-9]\d{0,9}(\.\d{1,3})?$)|(^0(\.\d{1,2})?$)/, message: '费用格式不正确!'} + ], + + }, } }, watch:{ - $router:{ // eslint-disable-next-line no-unused-vars - handler (newName, oldName) { + '$route'(to,from) { + // this.isadd =false; + // this.query.masterId = null; + // this.masterId = null; + if (!!this.$route.query.data){ + //做一些路由变化的响应 + // this.isadd =true; this.query.masterId = this.$route.query.data - console.log("this.query.masterId>>>>>>>>>>>>",this.query.masterId); this.masterId = this.$route.query.data - this.onLoad(this.page); - }, - }, + //重新获取数据 + this.onLoad(this.page);}else {} + } }, mounted () { - console.log(">>>>>>>>>>>"); + this.init(); this.onLoad(this.page); }, @@ -301,7 +317,10 @@ export default { this.onLoad(this.page); }, handleSubmit () { + this.$refs.form.validate(valid=>{ + if (valid) { if (!this.form.id) { + this.form.masterId = this.$route.query.data add(this.form).then(() => { this.box = false; this.onLoad(this.page); @@ -320,6 +339,11 @@ export default { }); }) } + } else { + console.log('error submit!!'); + return false; + } + }); }, handleAdd () { this.title = '新增' @@ -401,7 +425,7 @@ export default { this.onLoad(this.page); }, onLoad (page, params = {}) { - this.query.masterId =this.$route.query.data + if (!!this.$route.query.data){this.query.masterId =this.$route.query.data} this.loading = true; getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { const data = res.data.data; diff --git a/src/views/basic/pdarecords/basicPdarecordslist.vue b/src/views/basic/pdarecords/basicPdarecordslist.vue new file mode 100644 index 00000000..ac29e1bb --- /dev/null +++ b/src/views/basic/pdarecords/basicPdarecordslist.vue @@ -0,0 +1,453 @@ + + +