linwenxin 1 tahun lalu
induk
melakukan
26410ee1a6

+ 8 - 0
src/api/workOrderPool.js

@@ -46,6 +46,14 @@ export function changeOrderGetOrderProduct(params) {
   })
 }
 
+export function orderBaseLogAdd(data) {
+  return request({
+    url: `/order/base/log/add`,
+    method: 'post',
+    data
+  })
+}
+
 export function changeOrderChangeWorker(data) {
   return request({
     url: `/changeOrder/changeWorker`,

+ 106 - 27
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/buttons/processFeedback.vue

@@ -1,30 +1,33 @@
 <template>
   <div class="withinLine">
     <el-button type="primary" size="mini" @click="open">{{ resultCodeName }}</el-button>
-    <el-dialog title="过程反馈" :visible.sync="dialogVisible" :append-to-body="true" :before-close="handleClose"
-      :close-on-click-modal="false" width="750px">
-      <zj-page-container direction="row">
-        <zj-page-fill>
-          <div style="width: 100%; box-sizing: border-box; padding: 0 10px">
-            <zj-form v-if="dialogVisible" ref="formRef" :formData="form" :formItems="formItems" :formRules="formRules" />
-          </div>
-        </zj-page-fill>
-      </zj-page-container>
-      <span slot="footer" class="dialog-footer">
-        <el-button size="mini" @click="handleClose">取 消</el-button>
-        <el-button size="mini" type="primary" @click="sub">提交</el-button>
-      </span>
+    <el-dialog title="" width="750px" 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 v-if="formDialog" ref="formRef" :form-data="formData" :styleSwitch="false">
+        <zj-form-module :title="resultCodeName" label-width="140px" :showPackUp="false" :form-data="formData"
+          :form-items="formItems">
+        </zj-form-module>
+      </zj-form-container>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="formCancel">取 消</el-button>
+        <el-button size="mini" @click="formConfirm" type="primary">确 定</el-button>
+      </div>
     </el-dialog>
   </div>
 </template>
 
 <script>
 import buttonMixin from './button_mixin.js'
-import ClipboardJS from 'clipboard'
+import ImageUpload from '@/components/file-upload'
+import { required } from '@/components/template/rules_verify.js'
+import { orderBaseLogAdd } from "@/api/workOrderPool.js"
 export default {
   mixins: [buttonMixin],
+  components: {
+    ImageUpload
+  },
   props: {
-    resultCode_: {
+    resultCode: {
       type: String,
       default: ''
     },
@@ -35,9 +38,15 @@ export default {
   },
   data() {
     return {
-      dialogVisible: false,
-      form: {
-
+      type: this.resultCode ? [this.resultCode] : ['其他', '预约', '改约', '异常反馈', '完工反馈', '回访'],
+      formDialog: false,
+      formData: {
+        "orderBaseId": this.orderInfo.id,
+        "imgSrc": [],
+        "content": "",
+        "appointmentTime": "",
+        "type": this.resultCode,
+        "typeText": this.resultCode
       },
       formRules: {
 
@@ -50,24 +59,94 @@ export default {
       return JSON.parse(localStorage.getItem('greemall_user'))
     },
     formItems() {
-      return []
+      return [{
+        md: 24,
+        name: 'el-radio',
+        options: this.type.map(item => ({ label: item, value: item })),
+        attributes: {},
+        formItemAttributes: {
+          label: '反馈结果',
+          prop: 'type',
+          rules: [...required]
+        },
+        event: {
+          change: (val) => {
+            this.formData.typeText = this.formData.type
+          }
+        }
+      }, {
+        name: 'el-date-picker',
+        md: 12,
+        isShow: !!~['预约', '改约'].indexOf(this.formData.type),
+        attributes: {
+          style: { width: '100%' },
+          placeholder: '请选择',
+          'value-format': 'yyyy-MM-dd HH:mm:ss',
+        },
+        formItemAttributes: {
+          label: '预约日期',
+          prop: 'appointmentTime',
+          rules: [...required]
+        }
+      }, {
+        md: 24,
+        name: 'el-input',
+        attributes: { placeholder: '请输入', type: "textarea" },
+        formItemAttributes: {
+          label: '反馈内容',
+          prop: 'content',
+          rules: [...required]
+        }
+      }, {
+        md: 24,
+        name: 'slot-component',
+        formItemAttributes: {
+          label: '上传图片(最多6个)',
+          prop: 'imgSrc',
+          rules: []
+        },
+        render: (h, { props, onInput }) => {
+          return (
+            <ImageUpload fileList={this.formData.imgSrc} limit={6} />
+          )
+        }
+      }]
     }
   },
   methods: {
     open() {
-      this.dialogVisible = true
+      this.formDialog = true
+    },
+    formCancel() {
+      this.formDialog = false
+      this.formData = {
+        "orderBaseId": this.orderInfo.id,
+        "imgSrc": [],
+        "content": "",
+        "appointmentTime": "",
+        "type": this.resultCode,
+        "typeText": this.resultCode
+      }
     },
-    sub() {
+    formConfirm() {
       this.$refs.formRef.validate(valid => {
         if (valid) {
-
+          orderBaseLogAdd({
+            ...this.formData,
+            imgSrc: this.formData.imgSrc.map(item => item.url).join(",")
+          }).then(res => {
+            // 编辑保存后不跳转列表,刷新数据
+            this.acquireVerify(this, 'getorderDetail')()
+            // 刷新操作记录
+            this.acquireVerify(this, 'getOrderBaseLogList')()
+            this.$message({
+              type: 'success',
+              message: '反馈成功'
+            })
+            this.formCancel()
+          })
         }
       })
-    },
-    handleClose() {
-      this.dialogVisible = false
-      Object.assign(this.$data, this.$options.data())
-      this.form.resultCode = this.resultCode_
     }
   }
 }

+ 6 - 2
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/index.vue

@@ -36,6 +36,7 @@
         <!-- 1,保存  -->
         <commitSave v-if="~btnRestrict.indexOf(1)" :orderInfo="orderInfo" :orderType="orderType" />
         <!-- 2,过程反馈  -->
+        <processFeedback v-if="~btnRestrict.indexOf(2)" resultCodeName="过程反馈" :orderInfo="orderInfo" :orderType="orderType" />
         <!-- 3,设为异常  -->
         <abnormal v-if="~btnRestrict.indexOf(3)" :orderInfo="orderInfo" :orderType="orderType" />
         <!-- 4,加急  -->
@@ -44,6 +45,7 @@
         <unurgent v-if="~btnRestrict.indexOf(5)" :orderInfo="orderInfo" :orderType="orderType" />
         <!-- 6,取消工单  -->
         <!-- 7,回访  -->
+        <processFeedback v-if="~btnRestrict.indexOf(7)" resultCodeName="回访" resultCode="回访" :orderInfo="orderInfo" :orderType="orderType" />
         <!-- 8,新建工单 -->
       </div>
       <div style="box-sizing: border-box;padding: 10px 10px 0;" v-else>
@@ -70,6 +72,7 @@ import commitSave from './buttons/commitSave.vue'
 import urgent from './buttons/urgent.vue'
 import unurgent from './buttons/unurgent.vue'
 import abnormal from './buttons/abnormal.vue'
+import processFeedback from './buttons/processFeedback.vue'
 
 export default {
   components: {
@@ -78,7 +81,8 @@ export default {
     commitSave,
     urgent,
     unurgent,
-    abnormal
+    abnormal,
+    processFeedback
   },
   mixins: [
     workOrderLogic,
@@ -109,7 +113,7 @@ export default {
   box-sizing: border-box;
   padding-left: 16px;
 
-  ::v-deep & > .zj-page-fill-scroll {
+  ::v-deep &>.zj-page-fill-scroll {
     box-sizing: border-box;
     padding-right: 16px;