Authored by zhichao

feat:巡检配置端功能

@@ -38,12 +38,12 @@ export default { @@ -38,12 +38,12 @@ export default {
38 prop: 'days', 38 prop: 'days',
39 label: '日期', 39 label: '日期',
40 align: 'center', 40 align: 'center',
41 - width:300 41 + width: 300
42 }, { 42 }, {
43 prop: 'times', 43 prop: 'times',
44 label: '巡检时间', 44 label: '巡检时间',
45 align: 'center', 45 align: 'center',
46 - width:300 46 + width: 300
47 }, { 47 }, {
48 prop: 'type', 48 prop: 'type',
49 label: '巡检类型', 49 label: '巡检类型',
@@ -60,7 +60,7 @@ export default { @@ -60,7 +60,7 @@ export default {
60 prop: 'createTime', 60 prop: 'createTime',
61 label: '创建时间', 61 label: '创建时间',
62 align: 'center', 62 align: 'center',
63 - width:180 63 + width: 180
64 } 64 }
65 ] 65 ]
66 }) 66 })
@@ -88,8 +88,8 @@ export default { @@ -88,8 +88,8 @@ export default {
88 * 加载列表 88 * 加载列表
89 */ 89 */
90 const getList = () => { 90 const getList = () => {
91 - proxy.$http.get( '/api-web/inspectionExcelConfig/list', queryParams.value,res => {  
92 - if(res && res.success){ 91 + proxy.$http.get('/api-web/inspectionExcelConfig/list', queryParams.value, res => {
  92 + if (res && res.success) {
93 count.value = res.count; 93 count.value = res.count;
94 tableData.value.dataList = res.data; 94 tableData.value.dataList = res.data;
95 } 95 }
@@ -126,7 +126,7 @@ export default { @@ -126,7 +126,7 @@ export default {
126 type: '', 126 type: '',
127 number: 0, 127 number: 0,
128 times: '', 128 times: '',
129 - id:-1 129 + id: -1
130 }; 130 };
131 configArr.value = []; 131 configArr.value = [];
132 } 132 }
@@ -143,16 +143,18 @@ export default { @@ -143,16 +143,18 @@ export default {
143 */ 143 */
144 const saveConfig = () => { 144 const saveConfig = () => {
145 let arr = configArr.value; 145 let arr = configArr.value;
146 - if(arr.length > 0){ 146 + if (arr.length > 0) {
147 let url = '/api-web/inspectionExcelConfig/update'; 147 let url = '/api-web/inspectionExcelConfig/update';
148 - if(formParams.value.id === -1){ 148 + if (formParams.value.id === -1) {
149 url = '/api-web/inspectionExcelConfig/add'; 149 url = '/api-web/inspectionExcelConfig/add';
150 } 150 }
151 - proxy.$http.post(url,arr,res => {  
152 - if(res && res.success){ 151 + proxy.$http.post(url, arr, res => {
  152 + if (res && res.success) {
153 global.showMsg("操作成功!", "success"); 153 global.showMsg("操作成功!", "success");
154 closeDialog(); 154 closeDialog();
155 getList(); 155 getList();
  156 + } else {
  157 + global.showMsg(res.msg, "error");
156 } 158 }
157 }); 159 });
158 } 160 }
@@ -166,7 +168,7 @@ export default { @@ -166,7 +168,7 @@ export default {
166 title.value = '编辑' 168 title.value = '编辑'
167 showDialog.value = true; 169 showDialog.value = true;
168 formParams.value.id = row.id; 170 formParams.value.id = row.id;
169 - proxy.$http.get('/api-web/inspectionExcelConfig/info', {id:row.id},res => { 171 + proxy.$http.get('/api-web/inspectionExcelConfig/info', {id: row.id}, res => {
170 configArr.value = [res.object] 172 configArr.value = [res.object]
171 }); 173 });
172 } 174 }
@@ -177,7 +179,7 @@ export default { @@ -177,7 +179,7 @@ export default {
177 */ 179 */
178 const deleteByIds = (row) => { 180 const deleteByIds = (row) => {
179 let id = ids; 181 let id = ids;
180 - if(multiple.value){ 182 + if (multiple.value) {
181 id = [row.id]; 183 id = [row.id];
182 } 184 }
183 185
@@ -187,7 +189,7 @@ export default { @@ -187,7 +189,7 @@ export default {
187 } 189 }
188 190
189 global.confirm("确认删除吗?", function () { 191 global.confirm("确认删除吗?", function () {
190 - proxy.$http.get('/api-web/inspectionExcelConfig/delete?idList=' + id.join(','), {},(res) => { 192 + proxy.$http.get('/api-web/inspectionExcelConfig/delete?idList=' + id.join(','), {}, (res) => {
191 if (res.success) { 193 if (res.success) {
192 global.showMsg("删除成功", "success"); 194 global.showMsg("删除成功", "success");
193 closeDialog() 195 closeDialog()
@@ -201,7 +203,7 @@ export default { @@ -201,7 +203,7 @@ export default {
201 203
202 204
203 const typeChange = (val) => { 205 const typeChange = (val) => {
204 - if(typeof val === 'object'){ 206 + if (typeof val === 'object') {
205 let typeInfo = typeArr.find(e => e.value == val.type); 207 let typeInfo = typeArr.find(e => e.value == val.type);
206 val.number = typeInfo.number 208 val.number = typeInfo.number
207 val.times = typeInfo.times 209 val.times = typeInfo.times
@@ -250,7 +252,7 @@ export default { @@ -250,7 +252,7 @@ export default {
250 } 252 }
251 formRef.value.resetFields(); 253 formRef.value.resetFields();
252 formParams.value = { 254 formParams.value = {
253 - id:-1 255 + id: -1
254 } 256 }
255 }) 257 })
256 } 258 }
@@ -261,7 +263,7 @@ export default { @@ -261,7 +263,7 @@ export default {
261 263
262 const getTypeLabel = (row) => { 264 const getTypeLabel = (row) => {
263 let typeInfo = typeArr.find(e => e.value == row.type); 265 let typeInfo = typeArr.find(e => e.value == row.type);
264 - if(typeInfo){ 266 + if (typeInfo) {
265 return typeInfo.label; 267 return typeInfo.label;
266 } 268 }
267 return ''; 269 return '';