Kaynağa Gözat

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002201 2 yıl önce
ebeveyn
işleme
8091927faf
28 değiştirilmiş dosya ile 289 ekleme ve 181 silme
  1. 1 0
      src/api/business/purchase/purchase-order.js
  2. 1 1
      src/api/purchase/purchaseDemand.js
  3. 1 1
      src/api/purchase/transferOrder.js
  4. 6 6
      src/components/popover-select/components/ALLOCATION_PARAM.js
  5. 6 6
      src/components/popover-select/components/BALATYPE_PARAM.js
  6. 6 6
      src/components/popover-select/components/CUSTOMERDEPT_PARAM.js
  7. 6 6
      src/components/popover-select/components/CUSTOMER_PARAM.js
  8. 6 6
      src/components/popover-select/components/OPERATING_PARAM.js
  9. 6 6
      src/components/popover-select/components/PROJECT_PARAM.js
  10. 6 6
      src/components/popover-select/components/RETREASON_PARAM.js
  11. 16 10
      src/components/popover-select/components/SUPPLIERCONTACTS_PARAM.js
  12. 6 6
      src/components/popover-select/components/TAX_RATE_PARAM.js
  13. 6 6
      src/components/popover-select/components/UNIT_PARAM.js
  14. 6 6
      src/components/popover-select/components/WAREHOUSE_PARAM.js
  15. 18 3
      src/components/popover-select/index.vue
  16. 1 1
      src/utils/init/index.js
  17. 1 1
      src/utils/request.js
  18. 7 1
      src/views/material/basicFile/details.vue
  19. 7 37
      src/views/purchase/DemandSummary/index.vue
  20. 34 8
      src/views/purchase/PurchaseDemandList/add.vue
  21. 1 1
      src/views/purchase/PurchaseDemandList/index.vue
  22. 56 14
      src/views/purchase/purchase-order/add/column.js
  23. 35 19
      src/views/purchase/purchase-order/add/index.vue
  24. 5 1
      src/views/purchase/purchase-order/column.js
  25. 30 11
      src/views/purchase/purchase-order/edit/index.vue
  26. 6 7
      src/views/purchase/purchase-order/index.vue
  27. 8 4
      src/views/purchase/transferOrder/add.vue
  28. 1 1
      src/views/purchase/transferOrder/index.vue

+ 1 - 0
src/api/business/purchase/purchase-order.js

@@ -11,6 +11,7 @@ const list = (data, page) => {
   });
 }
 
+
 // 采购订单详情
 const details = (id, params) => {
   return request({

+ 1 - 1
src/api/purchase/purchaseDemand.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 采购需求单列表
 export function getDemandList(data) {
   return request({
-    url: `/pu/demand/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
+    url: `/pu/demand/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}&isAsc=desc&orderByColumn=updateTime`,
     method: 'post',
     data: data
   })

+ 1 - 1
src/api/purchase/transferOrder.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 调拨订单列表
 export function getOrderList(data) {
   return request({
-    url: `/pu/allot/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
+    url: `/pu/allot/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}&isAsc=desc&orderByColumn=updateTime`,
     method: 'post',
     data: data
   })

+ 6 - 6
src/components/popover-select/components/ALLOCATION_PARAM.js

@@ -1,12 +1,12 @@
 // 货位
 export default [
   // 树
-  {
-    key: "id",
-    title: "ID",
-    type: "Input",
-    search: true,
-  },
+  // {
+  //   key: "id",
+  //   title: "ID",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
     key: "code",
     title: "编码",

+ 6 - 6
src/components/popover-select/components/BALATYPE_PARAM.js

@@ -1,11 +1,11 @@
 // 结算方式
 export default [
-  {
-    key: "id",
-    title: "结算方式ID",
-    type: "Input",
-    search: true,
-  },
+  // {
+  //   key: "id",
+  //   title: "结算方式ID",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
     key: "code",
     title: "编码",

+ 6 - 6
src/components/popover-select/components/CUSTOMERDEPT_PARAM.js

@@ -1,11 +1,11 @@
 // 客户部门
 export default [
-  {
-    key: "id",
-    title: "客户部门ID",
-    type: "Input",
-    search: true,
-  },
+  // {
+  //   key: "id",
+  //   title: "客户部门ID",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
     key: "code",
     title: "客户部门编码",

+ 6 - 6
src/components/popover-select/components/CUSTOMER_PARAM.js

@@ -1,11 +1,11 @@
 // 收货客户
 export default [
-  {
-    key: "id",
-    title: "收货客户ID",
-    type: "Input",
-    search: true,
-  },
+  // {
+  //   key: "id",
+  //   title: "收货客户ID",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
     key: "code",
     title: "收货客户编码",

+ 6 - 6
src/components/popover-select/components/OPERATING_PARAM.js

@@ -1,11 +1,11 @@
 // 经营性项目
 export default [
-  {
-    key: "id",
-    title: "经营性项目ID",
-    type: "Input",
-    search: true,
-  },
+  // {
+  //   key: "id",
+  //   title: "经营性项目ID",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
     key: "code",
     title: "经营性项目编码",

+ 6 - 6
src/components/popover-select/components/PROJECT_PARAM.js

@@ -1,11 +1,11 @@
 // 在建工程项目
 export default [
-  {
-    key: "id",
-    title: "在建工程项目ID",
-    type: "Input",
-    search: true,
-  },
+  // {
+  //   key: "id",
+  //   title: "在建工程项目ID",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
     key: "code",
     title: "在建工程项目编码",

+ 6 - 6
src/components/popover-select/components/RETREASON_PARAM.js

@@ -1,11 +1,11 @@
 // 退换原因
 export default [
-  {
-    key: "id",
-    title: "退换原因ID",
-    type: "Input",
-    search: true,
-  },
+  // {
+  //   key: "id",
+  //   title: "退换原因ID",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
     key: "code",
     title: "退换原因编码",

+ 16 - 10
src/components/popover-select/components/SUPPLIERCONTACTS_PARAM.js

@@ -1,20 +1,26 @@
 // 供应商联系人
 export default [
+  // {
+  //   key: "id",
+  //   title: "ID",
+  //   type: "Input",
+  //   search: true,
+  // },
+  // {
+  //   key: "code",
+  //   title: "编码",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
-    key: "id",
-    title: "ID",
-    type: "Input",
-    search: true,
-  },
-  {
-    key: "code",
-    title: "编码",
+    key: "name",
+    title: "名称",
     type: "Input",
     search: true,
   },
   {
-    key: "name",
-    title: "供应商联系人名称",
+    key: "cell",
+    title: "电话",
     type: "Input",
     search: true,
   },

+ 6 - 6
src/components/popover-select/components/TAX_RATE_PARAM.js

@@ -1,10 +1,10 @@
 export default [
-  {
-    key: "id",
-    title: "ID",
-    type: "Input",
-    search: true,
-  },
+  // {
+  //   key: "id",
+  //   title: "ID",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
     key: "code",
     title: "编码",

+ 6 - 6
src/components/popover-select/components/UNIT_PARAM.js

@@ -1,12 +1,12 @@
 // 货位
 export default [
   // 树
-  {
-    key: "id",
-    title: "ID",
-    type: "Input",
-    search: true,
-  },
+  // {
+  //   key: "id",
+  //   title: "ID",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
     key: "code",
     title: "编码",

+ 6 - 6
src/components/popover-select/components/WAREHOUSE_PARAM.js

@@ -1,11 +1,11 @@
 // 收货仓库
 export default [
-  {
-    key: "id",
-    title: "仓库ID",
-    type: "Input",
-    search: true,
-  },
+  // {
+  //   key: "id",
+  //   title: "仓库ID",
+  //   type: "Input",
+  //   search: true,
+  // },
   {
     key: "code",
     title: "仓库编码",

+ 18 - 3
src/components/popover-select/index.vue

@@ -97,9 +97,18 @@ export default {
     };
   },
   computed: {
-    innerValue() {
-      const { value, multiple } = this.$props;
-      return multiple ? "" : value;
+    // innerValue() {
+    //   const { value, multiple } = this.$props;
+    //   return multiple ? "" : value;
+    // },
+    innerValue:{
+      get(){
+        const { value, multiple } = this.$props;
+        return multiple ? "" : value;
+      },
+      set(val){
+        this.$emit("input", val);
+      }
     },
     TableColumnTemp() {
       const { type } = this.$props;
@@ -222,6 +231,11 @@ export default {
         this.selectData = prop;
       }
     },
+    handleClear(){
+      if(!this.$props.multiple){
+        this.innerValue = '';
+      }
+    }
   },
   created() {},
   mounted() {},
@@ -237,6 +251,7 @@ export default {
       :readonly="readonly"
       :clearable="clearable"
       :placeholder="placeholder"
+      @clear="handleClear"
     >
       <el-button
         :disabled="disabled"

+ 1 - 1
src/utils/init/index.js

@@ -33,4 +33,4 @@ export const initRules = (prop) => {
   return rules;
 };
 
-export const initPage = () => ({ pageNum: 1, pageSize: 10, total: 0,isAsc:"desc" });
+export const initPage = () => ({ pageNum: 1, pageSize: 10, total: 0, });

+ 1 - 1
src/utils/request.js

@@ -28,7 +28,7 @@ service.interceptors.request.use(
     // 是否需要防止数据重复提交
     const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
     // 是否存在列表查询
-    const isQueryList = config.url.includes("/list");
+    const isQueryList = config.url.includes("/list") || config.url.includes("/query");
     if (getToken() && !isToken) {
       config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
     }

+ 7 - 1
src/views/material/basicFile/details.vue

@@ -1728,7 +1728,7 @@
           default:
             break;
         }
-        this.handleOtherRefresh();
+        // this.handleOtherRefresh();
       },
       // 其他页签详情弹窗关闭事件
       handleCloseOtherDetails(done) {
@@ -1979,6 +1979,7 @@
         materialApi.financeEdit(data).then(res => {
           if (res.code == 200) {
             this.otherDeatils.isEdit = false;
+            this.handleOtherRefresh();
           }
         })
       },
@@ -1988,6 +1989,7 @@
         materialApi.centerEdit(data).then(res => {
           if (res.code == 200) {
             this.otherDeatils.isEdit = false;
+            this.handleOtherRefresh();
           }
         })
       },
@@ -1997,6 +1999,7 @@
         materialApi.purchaseEdit(data).then(res => {
           if (res.code == 200) {
             this.otherDeatils.isEdit = false;
+            this.handleOtherRefresh();
           }
         })
       },
@@ -2006,6 +2009,7 @@
         materialApi.inventoryEdit(data).then(res => {
           if (res.code == 200) {
             this.otherDeatils.isEdit = false;
+            this.handleOtherRefresh();
           }
         })
       },
@@ -2015,6 +2019,7 @@
         materialApi.planEdit(data).then(res => {
           if (res.code == 200) {
             this.otherDeatils.isEdit = false;
+            this.handleOtherRefresh();
           }
         })
       },
@@ -2024,6 +2029,7 @@
         materialApi.costEdit(data).then(res => {
           if (res.code == 200) {
             this.otherDeatils.isEdit = false;
+            this.handleOtherRefresh();
           }
         })
       },

+ 7 - 37
src/views/purchase/DemandSummary/index.vue

@@ -21,7 +21,7 @@
           <el-col :span="1.5">
             <el-form-item label="品类">
               <el-select
-              v-model="queryParams.materialName"
+              v-model="queryParams.materialClassifyFourName"
               size="small"
               clearable
               @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
@@ -56,7 +56,7 @@
               <el-form-item label="预测分类">
                 <el-select v-model="queryParams.forecastClassification" size="small" style="width: 200px" clearable>
                   <el-option
-                    v-for="dict in dict.type.predictive_classify" :key="dict.value" :label="dict.label" :value="dict.value">
+                    v-for="dict in dict.type.predictive_classify" :key="dict.value" :label="dict.label" :value="dict.label">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -209,33 +209,6 @@
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
-              <el-form-item label="处理审核时间">
-                <el-date-picker
-                  v-model="queryParams.auditTime"
-                  type="date"
-                  value-format="yyyy-MM-dd"
-                  size="small"
-                  style="width: 200px"
-                >
-                </el-date-picker>
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="处理确认时间">
-                <el-date-picker
-                  v-model="queryParams.yesTime"
-                  type="date"
-                  value-format="yyyy-MM-dd"
-                  size="small"
-                  style="width: 200px"
-                >
-                </el-date-picker>
-              </el-form-item>
-            </el-col>
-          </el-row>
-
-          <el-row :gutter="10">
-            <el-col :span="1.5">
               <el-form-item label="审批结束日期">
                 <el-date-picker
                   v-model="queryParams.approverFinishTime"
@@ -467,7 +440,7 @@ export default {
         rowStatus: [],
         buyer: '',
         buyerName: '',
-        materialName: '',
+        materialClassifyFourName: '',
         manufacturer: '',
         forecastClassification: '',
         periodUnit: '',
@@ -485,8 +458,6 @@ export default {
         names: '',
         purchaseOrg: '',
         demandDate: '',
-        auditTime: '',
-        yesTime: '',
         approverFinishTime: '',
         pageNum: 1,
         pageSize: 5
@@ -563,7 +534,7 @@ export default {
         rowStatus: [],
         buyer: '',
         buyerName: '',
-        materialName: '',
+        materialClassifyFourName: '',
         manufacturer: '',
         forecastClassification: '',
         periodUnit: '',
@@ -581,8 +552,7 @@ export default {
         names: '',
         purchaseOrg: '',
         demandDate: '',
-        auditTime: '',
-        yesTime: '',
+        approverFinishTime: '',
         pageNum: 1,
         pageSize: 5
       }
@@ -743,14 +713,14 @@ export default {
     },
     selectionsToInput2(selection) {
       this.classOptions.push(selection)
-      this.queryParams.materialName = selection.name
+      this.queryParams.materialClassifyFourName = selection.name
     },
     // 搜索区物料编码
     chooseMaterial() {
       this.$refs.materialRefer.init()
     },
     selectMaterial(selection) {
-      this.queryParams.materialCode = selection[0].id
+      this.queryParams.materialCode = selection[0].code
       this.queryParams.names = selection[0].name
     },
         // 明细行选择业务部门参照带出业务部门数据

+ 34 - 8
src/views/purchase/PurchaseDemandList/add.vue

@@ -162,6 +162,7 @@
           fit
           max-height="300"
           @selection-change="handleSelectionChange"
+          :key="refreshData"
         >
           <el-table-column show-overflow-tooltip type="selection"/>
           <el-table-column show-overflow-tooltip label="序号" type="index" align="center"/>
@@ -201,7 +202,7 @@
           <el-table-column show-overflow-tooltip label="预留比例" align="center" prop="reservedProportion" width="150px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.reservedProportion">
+                <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.reservedProportion" @change="getYLSL(scope.$index,scope.row.reservedProportion)">
                   <el-option v-for=" dict in dict.type.sys_reserve_ratio" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
                 </el-select>
@@ -263,7 +264,7 @@
           <el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center"  prop="qty" width="120px">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
-                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.qty"/>
+                <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.qty" @blur="getYL(scope.$index, scope.row.qty)"/>
               </el-form-item>
             </template>
           </el-table-column>
@@ -370,7 +371,7 @@
           <!-- <el-table-column show-overflow-tooltip label="末级供应调拨待入量" align="center"  prop="lastStockQty" width="150px"/> -->
           <!-- <el-table-column show-overflow-tooltip label="上级供应中心现存量" align="center"  prop="superiorCenterQty" width="200px"/> -->
           <!-- <el-table-column show-overflow-tooltip label="上级库存被调拨占用量" align="center"  prop="superiorAllotQty" width="200px"/> -->
-          <!-- <el-table-column show-overflow-tooltip label="可用量" align="center"  prop="availableQty"/> -->
+          <el-table-column show-overflow-tooltip label="可用量" align="center"  prop="availableQty"/>
           <el-table-column show-overflow-tooltip label="调拨状态" align="center"  prop="statusAllot" width="100px">
             <template slot-scope="scope">
               <el-form-item class="hang">
@@ -429,7 +430,7 @@
           <el-table-column show-overflow-tooltip label="详细地址" align="center"  prop="address" width="200px"/>
           <el-table-column show-overflow-tooltip label="价格类型" align="center"  prop="priceType" width="150px">
             <template slot-scope="scope">
-              <el-form-item class="hang">
+              <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'priceType'" :rules="{ required: true, message: '请选择价格类型', trigger: 'blur' }">
                 <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.priceType">
                   <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
@@ -549,7 +550,9 @@ export default {
       personOptions: [],
       deptOptions: [],
       customerOptions: [],
-      isBDXQ: false
+      isBDXQ: false,
+      // 刷新表格数据
+      refreshData: 0
     }
   },
   created() {
@@ -598,6 +601,27 @@ export default {
           return '总供应可满足'
       }
     },
+    // 获取预留数量
+    getYLSL(index,val) {
+      if (val) {
+      let newVal = val.replace('%', '')
+      newVal = newVal/100
+      this.basicForm.puDemandItemList[index].reservedQty = newVal * this.basicForm.puDemandItemList[index].qty
+      } else {
+        this.basicForm.puDemandItemList[index].reservedQty = null
+      }
+    },
+    // 实际业务需求量获取
+    getYL(index, val) {
+      if (this.basicForm.puDemandItemList[index].qty && this.basicForm.puDemandItemList[index].reservedProportion) {
+        let newVal = this.basicForm.puDemandItemList[index].reservedProportion.replace('%', '')
+        newVal = newVal/100
+        // this.$set(this.basicForm.puDemandItemList[index].reservedQty, this.basicForm.puDemandItemList[index].qty * newVal)
+        this.basicForm.puDemandItemList[index].reservedQty = this.basicForm.puDemandItemList[index].qty * newVal
+      } else {
+        this.basicForm.puDemandItemList[index].reservedQty = null
+      }
+    },
     copy() {
       this.$modal.msgSuccess("复制成功");
       this.sonPageStu = 'add'
@@ -605,12 +629,14 @@ export default {
       this.getDetails(this.row)
       this.basicForm.id = ''
       this.basicForm.code = ''
+      this.basicForm.createBy = ''
     },
     handleData() {
       console.log('222')
-      // 复制新增把id,编码置为空,子表去掉id
+      // 复制新增把id,编码,创建人置为空,子表去掉id
       this.basicForm.id = ''
       this.basicForm.code = ''
+      this.basicForm.createBy = ''
       if (this.basicForm.puDemandItemList.length !== 0) {
         this.basicForm.puDemandItemList.forEach(item => {
           if (item.id) {
@@ -746,7 +772,7 @@ export default {
         contactsPhone: null,
         address: null,
         source: null,
-        priceType: null,
+        priceType: 'order',
         puManagerApprover: null,
         puManagerApproverName: null,
         processTime: null,
@@ -931,7 +957,7 @@ export default {
       this.basicForm.puDemandItemList[this.tableIndex].contacts = null
       this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = null
       this.basicForm.puDemandItemList[this.tableIndex].address = null
-      this.basicForm.puDemandItemList[this.tableIndex].priceType = null
+      this.basicForm.puDemandItemList[this.tableIndex].priceType = 'order'
       this.basicForm.puDemandItemList[this.tableIndex].lastWarehouseName = null
       this.basicForm.puDemandItemList[this.tableIndex].lastWarehouse = null
       this.basicForm.puDemandItemList[this.tableIndex].lastAllocation = null

+ 1 - 1
src/views/purchase/PurchaseDemandList/index.vue

@@ -22,7 +22,7 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="是否客户指定">
-              <el-select clearable v-model="queryParams.isProcess" size="small" style="width: 200px" clearable placeholder="请选择">
+              <el-select clearable v-model="queryParams.isProcess" size="small" style="width: 200px" placeholder="请选择">
                 <el-option
                   v-for="item in options"
                   :key="item.value"

+ 56 - 14
src/views/purchase/purchase-order/add/column.js

@@ -64,6 +64,7 @@ export const Columns = [
     },
     queryParams: () => ({}),
     isShow:true,
+    require: true,
   },
   {
     key: "finalTypeName",
@@ -82,10 +83,10 @@ export const Columns = [
     key: "buyerName",
     title: "采购员",
     inputType: "PopoverSelect",
-    valueKey: "id",
+    valueKey: "code",
     referName: "CONTACTS_PARAM",
     dataMapping: {
-      buyer: 'id',
+      buyer: 'code',
       buyerName: 'name'
     },
     queryParams: () => ({}),
@@ -163,6 +164,7 @@ export const Columns = [
       pkOrg: params.puOrg,
     }),
     isShow:true,
+    require: true,
   },
   {
     key: "goodsAllocationName",
@@ -175,6 +177,7 @@ export const Columns = [
       goodsAllocationName: 'name'
     },
      isShow:true,
+     require: true,
     queryParams: (params) => ({
       stordocId: params.warehouse,
     }),
@@ -188,14 +191,12 @@ export const Columns = [
     title: "订单使用返利金额", 
     inputType: "Input",
     isShow:true, 
-    require: true,
   },
   { 
     key: "deductionMoney", 
     title: "订单抵扣余款金额", 
     inputType: "Input",
     isShow:true, 
-    require: true,
   },
   { 
     key: "goodsWarehouseName",
@@ -203,6 +204,7 @@ export const Columns = [
     inputType: "Input",
     isShow:true,
     disabled:true,
+    require: true,
   },
   { 
     key: "address",
@@ -275,10 +277,10 @@ export const Columns = [
     key: "agentName",
     title: "代理人",
     inputType: "PopoverSelect",
-    valueKey: "id",
+    valueKey: "code",
     referName: "CONTACTS_PARAM",
     dataMapping: {
-      agent: 'id',
+      agent: 'code',
       agentName: 'name'
     },
      isShow:true,
@@ -777,14 +779,54 @@ export const TabColumns = [
         width: 120,
         require: true,
       },
-      { key: "stroageQty", title: "累计到货主数量", inputType: "Input", width: 120 },
-      { key: "stockQty", title: "累计入库主数量", inputType: "Input", width: 120 },
-      { key: "invoiceQty", title: "累计开票主数量", inputType: "Input", width: 120 },
-      { key: "rollbackQty", title: "累计退货主数量", inputType: "Input", width: 120 },
-      { key: "backStockQty", title: "累计退库主数量", inputType: "Input", width: 120 },
-      { key: "floatQty", title: "未到货数量", inputType: "Input", width: 120 },
-      { key: "createByName", title: "创建人名称", inputType: "Input", width: 120 },
-      { key: "updateByName", title: "更新人名称", inputType: "Input", width: 120 },
+      { 
+        key: "stroageQty", 
+        title: "累计到货主数量", 
+        inputType: "Input", 
+        width: 120 
+      },
+      { 
+        key: "stockQty", 
+        title: "累计入库主数量", 
+        inputType: "Input", 
+        width: 120 
+      },
+      { 
+        key: "invoiceQty", 
+        title: "累计开票主数量", 
+        inputType: "Input", 
+        width: 120 
+      },
+      { 
+        key: "rollbackQty", 
+        title: "累计退货主数量", 
+        inputType: "Input", 
+        width: 120 
+      },
+      { 
+        key: "backStockQty", 
+        title: "累计退库主数量", 
+        inputType: "Input", 
+        width: 120 
+      },
+      { 
+        key: "floatQty", 
+        title: "未到货数量", 
+        inputType: "Input", 
+        width: 120 
+      },
+      { 
+        key: "createByName", 
+        title: "创建人名称", 
+        inputType: "Input", 
+        width: 120 
+      },
+      { 
+        key: "updateByName", 
+        title: "更新人名称", 
+        inputType: "Input", 
+        width: 120 
+      },
     ]
   },
 ];

+ 35 - 19
src/views/purchase/purchase-order/add/index.vue

@@ -37,9 +37,7 @@ export default {
         puOrderItemList: [],
         puOrderExecuteList: [],
       },
-
       tabColumns: NewTabColumns,
-
       tabName: "puOrderItemList",
     };
   },
@@ -224,11 +222,8 @@ export default {
         puOrderExecuteList: [],
       };
     },
-    // 保存
-    async handleSava() {
-      // orderAddForm
-      console.log(this.params, "params");
-
+    // 判断保存条件
+    judgeSaveCondition(cb){
       this.$refs['orderAddForm'].validate(async (valid) => {
         if (valid) {
 
@@ -237,7 +232,30 @@ export default {
             this.$message.error('请填写订单行!');
             return false;
           }
-          try {
+
+          // puOrderItemList
+         let isPrice =  this.params.puOrderItemList.filter(item => !item.whetherCompleteInquiry);
+
+         if(isPrice.length){
+
+            this.$message.error('询价失败!');
+            return false
+
+         }
+         console.log(isPrice,'isPrice');
+          cb();
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 保存
+     handleSava() {
+     console.log(this.params,'this.params---------');
+      this.judgeSaveCondition(async()=>{
+        try {
+            this.loading = true;
             const { code, msg } = await orderApi.create(this.params);
             if (code === 200) {
               this.handleCancel();
@@ -245,13 +263,9 @@ export default {
           } catch (err) {
             //
           } finally {
-            // this.setVisible(false);
+            this.loading = false;
           }
-        } else {
-          console.log('error submit!!');
-          return false;
-        }
-      });
+      })
     },
     // 保存并新增
     async handleSubmit() {
@@ -284,7 +298,7 @@ export default {
       });
     },
     // 子表参照改变之后
-    handleReferChange(val, type, source) {
+    handleReferChange(val, source, type) {
       console.log(val, "val");
       console.log(source, "source");
       console.log(type, "type");
@@ -380,9 +394,11 @@ export default {
           <h3>新增</h3>
           <div style="text-align: right">
             <el-button size="mini" @click="handleCancel">取消</el-button>
-            <el-button size="mini" type="danger" @click="handleSava"
-              >保存</el-button
-            >
+            <el-button 
+              size="mini" 
+              type="danger"
+              @click="handleSava"
+            >保存</el-button>
             <!-- <el-button size="mini" type="info" @click="handleSubmit">
               保存并新增
             </el-button> -->
@@ -537,7 +553,7 @@ export default {
                   <el-form-item 
                     label-width="0" 
                     :prop="`${column.key}.${scope.$index}.${[cColumn.key]}`"
-                    :rules="{ required: cColumn.require, message: `${cColumn.title}不能为空`, trigger: 'change' }"
+                    :rules="{ required: cColumn.require || false, message: `${cColumn.title}不能为空`, trigger: 'change' }"
                   >
                     <el-tag v-if="cColumn.key === 'index'" >
                       {{ scope.$index + 1 }}

+ 5 - 1
src/views/purchase/purchase-order/column.js

@@ -42,7 +42,11 @@ export const TableColumns = [
   { key: "puDeptName", title: "采购部门" },
   // { key: "customer", title: "收货客户" },
   { key: "customerName", title: "收货客户" },
-  { key: "isDeliver", title: "是否发货" },
+  { 
+    key: "isDeliver", 
+    title: "是否发货",
+    inputType: 'Checkbox',
+   },
   {
     key: "isArrival",
     title: "到货超期",

+ 30 - 11
src/views/purchase/purchase-order/edit/index.vue

@@ -159,16 +159,39 @@ export default {
         puOrderExecuteList: [],
       }
     },
-    // 保存
-    async handleSava() {
+    // 判断保存条件
+    judgeSaveCondition(cb){
       this.$refs['orderEditForm'].validate(async (valid) => {
         if (valid) {
-          if(!this.params['puOrderItemList'].length || !this.params['puOrderExecuteList'].length){
+
+          // 执行结果在审批之后出现 !this.params['puOrderExecuteList'].length
+          if(!this.params['puOrderItemList'].length ){
 
             this.$message.error('请填写订单行!');
             return false;
           }
-          try {
+
+          let isPrice =  this.params.puOrderItemList.filter(item => !item.whetherCompleteInquiry);
+
+         if(isPrice.length){
+
+            this.$message.error('询价失败!');
+            return false
+
+         }
+         console.log(isPrice,'isPrice');
+          cb();
+
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 保存
+     handleSava() {
+      this.judgeSaveCondition(async()=>{
+        try {
             this.loading = true;
             const { code, msg } = await (this.handleIsRevise(this.params.status) ?
               orderApi.revision(this.params)
@@ -182,16 +205,12 @@ export default {
           } finally {
             this.loading = false;
           }
-        } else {
-          console.log('error submit!!');
-          return false;
-        }
-      });
+      })
     },
     beforeOpen() {
     },
     // 子表参照改变之后
-    handleReferChange(val,  type,source) {
+    handleReferChange(val, source, type) {
       console.log(val, 'val');
       console.log(source, 'source');
       console.log(type, 'type');
@@ -428,7 +447,7 @@ export default {
                   <el-form-item 
                     label-width="0" 
                     :prop="`${column.key}.${scope.$index}.${[cColumn.key]}`"
-                    :rules="{ required: cColumn.require, message: `${cColumn.title}不能为空`, trigger: 'change' }"
+                    :rules="{ required: cColumn.require || false, message: `${cColumn.title}不能为空`, trigger: 'change' }"
                   >
 
                   <span v-if="!cColumn.inputType">

+ 6 - 7
src/views/purchase/purchase-order/index.vue

@@ -50,14 +50,13 @@ export default {
     this.fetchList(this.params, this.page);
   },
   methods: {
-    async fetchList(params, page) {
+    async fetchList(data, params) {
       try {
         this.loading = true;
-        // const { pageNum, pageSize } = page;
-        console.log(
-          page,'page'
-        );
-        const { code, msg, rows, total } = await orderApi.list(params, page);
+        params['isAsc'] = 'desc';
+        params['orderByColumn'] = 'updateTime';
+        
+        const { code, msg, rows, total } = await orderApi.list(data, params);
         if (code === 200) {
           this.page.total = total;
           this.tableData = rows;
@@ -200,7 +199,6 @@ export default {
         }
 
       } catch (error) {
-
       } finally {
       }
     },
@@ -360,6 +358,7 @@ export default {
                   :placeholder="column.placeholder"
                   :data-mapping="column.dataMapping"
                   :query-params="column.queryParams"
+                  :clearable="column.clearable"
                 ></dr-popover-select>
                 <!-- @keyup.enter.native="useQuery(params, page)" -->
 

+ 8 - 4
src/views/purchase/transferOrder/add.vue

@@ -232,10 +232,11 @@
           max-height="480"
           >
           <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
-          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="material" width="230px">
+          <el-table-column show-overflow-tooltip label="采购需求单单号" align="center" prop="demandCode" width="200px"/>
+          <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.material" @focus="chooseMaterial(scope.$index)">
+                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.materialCode" @focus="chooseMaterial(scope.$index)">
                   <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
                 </el-input>
               </el-form-item>
@@ -818,7 +819,9 @@ export default {
     addLine() {
       const newLine = {
         rowno: null,
+        demandCode: null,
         material: null,
+        materialCode: null,
         materialName: null,
         deliveryCode: null,
         storageCode: null,
@@ -955,7 +958,8 @@ export default {
     },
     selectMaterial(selection) {
       console.log('选中的物料', selection)
-      this.materialInfo[this.tableIndex].material = selection[0].code
+      this.materialInfo[this.tableIndex].material = selection[0].id
+      this.materialInfo[this.tableIndex].materialCode = selection[0].code
       this.materialInfo[this.tableIndex].materialName = selection[0].name
       this.materialInfo[this.tableIndex].specification = selection[0].specification
       this.materialInfo[this.tableIndex].model = selection[0].model
@@ -975,7 +979,7 @@ export default {
     chooseBatch(index) {
       this.tableIndex = index
       this.referConditionMx.orgCode = this.basicForm.deliveryInventoryOrgCode
-      this.referConditionMx.materialCode = this.materialInfo[this.tableIndex].material
+      this.referConditionMx.materialCode = this.materialInfo[this.tableIndex].materialCode
       this.referConditionMx.unitCode = this.materialInfo[this.tableIndex].unitCode
       this.referConditionMx.warehouseCode = this.basicForm.deliveryWarehouseCode
       this.$refs.batchRefer.init(this.referConditionMx)

+ 1 - 1
src/views/purchase/transferOrder/index.vue

@@ -164,7 +164,7 @@
             max-height="380"
             >
             <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
-            <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="material" width="150px"/>
+            <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="150px"/>
             <el-table-column show-overflow-tooltip label="物料名称" align="center" prop="materialName" width="150px"/>
             <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
             <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>