|
|
@@ -186,6 +186,19 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
|
|
|
+ <el-form-item label="采购部门" prop="purchaseDeptId">
|
|
|
+ <ele-tree-select
|
|
|
+ clearable
|
|
|
+ :data="groupTreeData"
|
|
|
+ v-model="form.purchaseDeptId"
|
|
|
+ valueKey="id"
|
|
|
+ labelKey="name"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="changePurchaseDep"
|
|
|
+ default-expand-all
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item prop="orderFiles" label="附件">
|
|
|
<fileMain v-model="form.orderFiles"></fileMain>
|
|
|
</el-form-item>
|
|
|
@@ -231,6 +244,14 @@
|
|
|
:init="false"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="采购员" prop="purchaseUserId">
|
|
|
+ <personSelect
|
|
|
+ ref="purchaseDirectorRef"
|
|
|
+ v-model="form.purchaseUserId"
|
|
|
+ @selfChange="purchaseUserChange"
|
|
|
+ :init="false"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<headerTitle title="基本信息"></headerTitle>
|
|
|
@@ -697,7 +718,11 @@
|
|
|
purchasePlanId: '',
|
|
|
purchasePlanNo: '',
|
|
|
purchasePlanName: '',
|
|
|
- isFirstProcess: 0
|
|
|
+ isFirstProcess: 0,
|
|
|
+ purchaseDeptId: '',
|
|
|
+ purchaseDeptName: '',
|
|
|
+ purchaseUserId: '',
|
|
|
+ purchaseUserName: ''
|
|
|
};
|
|
|
|
|
|
return {
|
|
|
@@ -878,7 +903,7 @@
|
|
|
|
|
|
//退货单
|
|
|
async changeReturn(row) {
|
|
|
- console.log('data~~~', row);
|
|
|
+ // console.log('data~~~', row);
|
|
|
// this.form = Object.assign({}, this.form, {
|
|
|
// relationCode: row.returnNo,
|
|
|
// relationId: row.id
|
|
|
@@ -1105,6 +1130,21 @@
|
|
|
|
|
|
this.getrequireUser(id);
|
|
|
},
|
|
|
+ // 选择采购部门
|
|
|
+ changePurchaseDep(id) {
|
|
|
+ const info = this.groupData.find((e) => e.id == id);
|
|
|
+ this.form.purchaseDeptName = info.name;
|
|
|
+ this.$set(this.form, 'purchaseUserId', '');
|
|
|
+ this.$set(this.form, 'purchaseUserName', '');
|
|
|
+ this.getPurchaseUser(id);
|
|
|
+ },
|
|
|
+
|
|
|
+ getPurchaseUser(groupId) {
|
|
|
+ console.log('groupId~~~~', groupId);
|
|
|
+ if (groupId) {
|
|
|
+ this.$refs.purchaseDirectorRef.getList({ groupId });
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
//选择采购需求
|
|
|
handPurchaseNeed() {
|
|
|
@@ -1331,6 +1371,11 @@
|
|
|
this.$set(this.form, 'requireUserName', info.name);
|
|
|
// this.form.requireUserName = info.name;
|
|
|
},
|
|
|
+
|
|
|
+ purchaseUserChange(val, info) {
|
|
|
+ this.$set(this.form, 'purchaseUserId', val);
|
|
|
+ this.$set(this.form, 'purchaseUserName', info.name);
|
|
|
+ },
|
|
|
// 获取公司数据
|
|
|
getGroupAll() {
|
|
|
listOrganizations().then((list) => {
|
|
|
@@ -1379,12 +1424,18 @@
|
|
|
data.contractVO?.requireDeptName
|
|
|
);
|
|
|
this.$set(this.form, 'requireUserId', data.contractVO?.requireUserId);
|
|
|
+ // this.$set(this.form, 'businessDeptId', data.contractVO?.businessDeptId);
|
|
|
+ // this.$set(this.form, 'businessDeptName', data.contractVO?.businessDeptName);
|
|
|
+ // this.$set(this.form, 'businessUserId', data.contractVO?.businessUserId);
|
|
|
+ // this.$set(this.form, 'businessUserName', data.contractVO?.businessUserName);
|
|
|
this.$set(
|
|
|
this.form,
|
|
|
'requireUserName',
|
|
|
data.contractVO?.requireUserName
|
|
|
);
|
|
|
+ console.log('data.contractVO~~~~', data.contractVO);
|
|
|
this.getrequireUser(data.contractVO?.requireDeptId);
|
|
|
+ this.getPurchaseUser(data.contractVO?.businessDeptId);
|
|
|
this.$nextTick(() => {
|
|
|
let { contractVO } = data;
|
|
|
// this.form=contractVOform.receiveAddress
|
|
|
@@ -1414,7 +1465,11 @@
|
|
|
pricingWay,
|
|
|
isFirstProcess,
|
|
|
requireSourceType,
|
|
|
- requireSourceTypeName
|
|
|
+ requireSourceTypeName,
|
|
|
+ businessDeptId,
|
|
|
+ businessDeptName,
|
|
|
+ businessUserId,
|
|
|
+ businessUserName,
|
|
|
} = contractVO;
|
|
|
this.form = Object.assign({}, this.form, {
|
|
|
partaAddress,
|
|
|
@@ -1445,7 +1500,11 @@
|
|
|
receiveAddress: partaAddress,
|
|
|
isFirstProcess,
|
|
|
sourceType: requireSourceType || '1',
|
|
|
- sourceTypeName: requireSourceTypeName
|
|
|
+ sourceTypeName: requireSourceTypeName,
|
|
|
+ purchaseDeptId: businessDeptId,
|
|
|
+ purchaseDeptName: businessDeptName,
|
|
|
+ purchaseUserId: businessUserId,
|
|
|
+ purchaseUserName: businessUserName
|
|
|
});
|
|
|
this.getLinkInfo(partaId);
|
|
|
// info.productList = info.productList.map((item) => {
|
|
|
@@ -1491,8 +1550,8 @@
|
|
|
this.loading = true;
|
|
|
const data = await getpurchaseorderDetail(id);
|
|
|
this.loading = false;
|
|
|
- this.form = data;
|
|
|
-
|
|
|
+ this.form = data;
|
|
|
+ console.log('data~~~~~~~', data);
|
|
|
if (data) {
|
|
|
this.$nextTick(() => {
|
|
|
this.$store.commit('order/setAllcountAmount', data.totalAmount);
|
|
|
@@ -1504,6 +1563,9 @@
|
|
|
this.$refs.outputDetailListRef.putTableValue(data.outputList); //产成品
|
|
|
this.getLinkInfo(data.partaId);
|
|
|
this.getrequireUser(this.form.requireDeptId);
|
|
|
+ if(data.purchaseDeptId) {
|
|
|
+ this.getPurchaseUser(data.purchaseDeptId);
|
|
|
+ }
|
|
|
this.$store.commit('order/setContractId', data.contractId);
|
|
|
});
|
|
|
}
|
|
|
@@ -1746,6 +1808,10 @@
|
|
|
this.enterprisePage[0]?.unifiedSocialCreditCode;
|
|
|
this.form.partaFax = this.enterprisePage[0]?.fax;
|
|
|
this.form.partaAddress = this.enterprisePage[0]?.address;
|
|
|
+ this.form.purchaseDeptId = this.enterprisePage[0]?.groupId || '';
|
|
|
+ this.form.purchaseDeptName = this.enterprisePage[0]?.name || '';
|
|
|
+ this.form.purchaseUserId = this.$store.state.user.info?.id || '';
|
|
|
+ this.form.purchaseUserName = this.$store.state.user.info?.name || '';
|
|
|
}
|
|
|
} else {
|
|
|
this.isUpdate = true;
|