Bläddra i källkod

工单类型对接

pengyh 1 år sedan
förälder
incheckning
3de497c578
1 ändrade filer med 61 tillägg och 211 borttagningar
  1. 61 211
      src/views/workOrder/basicConfiguration/orderType/index.vue

+ 61 - 211
src/views/workOrder/basicConfiguration/orderType/index.vue

@@ -2,7 +2,7 @@
 	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="80"
 	  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
 	  :operation="operation" :exportList="exportList">
-	  <el-dialog title="" width="1200px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
+	  <el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog"
 	    :show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
 	    <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
 	      <zj-form-module :title="formDialogTitles[formDialogType]" label-width="100px" :showPackUp="false"
@@ -56,24 +56,11 @@ export default {
       formDialog: false,
       formData: {
 		companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
-		venderName: '',
-		linkName: '',
-		linkTel: '',
-		address: '',
-		zipNo: '',
-		email: '',
-		www: '',
-		telNo: '',
-		corporation: '',
-		faxNo: '',
-		licenseId: '',
-		khBank: '',
-		bankRow: '',
-		accNo: '',
-		remark: '',
-		status: 'ON',
-		venderType: 'M',
-		imageUrl: []
+		orderSmallTypeText: '',
+		orderType: '',
+		status: true,
+		sortNum: '',
+		imgUrl: []
       }
     }
   },
@@ -84,7 +71,7 @@ export default {
     },
     formItems() {
       return [{
-        md: 12,
+        md: 24,
         isShow: true,
         name: 'el-input',
         attributes: { placeholder: '请输入', disabled: true },
@@ -94,182 +81,53 @@ export default {
           rules: [...required]
         },
       }, {
-        md: 12,
+        md: 24,
         isShow: true,
-        name: 'slot-component',
-        attributes: { },
+        name: 'el-select',
+		options: [{label: '安装',value: 'INSTALL'},{label: '维修',value: 'REPAIR'}],
+        attributes: { placeholder: '请选择' },
         formItemAttributes: {
-          label: '状态',
-          prop: 'status',
+          label: '所属业务线',
+          prop: 'orderType',
           rules: [...required]
         },
-		render: (h, { props, onInput }) => {
-			var { value } = props
-			return (
-				<el-radio-group v-model={this.formData.status}>
-				    <el-radio disabled={this.formDialogType==2} label="ON">启用</el-radio>
-				    <el-radio disabled={this.formDialogType==2} label="OFF">禁用</el-radio>
-				</el-radio-group>
-			)
-		}
       }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入供应商名称', },
-        formItemAttributes: {
-          label: '供应商名称',
-          prop: 'venderName',
-          rules: [...required]
-        }
-      }, {
-        md: 6,
+        md: 24,
         isShow: true,
         name: 'el-input',
-        attributes: { placeholder: '请输入联系人' },
+        attributes: { placeholder: '请输入工单类型', },
         formItemAttributes: {
-          label: '联系人',
-          prop: 'linkName',
+          label: '工单类型',
+          prop: 'orderSmallTypeText',
           rules: [...required]
         }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入联系电话', maxlength: 11 },
-        formItemAttributes: {
-          label: '联系电话',
-          prop: 'linkTel',
-          rules: [...required,...mobile]
-        }
-      }, {
-        md: 12,
+      },{
+        md: 24,
         isShow: true,
         name: 'slot-component',
         attributes: { },
         formItemAttributes: {
-          label: '供应类型',
-          prop: 'venderType',
+          label: '状态',
+          prop: 'status',
           rules: [...required]
         },
 		render: (h, { props, onInput }) => {
 			var { value } = props
 			return (
-				<el-radio-group v-model={this.formData.venderType}>
-				    <el-radio disabled={this.formDialogType==2} label="M">辅材</el-radio>
-				    <el-radio disabled={this.formDialogType==2} label="P">配件</el-radio>
-					<el-radio disabled={this.formDialogType==2} label="A">辅材和配件</el-radio>
+				<el-radio-group v-model={this.formData.status}>
+				    <el-radio disabled={this.formDialogType==2} label={true}>启用</el-radio>
+				    <el-radio disabled={this.formDialogType==2} label={false}>禁用</el-radio>
 				</el-radio-group>
 			)
 		}
       }, {
-        md: 12,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入地址' },
-        formItemAttributes: {
-          label: '地址',
-          prop: 'address',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入邮编' },
-        formItemAttributes: {
-          label: '邮编',
-          prop: 'zipNo',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入网址' },
-        formItemAttributes: {
-          label: '网址',
-          prop: 'www',
-          rules: [...httpUrl]
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入电子邮箱' },
-        formItemAttributes: {
-          label: '电子邮箱',
-          prop: 'email',
-          rules: [...email]
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入固定电话' },
-        formItemAttributes: {
-          label: '固定电话',
-          prop: 'telNo',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入传真' },
-        formItemAttributes: {
-          label: '传真',
-          prop: 'faxNo',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入法人名称' },
-        formItemAttributes: {
-          label: '法人',
-          prop: 'corporation',
-          rules: []
-        }
-      }, {
-        md: 6,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入营业执照号' },
-        formItemAttributes: {
-          label: '营业执照号',
-          prop: 'licenseId',
-          rules: []
-        }
-      }, {
-        md: 8,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入开户银行' },
-        formItemAttributes: {
-          label: '开户银行',
-          prop: 'khBank',
-          rules: []
-        }
-      }, {
-        md: 8,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入开户行号' },
-        formItemAttributes: {
-          label: '开户行号',
-          prop: 'bankRow',
-          rules: []
-        }
-      }, {
-        md: 8,
+        md: 24,
         isShow: true,
         name: 'el-input',
-        attributes: { placeholder: '请输入银行账号' },
+        attributes: { placeholder: '排序数字越小越靠前', type: 'number' },
         formItemAttributes: {
-          label: '银行账号',
-          prop: 'accNo',
+          label: '排序',
+          prop: 'sortNum',
           rules: []
         }
       }, {
@@ -277,51 +135,34 @@ export default {
 		isShow: true,
 		name: 'slot-component',
 		formItemAttributes: {
-			label: '营业执照',
-			prop: 'imageUrl',
-			rules: []
+			label: '上传图片',
+			prop: 'imgUrl',
+			rules: [...required]
 		},
 		render: (h, { props, onInput }) => {
 			var { value } = props
 			return (
-				<ImageUpload fileList={this.formData.imageUrl} limit={1} isEdit={this.formDialogType !== 2} />
+				<div>
+					<ImageUpload fileList={this.formData.imgUrl} fileType={['image']} limit={1} isEdit={this.formDialogType !== 2} />
+					<div style="color: #EA8000">上传后在小程序首页自助服务展示</div>
+				</div>
 			)
 		}
-	}, {
-        md: 24,
-        isShow: true,
-        name: 'el-input',
-        attributes: { placeholder: '请输入备注内容',type: "textarea", rows: 5 },
-        formItemAttributes: {
-          label: '备注',
-          prop: 'remark',
-          rules: []
-        }
-      }]
+	}]
     }
   },
   methods: {
     // 列表请求函数
-	getList(p) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    if (this.examineStatus) {
-	      pam.params.push({ "param": "b.examine_status", "compare": "=", "value": this.examineStatus })
-	    }
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
-	},
+	getList: listPageV2,
     // 列表导出函数
     exportList: pageExport,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
-		if (item.jname === 'idCardImg') {
+		if (item.jname === 'imgUrl') {
 		        defaultData.render = (h, { row, index, column }) => {
 		          return (
 		            <div style="padding:0 6px;cursor: pointer;">
-		              {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+		              {row.imgUrl ? row.imgUrl.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="cover" style="width:80px;height:80px;" />) : null}
 		            </div>
 		          )
 		        }
@@ -336,25 +177,34 @@ export default {
     operation(h, { row, index, column }) {
       return (
         <div class='operation-btns'>
-          <el-button type="text" onClick={() => {
-            getDetail({ id: row.venderId }).then(res => {
-              Object.assign(this.formData, res.data,{
-				  imageUrl:res.data?.imageUrl ? res.data?.imageUrl?.split(",").map(item=>({url:item})) : []
-			  })
-              this.formDialogType = 2
-              this.openForm()
-            })
-          }}>查看</el-button>
 		  <el-button type="text" onClick={() => {
-		    getDetail({ id: row.venderId }).then(res => {
+		    getDetail({ id: row.id }).then(res => {
 		      Object.assign(this.formData, res.data,{
-				  imageUrl:res.data?.imageUrl?  res.data?.imageUrl?.split(",").map(item=>({url:item})) : []
+				  imgUrl:res.data?.imgUrl?  res.data?.imgUrl?.split(",").map(item=>({url:item})) : []
 			  })
 			   console.log(this.formData)
 		      this.formDialogType = 1
 		      this.openForm()
 		    })
 		  }}>编辑</el-button>
+		  <el-button type="text" onClick={() => {
+			this.$confirm('请确认是否删除该数据, 是否继续?', '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				del({
+					id: row.id
+				}).then(res => {
+					if (res.code == 200) {
+						this.$message({ type: 'success', message: '删除成功!' })
+						this.$refs.pageRef.refreshList()
+					} else {
+						this.$message.error(res.msg);
+					}
+				})
+			});
+		  }}>删除</el-button>
         </div>
       )
     },
@@ -373,9 +223,9 @@ export default {
     formConfirm() {
       this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
         if (valid) {
-          ([add, edit][this.formDialogType])({
+          (save)({
 			  ...this.formData,
-			  imageUrl:this.formData.imageUrl.map(item=>item.url).join(",")
+			  imgUrl:this.formData.imgUrl.map(item=>item.url).join(",")
 		  }).then(res => {
             this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
             this.formCancel()