|
@@ -18,6 +18,7 @@
|
|
|
import stockLook from "./components/stockLook.vue";
|
|
|
import SettingConfig from "../saleOrder/components/settingConfig.vue";
|
|
|
import { add } from '@/benyun/utils/accuracy'
|
|
|
+ import {getSingleData} from "@/api/omsOrder";
|
|
|
@Component({ components: { SettingConfig } })
|
|
|
export default class Outbound extends Vue {
|
|
|
// 左边
|
|
@@ -1126,41 +1127,72 @@
|
|
|
};
|
|
|
billConfig.tool.tools = { return: true, save: true, smt: true };
|
|
|
// 查销售订单数据
|
|
|
- api.single({ id: e.purchaseOrderId }, 'supplyPurchaseOrder').then((val : any) => {
|
|
|
- if (val.code === 200) {
|
|
|
- parentData.suborderList.map((v : any, i : any) => {
|
|
|
- v.outNumber = val.data.suborderList[i].outNumber;
|
|
|
- });
|
|
|
- let data : any = parentData.suborderList;
|
|
|
- let array : any = [];
|
|
|
- data.map((v : any) => {
|
|
|
- v.deliveryNumber = v.number - v.outNumber;
|
|
|
- if (v.deliveryNumber < v.number) v.number = v.deliveryNumber;
|
|
|
- v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
|
|
|
- array.push({
|
|
|
- storidId: v.storingLocationId,
|
|
|
- skuid: v.materialSku,
|
|
|
- })
|
|
|
- });
|
|
|
- // 查库存
|
|
|
- api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- let newData : any = [];
|
|
|
- res.data.map((v : any, i : any) => {
|
|
|
- newData.push(Object.assign(data[i], v))
|
|
|
+ if(e.purchaseOrderId){
|
|
|
+ api.single({ id: e.purchaseOrderId }, 'supplyPurchaseOrder').then((val : any) => {
|
|
|
+ if (val.code === 200) {
|
|
|
+ parentData.suborderList.map((v : any, i : any) => {
|
|
|
+ v.outNumber = val.data.suborderList[i].outNumber;
|
|
|
+ });
|
|
|
+ let data : any = parentData.suborderList;
|
|
|
+ let array : any = [];
|
|
|
+ data.map((v : any) => {
|
|
|
+ v.deliveryNumber = v.number - v.outNumber;
|
|
|
+ if (v.deliveryNumber < v.number) v.number = v.deliveryNumber;
|
|
|
+ v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
|
|
|
+ array.push({
|
|
|
+ storidId: v.storingLocationId,
|
|
|
+ skuid: v.materialSku,
|
|
|
})
|
|
|
- this.tableData = newData;
|
|
|
- (this.$refs.bill as any).setBillConfig(billConfig);
|
|
|
- (this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
|
|
|
- (this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
|
|
|
- this.isAdd = false;
|
|
|
- this.dataId = '';
|
|
|
- (this.$refs.bill as any).showTab = 'bill';
|
|
|
- loading.close();
|
|
|
- } else loading.close();
|
|
|
- }).catch(() => loading.close());
|
|
|
- } else loading.close();
|
|
|
- }).catch(() => loading.close());
|
|
|
+ });
|
|
|
+ // 查库存
|
|
|
+ api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ let newData : any = [];
|
|
|
+ res.data.map((v : any, i : any) => {
|
|
|
+ newData.push(Object.assign(data[i], v))
|
|
|
+ })
|
|
|
+ this.tableData = newData;
|
|
|
+ (this.$refs.bill as any).setBillConfig(billConfig);
|
|
|
+ (this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
|
|
|
+ (this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
|
|
|
+ this.isAdd = false;
|
|
|
+ this.dataId = '';
|
|
|
+ (this.$refs.bill as any).showTab = 'bill';
|
|
|
+ loading.close();
|
|
|
+ } else loading.close();
|
|
|
+ }).catch(() => loading.close());
|
|
|
+ } else loading.close();
|
|
|
+ }).catch(() => loading.close());
|
|
|
+ }else{
|
|
|
+ let data : any = parentData.suborderList;
|
|
|
+ let array : any = [];
|
|
|
+ data.map((v : any) => {
|
|
|
+ v.deliveryNumber = v.number;
|
|
|
+ // if (v.deliveryNumber < v.number) v.number = v.deliveryNumber;
|
|
|
+ v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
|
|
|
+ array.push({
|
|
|
+ storidId: v.storingLocationId,
|
|
|
+ skuid: v.materialSku,
|
|
|
+ })
|
|
|
+ });
|
|
|
+ // 查库存
|
|
|
+ api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ let newData : any = [];
|
|
|
+ res.data.map((v : any, i : any) => {
|
|
|
+ newData.push(Object.assign(data[i], v))
|
|
|
+ })
|
|
|
+ this.tableData = newData;
|
|
|
+ (this.$refs.bill as any).setBillConfig(billConfig);
|
|
|
+ (this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
|
|
|
+ (this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
|
|
|
+ this.isAdd = false;
|
|
|
+ this.dataId = '';
|
|
|
+ (this.$refs.bill as any).showTab = 'bill';
|
|
|
+ loading.close();
|
|
|
+ } else loading.close();
|
|
|
+ }).catch(() => loading.close());
|
|
|
+ }
|
|
|
} else {
|
|
|
loading.close();
|
|
|
this.setReadonly(parentData);
|