|
@@ -1,30 +1,33 @@
|
|
<template>
|
|
<template>
|
|
<div class="withinLine">
|
|
<div class="withinLine">
|
|
<el-button type="primary" size="mini" @click="open">{{ resultCodeName }}</el-button>
|
|
<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>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import buttonMixin from './button_mixin.js'
|
|
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 {
|
|
export default {
|
|
mixins: [buttonMixin],
|
|
mixins: [buttonMixin],
|
|
|
|
+ components: {
|
|
|
|
+ ImageUpload
|
|
|
|
+ },
|
|
props: {
|
|
props: {
|
|
- resultCode_: {
|
|
|
|
|
|
+ resultCode: {
|
|
type: String,
|
|
type: String,
|
|
default: ''
|
|
default: ''
|
|
},
|
|
},
|
|
@@ -35,9 +38,15 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
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: {
|
|
formRules: {
|
|
|
|
|
|
@@ -50,24 +59,94 @@ export default {
|
|
return JSON.parse(localStorage.getItem('greemall_user'))
|
|
return JSON.parse(localStorage.getItem('greemall_user'))
|
|
},
|
|
},
|
|
formItems() {
|
|
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: {
|
|
methods: {
|
|
open() {
|
|
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 => {
|
|
this.$refs.formRef.validate(valid => {
|
|
if (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_
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|