|
@@ -1,7 +1,7 @@
|
|
|
-import { getWebsit } from "@/api/customerManagement.js"
|
|
|
-import { memberListPageV2 } from "@/api/masterManagement";
|
|
|
+import { getWebsit } from '@/api/customerManagement.js'
|
|
|
+import { memberListPageV2 } from '@/api/masterManagement'
|
|
|
import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
|
|
|
-import { listPageV2 } from "@/api/workOrder/orderType";
|
|
|
+import { listPageV2 } from '@/api/workOrder/orderType'
|
|
|
import ImageUpload from '@/components/file-upload'
|
|
|
export default {
|
|
|
data() {
|
|
@@ -20,34 +20,46 @@ export default {
|
|
|
prop: 'workerId'
|
|
|
},
|
|
|
render: (h, { row, column, index }) => {
|
|
|
- return <div class="redbordererr">
|
|
|
- <el-form-item label="" label-width="0px" prop={`punishOrderWorkers.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
- <zj-select
|
|
|
- value={row[column.columnAttributes.prop]}
|
|
|
- onInput={(val) => { row[column.columnAttributes.prop] = val }}
|
|
|
- onChange={(val) => {
|
|
|
- if (val) {
|
|
|
- var data = this.workerList.find(item => item.value == val)
|
|
|
- row.workerMobile = data?.data?.workerMobile || ""
|
|
|
- row.workerName = data?.label || val
|
|
|
- } else {
|
|
|
- row.workerName = ""
|
|
|
- row.workerMobile = ""
|
|
|
- }
|
|
|
- this.$nextTick(() => {
|
|
|
- this.itemjiaoyanqita(index)
|
|
|
- })
|
|
|
- }}
|
|
|
- placeholder="请选择"
|
|
|
- blurNoMatchText={true}
|
|
|
- disabled={this.formData.status == "OK"}
|
|
|
- clearable={true}
|
|
|
- filterable={true}
|
|
|
- blurNoMatchInputBorderColor="">
|
|
|
- {this.workerList.map((item, index_) => <zj-option key={index_} label={item.label} value={item.value}></zj-option>)}
|
|
|
- </zj-select>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
+ return (
|
|
|
+ <div class="redbordererr">
|
|
|
+ <el-form-item
|
|
|
+ label=""
|
|
|
+ label-width="0px"
|
|
|
+ prop={`punishOrderWorkers.${index}.${column.columnAttributes.prop}`}
|
|
|
+ rules={required}
|
|
|
+ >
|
|
|
+ <zj-select
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={val => {
|
|
|
+ row[column.columnAttributes.prop] = val
|
|
|
+ }}
|
|
|
+ onChange={val => {
|
|
|
+ if (val) {
|
|
|
+ var data = this.workerList.find(item => item.value == val)
|
|
|
+ row.workerMobile = data?.data?.workerMobile || ''
|
|
|
+ row.workerName = data?.label || val
|
|
|
+ } else {
|
|
|
+ row.workerName = ''
|
|
|
+ row.workerMobile = ''
|
|
|
+ }
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.itemjiaoyanqita(index)
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ placeholder="请选择"
|
|
|
+ blurNoMatchText={true}
|
|
|
+ disabled={this.formData.status == 'OK'}
|
|
|
+ clearable={true}
|
|
|
+ filterable={true}
|
|
|
+ blurNoMatchInputBorderColor=""
|
|
|
+ >
|
|
|
+ {this.workerList.map((item, index_) => (
|
|
|
+ <zj-option key={index_} label={item.label} value={item.value}></zj-option>
|
|
|
+ ))}
|
|
|
+ </zj-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -56,22 +68,28 @@ export default {
|
|
|
prop: 'workerMobile'
|
|
|
},
|
|
|
render: (h, { row, column, index }) => {
|
|
|
- return <div class="redbordererr">
|
|
|
- <el-form-item label="" label-width="0px" prop={`punishOrderWorkers.${index}.${column.columnAttributes.prop}`} rules={mobileRequired}>
|
|
|
- <el-input
|
|
|
- value={row[column.columnAttributes.prop]}
|
|
|
- onInput={(val) => {
|
|
|
- row[column.columnAttributes.prop] = val
|
|
|
- this.$nextTick(() => {
|
|
|
- this.itemjiaoyanqita(index)
|
|
|
- })
|
|
|
- }}
|
|
|
- placeholder="请输入内容"
|
|
|
- disabled={this.formData.status == "OK"}
|
|
|
+ return (
|
|
|
+ <div class="redbordererr">
|
|
|
+ <el-form-item
|
|
|
+ label=""
|
|
|
+ label-width="0px"
|
|
|
+ prop={`punishOrderWorkers.${index}.${column.columnAttributes.prop}`}
|
|
|
+ rules={mobileRequired}
|
|
|
>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
+ <el-input
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={val => {
|
|
|
+ row[column.columnAttributes.prop] = val
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.itemjiaoyanqita(index)
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ placeholder="请输入内容"
|
|
|
+ disabled={this.formData.status == 'OK'}
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -80,27 +98,33 @@ export default {
|
|
|
prop: 'amount'
|
|
|
},
|
|
|
render: (h, { row, column, index }) => {
|
|
|
- return <div class="redbordererr">
|
|
|
- <el-form-item label="" label-width="0px" prop={`punishOrderWorkers.${index}.${column.columnAttributes.prop}`} rules={required}>
|
|
|
- <el-input
|
|
|
- value={row[column.columnAttributes.prop]}
|
|
|
- onInput={(val) => {
|
|
|
- row[column.columnAttributes.prop] = val
|
|
|
- this.$nextTick(() => {
|
|
|
- this.itemjiaoyanqita(index)
|
|
|
- })
|
|
|
- }}
|
|
|
- placeholder="请输入内容"
|
|
|
- disabled={this.formData.status == "OK"}
|
|
|
- type="number"
|
|
|
+ return (
|
|
|
+ <div class="redbordererr">
|
|
|
+ <el-form-item
|
|
|
+ label=""
|
|
|
+ label-width="0px"
|
|
|
+ prop={`punishOrderWorkers.${index}.${column.columnAttributes.prop}`}
|
|
|
+ rules={required}
|
|
|
>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
+ <el-input
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={val => {
|
|
|
+ row[column.columnAttributes.prop] = val
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.itemjiaoyanqita(index)
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ placeholder="请输入内容"
|
|
|
+ disabled={this.formData.status == 'OK'}
|
|
|
+ type="number"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
}
|
|
|
},
|
|
|
...(() => {
|
|
|
- if (this.formData.status != "OK") {
|
|
|
+ if (this.formData.status != 'OK') {
|
|
|
return [
|
|
|
{
|
|
|
columnAttributes: {
|
|
@@ -108,13 +132,20 @@ export default {
|
|
|
width: 100
|
|
|
},
|
|
|
render: (h, { row, column, index }) => {
|
|
|
- return <div style="padding-left:10px">
|
|
|
- <el-button type="text" onClick={() => {
|
|
|
- this.formData.punishOrderWorkers.splice(index, 1)
|
|
|
- }}>删除</el-button>
|
|
|
- </div>
|
|
|
+ return (
|
|
|
+ <div style="padding-left:10px">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ onClick={() => {
|
|
|
+ this.formData.punishOrderWorkers.splice(index, 1)
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
]
|
|
|
}
|
|
|
return []
|
|
@@ -128,12 +159,12 @@ export default {
|
|
|
md: 6,
|
|
|
attributes: {
|
|
|
placeholder: '请输入',
|
|
|
- disabled: this.formData.status == "OK"
|
|
|
+ disabled: this.formData.status == 'OK'
|
|
|
},
|
|
|
formItemAttributes: {
|
|
|
label: '负激励工单号',
|
|
|
prop: 'orderBaseId',
|
|
|
- rules: [...required],
|
|
|
+ rules: [...required]
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -144,15 +175,15 @@ export default {
|
|
|
placeholder: '请选择',
|
|
|
clearable: true,
|
|
|
filterable: true,
|
|
|
- disabled: this.formData.status == "OK"
|
|
|
+ disabled: this.formData.status == 'OK'
|
|
|
},
|
|
|
formItemAttributes: {
|
|
|
label: '工单类型',
|
|
|
prop: 'orderSmallType',
|
|
|
- rules: [...required],
|
|
|
+ rules: [...required]
|
|
|
},
|
|
|
events: {
|
|
|
- change: (val) => {
|
|
|
+ change: val => {
|
|
|
if (val) {
|
|
|
this.formData.orderSmallTypeText = this.orderSmallTypeData.find(item => item.value == val).label
|
|
|
} else {
|
|
@@ -169,15 +200,15 @@ export default {
|
|
|
placeholder: '请选择',
|
|
|
clearable: true,
|
|
|
filterable: true,
|
|
|
- disabled: this.formData.status == "OK"
|
|
|
+ disabled: this.formData.status == 'OK'
|
|
|
},
|
|
|
formItemAttributes: {
|
|
|
label: '网点名称',
|
|
|
prop: 'websitId',
|
|
|
- rules: [...required],
|
|
|
+ rules: [...required]
|
|
|
},
|
|
|
events: {
|
|
|
- change: (val) => {
|
|
|
+ change: val => {
|
|
|
this.formData.punishOrderWorkers = []
|
|
|
this.getWorkers()
|
|
|
if (val) {
|
|
@@ -194,25 +225,30 @@ export default {
|
|
|
formItemAttributes: {
|
|
|
label: '负激励工程师',
|
|
|
prop: 'punishOrderWorkers',
|
|
|
- rules: [...required],
|
|
|
+ rules: [...required]
|
|
|
},
|
|
|
render: (h, { props }) => {
|
|
|
var { formData } = props
|
|
|
return (
|
|
|
<div>
|
|
|
- {
|
|
|
- this.formData.status != "OK" ?
|
|
|
- <div>
|
|
|
- <el-button size="mini" type="primary" onClick={() => {
|
|
|
+ {this.formData.status != 'OK' ? (
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
this.formData.punishOrderWorkers.unshift({
|
|
|
- "amount": "",
|
|
|
- "workerId": "",
|
|
|
- "workerMobile": "",
|
|
|
- "workerName": ""
|
|
|
+ amount: '',
|
|
|
+ workerId: '',
|
|
|
+ workerMobile: '',
|
|
|
+ workerName: ''
|
|
|
})
|
|
|
- }}>新增</el-button>
|
|
|
- </div> : null
|
|
|
- }
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 新增
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ ) : null}
|
|
|
<zj-table
|
|
|
isDrop={true}
|
|
|
columns={this.workersColumns}
|
|
@@ -228,7 +264,7 @@ export default {
|
|
|
formItemAttributes: { label: '处罚备注', prop: 'remark' },
|
|
|
attributes: {
|
|
|
placeholder: '处罚备注',
|
|
|
- disabled: this.formData.status == "OK"
|
|
|
+ disabled: this.formData.status == 'OK'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -243,24 +279,31 @@ export default {
|
|
|
render: (h, { props, onInput }) => {
|
|
|
var { value } = props
|
|
|
return (
|
|
|
- <ImageUpload fileList={this.formData.fileUrls} uid="imgSrc677766_materials_drawing_images" limit={100} isEdit={this.formData.status != "OK"} />
|
|
|
+ <ImageUpload
|
|
|
+ fileList={this.formData.fileUrls}
|
|
|
+ uid="imgSrc677766_materials_drawing_images"
|
|
|
+ limit={100}
|
|
|
+ isEdit={this.formData.status != 'OK'}
|
|
|
+ />
|
|
|
)
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
getorderSmallTypeData() {
|
|
|
- listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "true" }] }).then(res => {
|
|
|
- this.orderSmallTypeData = res.data.records.map(item => ({
|
|
|
- value: item.id,
|
|
|
- label: item.orderSmallTypeText
|
|
|
- }))
|
|
|
- })
|
|
|
+ listPageV2({ pageNum: 1, pageSize: -1, params: [{ param: 'a.status', compare: '=', value: 'true' }] }).then(
|
|
|
+ res => {
|
|
|
+ this.orderSmallTypeData = res.data.records.map(item => ({
|
|
|
+ value: item.id,
|
|
|
+ label: item.orderSmallTypeText
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ )
|
|
|
},
|
|
|
getWebsitList() {
|
|
|
- getWebsit({ type: "C", status: true, isAll: true }).then(res => {
|
|
|
+ getWebsit({ type: 'C', status: true }).then(res => {
|
|
|
this.websitList = res.data.map(item => ({
|
|
|
label: item.name,
|
|
|
value: item.websitId,
|
|
@@ -270,7 +313,14 @@ export default {
|
|
|
},
|
|
|
getWorkers() {
|
|
|
if (this.formData.websitId) {
|
|
|
- memberListPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "b.examine_status", "compare": "=", "value": "OK" }, { "param": "b.websit_id", "compare": "=", "value": this.formData.websitId }] }).then(res => {
|
|
|
+ memberListPageV2({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: -1,
|
|
|
+ params: [
|
|
|
+ { param: 'b.examine_status', compare: '=', value: 'OK' },
|
|
|
+ { param: 'b.websit_id', compare: '=', value: this.formData.websitId }
|
|
|
+ ]
|
|
|
+ }).then(res => {
|
|
|
this.workerList = res.data.records.map(item => {
|
|
|
var { id, userId, ...data } = item
|
|
|
return {
|
|
@@ -291,11 +341,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
itemjiaoyanqita(index) {
|
|
|
- this.$refs.formRef.validateField([
|
|
|
- `punishOrderWorkers.${index}.workerId`,
|
|
|
- `punishOrderWorkers.${index}.workerMobile`,
|
|
|
- `punishOrderWorkers.${index}.amount`,
|
|
|
- ], (valid, invalidFields, errLabels) => { })
|
|
|
- },
|
|
|
- },
|
|
|
+ this.$refs.formRef.validateField(
|
|
|
+ [
|
|
|
+ `punishOrderWorkers.${index}.workerId`,
|
|
|
+ `punishOrderWorkers.${index}.workerMobile`,
|
|
|
+ `punishOrderWorkers.${index}.amount`
|
|
|
+ ],
|
|
|
+ (valid, invalidFields, errLabels) => {}
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|