|
@@ -1,21 +1,22 @@
|
|
|
export default function useWatch() {
|
|
|
- const watchPuOrg = () => ({
|
|
|
+ const watchPuOrgName = () => ({
|
|
|
handler: function (newProp, oldProp) {
|
|
|
if (oldProp) {
|
|
|
this.params.priceApplyOrgs = this.params.priceApplyOrgs.filter(
|
|
|
- (item) => item.org !== oldProp
|
|
|
+ (item) => item.orgName !== oldProp
|
|
|
);
|
|
|
}
|
|
|
if (newProp) {
|
|
|
- const { puOrg: org, puOrgName: orgName } = this.params;
|
|
|
+ const { puOrgCode: orgCode, puOrgName: orgName } = this.params;
|
|
|
this.params.priceApplyOrgs.push({
|
|
|
- org,
|
|
|
+ orgCode,
|
|
|
orgName,
|
|
|
createByName: undefined,
|
|
|
updateByName: undefined,
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ deep: true,
|
|
|
});
|
|
|
const watchPriceApplyOrgs = () => ({
|
|
|
handler: function (newValue) {
|
|
@@ -33,5 +34,5 @@ export default function useWatch() {
|
|
|
},
|
|
|
deep: true,
|
|
|
});
|
|
|
- return { watchPuOrg, watchPriceApplyOrgs, watchPriceApplyItems };
|
|
|
+ return { watchPuOrgName, watchPriceApplyOrgs, watchPriceApplyItems };
|
|
|
}
|