|
@@ -1,6 +1,7 @@
|
|
|
<script>
|
|
|
import orderApi from "@/api/business/purchase/purchase-order";
|
|
|
import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
|
|
|
+import { async } from "q";
|
|
|
import { Columns, TabColumns } from "./column";
|
|
|
|
|
|
const NewColumns = initColumns(Columns);
|
|
@@ -292,20 +293,66 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 主表参照改变之后
|
|
|
+ handleReferChange(val, source, type){
|
|
|
+ // 供应商选择
|
|
|
+ if( type === 'SUPPLIER_PARAM' ){
|
|
|
+
|
|
|
+ let page = { pageNum: 1 , pageSize: 10 };
|
|
|
+
|
|
|
+ let relevanceRefer = [
|
|
|
+ {
|
|
|
+ // 供应商联系人
|
|
|
+ key:'supplierContacts',
|
|
|
+ params:{
|
|
|
+ type:'SUPPLIERCONTACTS_PARAM',
|
|
|
+ supplierId:val.supplier,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // 供应商业务员
|
|
|
+ key:'supplierPersonal',
|
|
|
+ params:{
|
|
|
+ type:'PSNLICENSE_PARAM',
|
|
|
+ supplierId:val.supplier,
|
|
|
+ pkOrg: source.puOrg,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ relevanceRefer.forEach(async (refer) =>{
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ const { code, rows} = await orderApi.REFER(
|
|
|
+ {
|
|
|
+ ...refer.params,
|
|
|
+ search: "",
|
|
|
+ isPage: true,
|
|
|
+ }, page );
|
|
|
+
|
|
|
+ if (code === 200) {
|
|
|
+
|
|
|
+ source[refer.key] = rows[0]? rows[0].id :'';
|
|
|
+
|
|
|
+ source[`${refer.key}Name`] = rows[0] ? rows[0].name :'';
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (error) {}
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
// 子表参照改变之后
|
|
|
- handleReferChange(val, source, type) {
|
|
|
- console.log(val, "val");
|
|
|
- console.log(source, "source");
|
|
|
- console.log(type, "type");
|
|
|
+ handleTabReferChange(val, source, type) {
|
|
|
|
|
|
// 触发物料参照询价
|
|
|
if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
|
|
|
this.handleGetPrice();
|
|
|
}
|
|
|
|
|
|
- // if(type == "MATERIAL_PARAM"){
|
|
|
- // source.isDrug = val.materialMedcine.isDrug == '0' ? 'Y' : 'N';
|
|
|
- // }
|
|
|
},
|
|
|
|
|
|
// 子表下拉框改变
|
|
@@ -430,6 +477,7 @@ export default {
|
|
|
:placeholder="column.placeholder"
|
|
|
:data-mapping="column.dataMapping"
|
|
|
:query-params="column.queryParams"
|
|
|
+ @change="handleReferChange"
|
|
|
></dr-popover-select>
|
|
|
|
|
|
<el-input
|
|
@@ -575,7 +623,7 @@ export default {
|
|
|
:placeholder="cColumn.placeholder"
|
|
|
:data-mapping="cColumn.dataMapping"
|
|
|
:query-params="cColumn.queryParams"
|
|
|
- @change="handleReferChange"
|
|
|
+ @change="handleTabReferChange"
|
|
|
size="mini"
|
|
|
>
|
|
|
</dr-popover-select>
|