소스 검색

采购出库-仓库/货位添加默认值

jingbb 3 달 전
부모
커밋
be150d3713
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      src/views/inventiry/purchaseIn/components/purchaseInForm.vue

+ 8 - 1
src/views/inventiry/purchaseIn/components/purchaseInForm.vue

@@ -166,6 +166,8 @@
   import { Form, message } from 'ant-design-vue';
   import { useGlobSetting } from '/@/hooks/setting';
   import {  ApiSelect, } from '/@/components/Form/index';
+  import { initDictOptions } from '/@/utils/dict';
+
   import moment from 'moment';
   const useForm = Form.useForm;
   export default defineComponent({
@@ -259,11 +261,15 @@
 
       
 
-      function add() {
+      async function add() {
         resetFields();
         purInShipTable.dataSource = [];
         stockInTable.dataSource = [];
         activeKey.value = 'stockIn'
+        var warehouseArr=  await initDictOptions( 'warehouse');
+        var goodsAllocationArr=  await initDictOptions( 'goods_allocation');
+        formData.warehouse = warehouseArr[0].value
+        formData.goodsAllocation = goodsAllocationArr[0].value
       }
       async function edit(row) {
         //主表数据
@@ -373,6 +379,7 @@
           item.model = item.childModel
           item.sourceId = item.childId
           item.arrivalQuantity = item.quantity
+          item.stockInQuantity = item.quantity
         })
         var arr = data.concat(stockInTable.dataSource)
         stockInTable.dataSource=arr