|
@@ -124,12 +124,12 @@
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
:disabled="disable"
|
|
:disabled="disable"
|
|
clearable
|
|
clearable
|
|
- @focus="chooseOrganizations"
|
|
|
|
|
|
+ @focus="chooseRefer('ORG_PARAM', true, '选择所属组织')"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in organizationsOptions"
|
|
v-for="item in organizationsOptions"
|
|
:key="item.id"
|
|
:key="item.id"
|
|
- :label="item.label"
|
|
|
|
|
|
+ :label="item.name"
|
|
:value="item.id"
|
|
:value="item.id"
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
@@ -145,7 +145,7 @@
|
|
:disabled="disable"
|
|
:disabled="disable"
|
|
v-model="basicForm.orderPersonal"
|
|
v-model="basicForm.orderPersonal"
|
|
clearable
|
|
clearable
|
|
- @focus="chooseStaff"
|
|
|
|
|
|
+ @focus="chooseRefer('CONTACTS_PARAM', true, '订单员')"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in staffOptions"
|
|
v-for="item in staffOptions"
|
|
@@ -177,7 +177,7 @@
|
|
:disabled="disable"
|
|
:disabled="disable"
|
|
v-model="basicForm.buyer"
|
|
v-model="basicForm.buyer"
|
|
clearable
|
|
clearable
|
|
- @focus="chooseStaff2"
|
|
|
|
|
|
+ @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in staff2Options"
|
|
v-for="item in staff2Options"
|
|
@@ -249,17 +249,7 @@
|
|
:single="true"
|
|
:single="true"
|
|
/>
|
|
/>
|
|
|
|
|
|
- <orgs
|
|
|
|
- ref="orgs"
|
|
|
|
- @doSubmit="acceptOrgs"
|
|
|
|
- :single="true"
|
|
|
|
- />
|
|
|
|
-
|
|
|
|
- <staff
|
|
|
|
- ref="staff"
|
|
|
|
- @doSubmit="acceptStaff"
|
|
|
|
- :single="true"
|
|
|
|
- />
|
|
|
|
|
|
+ <Refers ref="refer" @doSubmit="selectionsRefer" :single="true"/>
|
|
|
|
|
|
<staff2
|
|
<staff2
|
|
ref="staff2"
|
|
ref="staff2"
|
|
@@ -278,8 +268,9 @@ import { getDetail } from '@/api/classify/basic';
|
|
// 物料编码
|
|
// 物料编码
|
|
import popDialog from '@/components/PopDialog/index.vue'
|
|
import popDialog from '@/components/PopDialog/index.vue'
|
|
// 公用一个树形(组织部门传值不同)
|
|
// 公用一个树形(组织部门传值不同)
|
|
-import orgs from '@/components/PopDialog/organization.vue'
|
|
|
|
-import staff from '@/components/PopDialog/staff.vue'
|
|
|
|
|
|
+import Refers from '@/components/Refers/refers.vue'
|
|
|
|
+// 用于回显参照框数据
|
|
|
|
+import { getRefer } from '@/api/purchase/basic.js'
|
|
import staff2 from '@/components/PopDialog/staff.vue'
|
|
import staff2 from '@/components/PopDialog/staff.vue'
|
|
// 所属组织,订单员用于回显
|
|
// 所属组织,订单员用于回显
|
|
import { getOrgs, getStaff} from '@/api/requisition/basic'
|
|
import { getOrgs, getStaff} from '@/api/requisition/basic'
|
|
@@ -288,8 +279,7 @@ export default {
|
|
components: {
|
|
components: {
|
|
fourClass,
|
|
fourClass,
|
|
popDialog,
|
|
popDialog,
|
|
- orgs,
|
|
|
|
- staff,
|
|
|
|
|
|
+ Refers,
|
|
staff2
|
|
staff2
|
|
},
|
|
},
|
|
props: ['pageStu','row', 'disable'],
|
|
props: ['pageStu','row', 'disable'],
|
|
@@ -327,6 +317,11 @@ export default {
|
|
options: [{
|
|
options: [{
|
|
value: 0, label: '仓库1'
|
|
value: 0, label: '仓库1'
|
|
}],
|
|
}],
|
|
|
|
+ referCondition: {
|
|
|
|
+ type: '',
|
|
|
|
+ isPage: true,
|
|
|
|
+ title: ''
|
|
|
|
+ },
|
|
organizationsOptions: [],
|
|
organizationsOptions: [],
|
|
staffOptions: [],
|
|
staffOptions: [],
|
|
staff2Options: [],
|
|
staff2Options: [],
|
|
@@ -362,7 +357,7 @@ export default {
|
|
this.$emit('jugislist', true)
|
|
this.$emit('jugislist', true)
|
|
let queryParams = {
|
|
let queryParams = {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
- pageSize: 10
|
|
|
|
|
|
+ pageSize: 5
|
|
}
|
|
}
|
|
this.$emit('refresh', queryParams)
|
|
this.$emit('refresh', queryParams)
|
|
},
|
|
},
|
|
@@ -371,9 +366,12 @@ export default {
|
|
getDivisions(row.id).then(res => {
|
|
getDivisions(row.id).then(res => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.basicForm = res.data
|
|
this.basicForm = res.data
|
|
- this.getOrgDetails(res.data.org)
|
|
|
|
- this.getStaffDetails(res.data.orderPersonal)
|
|
|
|
- this.getStaffDetails2(res.data.buyer)
|
|
|
|
|
|
+ if (this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
|
|
|
|
+ if (this.basicForm.orderPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.orderPersonal, '订单员') }
|
|
|
|
+ if (this.basicForm.buyer) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.buyer, '采购员') }
|
|
|
|
+ // this.getOrgDetails(res.data.org)
|
|
|
|
+ // this.getStaffDetails(res.data.orderPersonal)
|
|
|
|
+ // this.getStaffDetails2(res.data.buyer)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -412,45 +410,64 @@ export default {
|
|
this.$refs.contractSelect.init()
|
|
this.$refs.contractSelect.init()
|
|
},
|
|
},
|
|
// 选择默认采购组织
|
|
// 选择默认采购组织
|
|
- acceptOrgs (selections) {
|
|
|
|
- console.log('接收的采购组织', selections)
|
|
|
|
- this.basicForm.org = selections.id
|
|
|
|
- this.getOrgDetails(selections.id)
|
|
|
|
|
|
+ chooseRefer(type, isPage, title) {
|
|
|
|
+ this.referCondition.type = type
|
|
|
|
+ this.referCondition.isPage = isPage
|
|
|
|
+ this.referCondition.title = title
|
|
|
|
+ this.$refs.refer.init(this.referCondition)
|
|
},
|
|
},
|
|
- // 默认采购组织显示列表
|
|
|
|
- chooseOrganizations () {
|
|
|
|
- this.$refs.organizations.blur()
|
|
|
|
- this.$refs.orgs.init('1')
|
|
|
|
|
|
+ selectionsRefer(selection) {
|
|
|
|
+ if (this.referCondition.title == '选择所属组织') {
|
|
|
|
+ this.organizationsOptions = selection
|
|
|
|
+ this.basicForm.org = selection[0].id
|
|
|
|
+ this.basicForm.orgName = selection[0].name
|
|
|
|
+ }
|
|
|
|
+ if (this.referCondition.title == '订单员') {
|
|
|
|
+ this.staffOptions = selection
|
|
|
|
+ this.basicForm.orderPersonal = selection[0].code
|
|
|
|
+ this.basicForm.orderPersonalName = selection[0].name
|
|
|
|
+ }
|
|
|
|
+ if (this.referCondition.title == '采购员') {
|
|
|
|
+ this.staff2Options = selection
|
|
|
|
+ this.basicForm.buyer = selection[0].code
|
|
|
|
+ this.basicForm.buyerName = selection[0].name
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- // 采购组织回显
|
|
|
|
- getOrgDetails(id) {
|
|
|
|
- getOrgs({deptId: id}).then(res => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- this.organizationsOptions = res.data
|
|
|
|
|
|
+ // 回显参照框
|
|
|
|
+ reBackRefer(type, id, title) {
|
|
|
|
+ getRefer({ type: type, id: id }).then(res => {
|
|
|
|
+ if (type == 'ORG_PARAM') {
|
|
|
|
+ this.organizationsOptions = res.rows
|
|
}
|
|
}
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 选择订单员
|
|
|
|
- acceptStaff (selections) {
|
|
|
|
- this.staffOptions = selections
|
|
|
|
- this.basicForm.orderPersonal = selections[0].code
|
|
|
|
- this.basicForm.orderPersonalName = selections[0].name
|
|
|
|
- this.getStaffDetails(selections[0].id)
|
|
|
|
- },
|
|
|
|
- // 订单员显示列表
|
|
|
|
- chooseStaff () {
|
|
|
|
- this.$refs.staffs.blur()
|
|
|
|
- this.$refs.staff.init()
|
|
|
|
- },
|
|
|
|
- // 订单员回显
|
|
|
|
- getStaffDetails(id) {
|
|
|
|
- getStaff({id:id}).then(res => {
|
|
|
|
- console.log('订单员', res)
|
|
|
|
- if (res.code === 200 ) {
|
|
|
|
- this.staffOptions = res.data.tableBody
|
|
|
|
|
|
+ if (type == 'CONTACTS_PARAM' && title == '订单员') {
|
|
|
|
+ this.staffOptions = res.rows
|
|
|
|
+ }
|
|
|
|
+ if (type == 'CONTACTS_PARAM' && title == '采购员') {
|
|
|
|
+ this.staff2Options = res.rows
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 选择订单员
|
|
|
|
+ // acceptStaff (selections) {
|
|
|
|
+ // this.staffOptions = selections
|
|
|
|
+ // this.basicForm.orderPersonal = selections[0].code
|
|
|
|
+ // this.basicForm.orderPersonalName = selections[0].name
|
|
|
|
+ // this.getStaffDetails(selections[0].id)
|
|
|
|
+ // },
|
|
|
|
+ // // 订单员显示列表
|
|
|
|
+ // chooseStaff () {
|
|
|
|
+ // this.$refs.staffs.blur()
|
|
|
|
+ // this.$refs.staff.init()
|
|
|
|
+ // },
|
|
|
|
+ // // 订单员回显
|
|
|
|
+ // getStaffDetails(id) {
|
|
|
|
+ // getStaff({id:id}).then(res => {
|
|
|
|
+ // console.log('订单员', res)
|
|
|
|
+ // if (res.code === 200 ) {
|
|
|
|
+ // this.staffOptions = res.data.tableBody
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
// 选择采购员
|
|
// 选择采购员
|
|
acceptStaff2 (selections) {
|
|
acceptStaff2 (selections) {
|
|
this.staff2Options = selections
|
|
this.staff2Options = selections
|