|
@@ -108,74 +108,84 @@ export default {
|
|
|
return null
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- isShow: this.formOptions.workerId.isShow,
|
|
|
- name: 'el-select',
|
|
|
- options: this.workerList.filter(item => this.orderInfo.workerId == item.value || !~this.orderInfo.orderWorkers.map(item => item.workerId).indexOf(item.value)),
|
|
|
- md: 8,
|
|
|
- attributes: {
|
|
|
- disabled: !this.formOptions.workerId.isEdit,
|
|
|
- placeholder: '请选择',
|
|
|
- clearable: true,
|
|
|
- filterable: true
|
|
|
- },
|
|
|
- formItemAttributes: {
|
|
|
- label: '主要工程师',
|
|
|
- prop: 'workerId',
|
|
|
- rules: this.formOptions.workerId.isRules,
|
|
|
- },
|
|
|
- events: {
|
|
|
- change: (val) => {
|
|
|
- var index = this.orderInfo.orderWorkers.map(item => item.isMaster).indexOf(true)
|
|
|
- if (!!~index) {
|
|
|
- this.orderInfo.orderWorkers.splice(index, 1)
|
|
|
- }
|
|
|
- if (val) {
|
|
|
- var data = this.workerList.find(item => item.value == val).data
|
|
|
- this.orderInfo.workerName = data.workerName
|
|
|
- this.orderInfo.workerIdcard = data.workerIdcard
|
|
|
- this.orderInfo.workerMobile = data.workerMobile
|
|
|
- this.orderInfo.orderWorkers.unshift({ ...data, isMaster: true })
|
|
|
- if (this.orderInfo.orderWorkers.length > 1) {
|
|
|
- this.orderInfo.orderWorkers.map((item, index) => {
|
|
|
- if (index > 0) {
|
|
|
- item.isMaster = false
|
|
|
+ ...(() => {
|
|
|
+ if (this.formOptions.workerId.isEdit) {
|
|
|
+ return [{
|
|
|
+ isShow: this.formOptions.workerId.isShow,
|
|
|
+ name: 'el-select',
|
|
|
+ options: this.workerList.filter(item => this.orderInfo.workerId == item.value || !~this.orderInfo.orderWorkers.map(item => item.workerId).indexOf(item.value)),
|
|
|
+ md: 8,
|
|
|
+ attributes: {
|
|
|
+ disabled: !this.formOptions.workerId.isEdit,
|
|
|
+ placeholder: '请选择',
|
|
|
+ clearable: true,
|
|
|
+ filterable: true
|
|
|
+ },
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '主要工程师',
|
|
|
+ prop: 'workerId',
|
|
|
+ rules: this.formOptions.workerId.isRules,
|
|
|
+ },
|
|
|
+ events: {
|
|
|
+ change: (val) => {
|
|
|
+ var index = this.orderInfo.orderWorkers.map(item => item.isMaster).indexOf(true)
|
|
|
+ if (!!~index) {
|
|
|
+ this.orderInfo.orderWorkers.splice(index, 1)
|
|
|
+ }
|
|
|
+ if (val) {
|
|
|
+ var data = this.workerList.find(item => item.value == val).data
|
|
|
+ this.orderInfo.workerName = data.workerName
|
|
|
+ this.orderInfo.workerIdcard = data.workerIdcard
|
|
|
+ this.orderInfo.workerMobile = data.workerMobile
|
|
|
+ this.orderInfo.orderWorkers.unshift({ ...data, isMaster: true })
|
|
|
+ if (this.orderInfo.orderWorkers.length > 1) {
|
|
|
+ this.orderInfo.orderWorkers.map((item, index) => {
|
|
|
+ if (index > 0) {
|
|
|
+ item.isMaster = false
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ this.orderInfo.workerName = ""
|
|
|
+ this.orderInfo.workerIdcard = ""
|
|
|
+ this.orderInfo.workerMobile = ""
|
|
|
+ }
|
|
|
}
|
|
|
- } else {
|
|
|
- this.orderInfo.workerName = ""
|
|
|
- this.orderInfo.workerIdcard = ""
|
|
|
- this.orderInfo.workerMobile = ""
|
|
|
}
|
|
|
- }
|
|
|
+ }]
|
|
|
}
|
|
|
- },
|
|
|
- {
|
|
|
- isShow: this.formOptions.orderWorkers.isEdit,
|
|
|
- name: 'el-select',
|
|
|
- options: this.workerList.filter(item => !~this.orderInfo.orderWorkers.map(item => item.workerId).indexOf(item.value)),
|
|
|
- md: 8,
|
|
|
- attributes: {
|
|
|
- disabled: !this.formOptions.orderWorkers.isEdit,
|
|
|
- placeholder: '请选择',
|
|
|
- clearable: true,
|
|
|
- filterable: true
|
|
|
- },
|
|
|
- formItemAttributes: {
|
|
|
- label: '辅助工程师',
|
|
|
- prop: 'workerId_fz',
|
|
|
- },
|
|
|
- events: {
|
|
|
- change: (val) => {
|
|
|
- if (val) {
|
|
|
- var data = this.workerList.find(item => item.value == val).data
|
|
|
- this.orderInfo.orderWorkers.push({ ...data, isMaster: false })
|
|
|
- this.orderInfo.workerId_fz = ""
|
|
|
+ return []
|
|
|
+ })(),
|
|
|
+ ...(() => {
|
|
|
+ if (this.formOptions.orderWorkers.isEdit) {
|
|
|
+ return [{
|
|
|
+ isShow: this.formOptions.orderWorkers.isEdit,
|
|
|
+ name: 'el-select',
|
|
|
+ options: this.workerList.filter(item => !~this.orderInfo.orderWorkers.map(item => item.workerId).indexOf(item.value)),
|
|
|
+ md: 8,
|
|
|
+ attributes: {
|
|
|
+ disabled: !this.formOptions.orderWorkers.isEdit,
|
|
|
+ placeholder: '请选择',
|
|
|
+ clearable: true,
|
|
|
+ filterable: true
|
|
|
+ },
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '辅助工程师',
|
|
|
+ prop: 'workerId_fz',
|
|
|
+ },
|
|
|
+ events: {
|
|
|
+ change: (val) => {
|
|
|
+ if (val) {
|
|
|
+ var data = this.workerList.find(item => item.value == val).data
|
|
|
+ this.orderInfo.orderWorkers.push({ ...data, isMaster: false })
|
|
|
+ this.orderInfo.workerId_fz = ""
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ }]
|
|
|
}
|
|
|
- },
|
|
|
+ return []
|
|
|
+ })(),
|
|
|
{
|
|
|
isShow: this.formOptions.orderWorkers.isShow,
|
|
|
name: 'slot-component',
|