|
@@ -24,7 +24,7 @@
|
|
|
<zj-page-fill>
|
|
|
<div style="box-sizing: border-box; padding: 20px 20px 0 20px">
|
|
|
<zj-form-container ref="formRef" :form-data="formData" :form-attributes="{ size: 'mini' }">
|
|
|
- <zj-form-module title="单据信息" label-width="100px" :form-data="formData" :form-items="formItems">
|
|
|
+ <zj-form-module title="师傅组" label-width="100px" :form-data="formData" :form-items="formItems">
|
|
|
</zj-form-module>
|
|
|
</zj-form-container>
|
|
|
</div>
|
|
@@ -52,6 +52,8 @@ import {
|
|
|
workerTeamQueryWebsitWorker
|
|
|
} from '@/api/masterGroup.js'
|
|
|
import { commonTemplateDownload } from '@/api/common.js'
|
|
|
+import { getWebsit } from '@/api/customerManagement.js'
|
|
|
+import { required, requiredValueMin } from '@/components/template/rules_verify.js'
|
|
|
export default {
|
|
|
components: { TemplatePage },
|
|
|
mixins: [import_mixin, operation_mixin],
|
|
@@ -81,7 +83,9 @@ export default {
|
|
|
masterWorkerName: '',
|
|
|
status: '',
|
|
|
websitId: ''
|
|
|
- }
|
|
|
+ },
|
|
|
+ websitList: [],
|
|
|
+ workerTeamQueryWebsitWorkerList: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -130,7 +134,103 @@ export default {
|
|
|
return []
|
|
|
},
|
|
|
formItems() {
|
|
|
- return []
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ name: 'el-select',
|
|
|
+ md: 12,
|
|
|
+ options: this.websitList.map(item => ({ label: item.name, value: item.websitId })),
|
|
|
+ attributes: {
|
|
|
+ clearable: true,
|
|
|
+ filterable: true,
|
|
|
+ disabled: false,
|
|
|
+ placeholder: '请输入'
|
|
|
+ },
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '所属网点',
|
|
|
+ prop: 'websitId',
|
|
|
+ rules: [...required]
|
|
|
+ },
|
|
|
+ events: {
|
|
|
+ change: val => {
|
|
|
+ this.formData.masterWorkerId = ''
|
|
|
+ this.formData.masterWorkerName = ''
|
|
|
+ this.formData.assistantWorkerId = ''
|
|
|
+ this.formData.assistantWorkerName = ''
|
|
|
+ this.workerTeamQueryWebsitWorkerList = []
|
|
|
+ if (val) {
|
|
|
+ workerTeamQueryWebsitWorker({ websitId: val }).then(res => {
|
|
|
+ this.workerTeamQueryWebsitWorkerList = res.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'el-select',
|
|
|
+ md: 12,
|
|
|
+ options: this.workerTeamQueryWebsitWorkerList
|
|
|
+ .filter(item => item.workerId != this.formData.assistantWorkerId)
|
|
|
+ .map(item => ({ label: item.workerName, value: item.workerId })),
|
|
|
+ attributes: {
|
|
|
+ clearable: true,
|
|
|
+ filterable: true,
|
|
|
+ placeholder: '请输入',
|
|
|
+ disabled: !this.formData.websitId
|
|
|
+ },
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '选择大工',
|
|
|
+ prop: 'masterWorkerId',
|
|
|
+ rules: [...required]
|
|
|
+ },
|
|
|
+ events: {
|
|
|
+ change: val => {
|
|
|
+ this.formData.masterWorkerName = this.workerTeamQueryWebsitWorkerList?.find(
|
|
|
+ item => item.workerId === val
|
|
|
+ )?.workerName
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'el-select',
|
|
|
+ md: 12,
|
|
|
+ options: this.workerTeamQueryWebsitWorkerList
|
|
|
+ .filter(item => item.workerId != this.formData.masterWorkerId)
|
|
|
+ .map(item => ({ label: item.workerName, value: item.workerId })),
|
|
|
+ attributes: {
|
|
|
+ clearable: true,
|
|
|
+ filterable: true,
|
|
|
+ placeholder: '请输入',
|
|
|
+ disabled: !this.formData.masterWorkerId
|
|
|
+ },
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '选择小工',
|
|
|
+ prop: 'assistantWorkerId',
|
|
|
+ rules: [...required]
|
|
|
+ },
|
|
|
+ events: {
|
|
|
+ change: val => {
|
|
|
+ this.formData.assistantWorkerName = this.workerTeamQueryWebsitWorkerList?.find(
|
|
|
+ item => item.workerId === val
|
|
|
+ )?.workerName
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ md: 12,
|
|
|
+ isShow: true,
|
|
|
+ name: 'el-radio',
|
|
|
+ options: [
|
|
|
+ { label: '有效', value: 'ON' },
|
|
|
+ { label: '无效', value: 'OFF' }
|
|
|
+ ],
|
|
|
+ attributes: {},
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '状态',
|
|
|
+ prop: 'status',
|
|
|
+ rules: [...required]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -148,12 +248,19 @@ export default {
|
|
|
},
|
|
|
// 打开创建弹窗
|
|
|
openForm() {
|
|
|
- this.formDialog = true
|
|
|
+ Promise.all([getWebsit({ type: 'C', status: true })]).then(([res1]) => {
|
|
|
+ this.websitList = res1.data
|
|
|
+ this.formDialog = true
|
|
|
+ })
|
|
|
},
|
|
|
// 打开详情弹窗
|
|
|
openDetailForm(row) {
|
|
|
- this.formData = { ...row }
|
|
|
- this.formDialog = true
|
|
|
+ Promise.all([getWebsit({ type: 'C', status: true })]).then(([res1]) => {
|
|
|
+ this.websitList = res1.data
|
|
|
+ this.formData = { ...row }
|
|
|
+ this.formDialog = true
|
|
|
+ })
|
|
|
+ // workerTeamQueryWebsitWorker
|
|
|
},
|
|
|
handleClose() {
|
|
|
this.$refs?.formRef?.resetFields()
|