Эх сурвалжийг харах

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

002201 2 жил өмнө
parent
commit
9f202a6a33

+ 1 - 0
package.json

@@ -51,6 +51,7 @@
     "js-beautify": "1.13.0",
     "js-cookie": "3.0.1",
     "jsencrypt": "3.0.0-rc.1",
+    "lodash": "^4.17.21",
     "nprogress": "0.2.0",
     "quill": "1.3.7",
     "screenfull": "5.0.2",

+ 16 - 0
src/api/WMS/historical-route.js

@@ -0,0 +1,16 @@
+// 历史轨迹
+import request from "@/utils/request";
+
+// 查询地址
+const queryAddress = (data) => {
+    return request({
+      url: `/geocode/repo`,
+      method: "post",
+      data,
+    });
+  }
+
+  export default {
+    queryAddress,
+    
+  }

+ 9 - 15
src/api/business/purchase/purchase-order.js

@@ -108,22 +108,15 @@ const payRequest = () => {
     method: "get",
     // params,
   });
+}
 
-  // return new Promise(resolve => {
-
-
-  //   // 当前 Promise 的状态由传入的 Promise 去决定
-  //   // axios.get(`${process.env.NODE_ENV == "development" ? '/sy-derom' : ''}/apiproxy/service/ssoRegServlet?userCode=${userCode}&busiCenter=001`)
-  //   let url =`${process.env.VUE_APP_BASE_API}/pu/order/paymentRequest`;
-    
-  //   axios.get(url)
-  //   .then(res =>{
-  //     if(res.status == 200){
-  //       resolve(res.data)
-  //     }
-  //   })
-  // })
-  
+const REFER = (data, params) => {
+  return request({
+    url: "/refer/query",
+    method: "POST",
+    data: data,
+    params: params,
+  });
 }
 
 export default {
@@ -139,5 +132,6 @@ export default {
   close,
   toNc,
   payRequest,
+  REFER,
 
 }

+ 8 - 0
src/api/purchase/DemandSummary.js

@@ -67,4 +67,12 @@ export function editSummaryMx(data) {
     method: 'post',
     data: data
   })
+}
+// 采购需求明细行重取批量
+export function reloadBatch(data) {
+  return request({
+    url: `/pu/demand/item/min/edit`,
+    method: 'post',
+    data: data
+  })
 }

+ 0 - 1
src/components/DictTag/index.vue

@@ -45,7 +45,6 @@ export default {
       }
     },
   },
-  created() {},
 };
 </script>
 <style scoped>

+ 42 - 4
src/components/Refers/refers.vue

@@ -19,10 +19,18 @@
           <el-main>
             <el-table :data="dataList" v-loading="loading" size="small" border ref="contractTable"
               @select="handleSelectionChange" @row-click="rowSelect" height="calc(100% - 40px)">
-              <el-table-column type="selection" header-align="center" align="center" width="50"/>
-              <el-table-column prop="id" header-align="center" align="center" min-width="90" label="id"/>
-              <el-table-column prop="name" header-align="center" align="center" min-width="90" label="名称"/>
-              <el-table-column v-if="orgName" prop="orgName" header-align="center" align="center" min-width="90" label="所属组织"/>
+              <el-table-column show-overflow-tooltip type="selection" header-align="center" align="center" width="50"/>
+              <el-table-column show-overflow-tooltip prop="id" header-align="center" align="center" min-width="90" :label="reciveForm.title + 'id'"/>
+              <el-table-column show-overflow-tooltip prop="code" header-align="center" align="center" min-width="90" :label="reciveForm.title + '编码'"/>
+              <el-table-column show-overflow-tooltip prop="name" header-align="center" align="center" min-width="90" :label="reciveForm.title + '名称'"/>
+              <el-table-column show-overflow-tooltip v-if="orgName" prop="orgName" header-align="center" align="center" min-width="90" label="所属组织"/>
+              <el-table-column show-overflow-tooltip v-if="warehouseCode" prop="warehouseCode" header-align="center" align="center" min-width="90" label="所属仓库编码"/>
+              <el-table-column show-overflow-tooltip v-if="warehouseName" prop="warehouseName" header-align="center" align="center" min-width="90" label="所属仓库"/>
+              <el-table-column show-overflow-tooltip v-if="contactsName" prop="contactsName" header-align="center" align="center" min-width="90" label="联系人"/>
+              <el-table-column show-overflow-tooltip v-if="contactsPhone" prop="contactsPhone" header-align="center" align="center" min-width="90" label="联系人电话"/>
+              <el-table-column show-overflow-tooltip v-if="address" prop="address" header-align="center" align="center" min-width="90" label="详细地址"/>
+              <el-table-column show-overflow-tooltip v-if="materialClassifyName" prop="materialClassifyName" header-align="center" align="center" min-width="90" label="物料分类"/>
+              <el-table-column show-overflow-tooltip v-if="remark" prop="remark" header-align="center" align="center" min-width="90" label="备注"/>
             </el-table>
             <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
               :current-page="searchForm.pageNo" :page-sizes="[5, 10, 15, 20]" :page-size="searchForm.pageSize"
@@ -55,6 +63,13 @@ export default {
       dataList: [],
       total: 0,
       orgName: false,
+      warehouseCode: false,
+      warehouseName: false,
+      contactsName: false,
+      contactsPhone: false,
+      address: false,
+      materialClassifyName: false,
+      remark: false,
       orders: [],
       loading: false,
       visible: false,
@@ -92,11 +107,34 @@ export default {
         console.log('res', res)
         this.dataList = res.rows;
         this.total = res.total
+        // 仓库里面加组织
         if(res.rows.length !== 0 && res.rows[0].orgName) {
           this.orgName = true
         } else {
           this.orgName = false
         }
+        // 选择货位里面加仓库
+        if(res.rows.length !== 0 && res.rows[0].warehouseCode) {
+          this.warehouseCode = true
+          this.warehouseName = true
+        } else {
+          this.warehouseCode = false
+          this.warehouseName = false
+        }
+        // 选择收货地址内加详细信息
+        if(res.rows.length !== 0 && res.rows[0].contactsName) {
+          this.contactsName = true
+          this.contactsPhone = true
+          this.address = true
+          this.materialClassifyName = true
+          this.remark = true
+        } else {
+          this.contactsName = false
+          this.contactsPhone = false
+          this.address = false
+          this.materialClassifyName = false
+          this.remark = false
+        }
         this.loading = false;
         this.$nextTick(() => {
           this.setSelectRow();

+ 4 - 2
src/components/popover-select/index.vue

@@ -164,8 +164,8 @@ export default {
       const { type, source, queryParams } = this.$props;
       this.model = {
         type,
-        search: "",
         ...this.model,
+        search: "",
         ...queryParams(source),
       };
       await this.fetchList(this.model, this.page);
@@ -237,7 +237,9 @@ export default {
       }
     },
   },
-  created() {},
+  created() {
+
+  },
   mounted() {},
   destroyed() {},
 };

+ 1 - 1
src/permission.js

@@ -8,7 +8,7 @@ import { isRelogin } from '@/utils/request'
 
 NProgress.configure({ showSpinner: false })
 
-const whiteList = ['/login', '/register', '/test01', '/canteenAddFood', '/canteenAddMenu', '/menuScreen', '/foodScreen']
+const whiteList = ['/login', '/register', '/test01', '/canteenAddFood', '/canteenAddMenu', '/menuScreen', '/foodScreen','/business/wms/historical-route']
 
 router.beforeEach((to, from, next) => {
   NProgress.start()

+ 6 - 1
src/router/index.js

@@ -156,7 +156,12 @@ export const constantRoutes = [
       }
 
     ]
-  }
+  },
+  {
+    path: '/business/wms/historical-route',
+    component: () => import('@/views/WMS/historical-route'),
+    hidden: false
+  },
 
 ]
 

+ 217 - 0
src/views/WMS/historical-route/index.vue

@@ -0,0 +1,217 @@
+<template>
+    <!-- 页面 -->
+    <div class="block">
+        <br>
+        <el-timeline>
+            <h1>表单</h1>
+            <el-table
+            :data="tableData"
+            height="250"
+            border
+            style="width: 97%">
+            <el-table-column
+            prop="billCode"
+            label="单据号"
+            width="90">
+            </el-table-column>
+            <el-table-column
+            prop="measuringPointName"
+            label="车牌号"
+            width="110">
+            </el-table-column>
+            <el-table-column
+            prop="temperature"
+            label="温度"
+            width="90">
+            </el-table-column>
+            <el-table-column
+            prop="humidity"
+            label="湿度"
+            width="90">
+            </el-table-column>
+            <el-table-column
+            prop="hisDate"
+            label="时间点"
+            width="180">
+            </el-table-column>
+            <el-table-column
+            prop="address"
+            label="地址"
+            >
+             </el-table-column>
+            </el-table>
+        </el-timeline>
+        <!-- <el-timeline>
+            <input type="button" value="查询" @click="handleQuery" />
+        </el-timeline> -->
+
+        <el-timeline>
+            <br><br><br>
+            <h1>温湿度曲线图</h1>
+            <div class="echart" id="mychart" :style="myChartStyle"></div>
+            <br><br><br>
+            <h1>路线</h1>
+        </el-timeline>
+        <iframe :src = url width="100%" height="1000"> </iframe>
+    </div>
+</template>
+
+<script>
+import historyApi from '@/api/WMS/historical-route'
+import * as echarts from "echarts";
+// import {queryAddress,} from '@/api/WMS/historical-route'
+export default {
+    data() {
+        return {
+            myChart: {},
+            xData: [], //横坐标
+            temperatureData: [], //温度数据
+            humidityData: [], //湿度数据
+            myChartStyle: { float: "left", width: "100%", height: "400px" }, //图表样式
+            position: [],
+            url: '',
+            tableData:[],
+            resData:[],
+            resX:[],
+            resYTemperature:[],
+            resYHumidity:[],
+            carMessage:{
+                billCode: "",
+                plateNumber: "",
+                startTime: "",
+                endTime: ""
+            }
+        };
+    },
+    mounted() {
+        //渲染
+        this.initEcharts();
+    },
+    methods: {
+        //渲染图标
+        initEcharts() {
+            const option = {
+                xAxis: {
+                data: this.xData
+                },
+                legend: { // 图例
+                data: ["温度", "湿度/100"],
+                bottom: "0%"
+                },
+                yAxis: {},
+                series: [
+                {
+                    name: "温度",
+                    data: this.temperatureData,
+                    type: "line", // 类型设置为折线图
+                    label: {
+                    show: true,
+                    position: "top",
+                    textStyle: {
+                        fontSize: 16
+                    }
+                    }
+                },
+                {
+                    name: "湿度/100",
+                    data: this.humidityData,
+                    type: "line", // 类型设置为折线图
+                    label: {
+                    show: true,
+                    position: "bottom",
+                    textStyle: {
+                        fontSize: 16
+                    }
+                    }
+                }
+                ]
+            };
+            this.myChart = echarts.init(document.getElementById("mychart"));
+            this.myChart.setOption(option);
+            //随着屏幕大小调节图表
+            window.addEventListener("resize", () => {
+                this.myChart.resize();
+            });
+        },
+        //查询按钮
+        handleQuery() {
+            // window.location.href = ''
+            this.handleGeocodeRepo(this.carMessage);
+           
+        },
+        handleGeocodeRepo(data) {
+
+            // let data = {
+            //     billCode: "CS01",
+            //     plateNumber: "湘A79D2R",
+            //     startTime: "2023-02-01",
+            //     endTime: "2023-02-02"
+            // }
+
+            console.log(data, 'data');
+            historyApi.queryAddress(data).then(res => {
+                console.log(res, 'res-----------------');
+                // //X轴时间数据
+                // this.xData = res.data.map(item => {return item.hisDate});
+                // //温度数据转换
+                // this.temperatureData = res.data.map(item => {return item.temperature});
+                // //湿度数据转换
+                // this.humidityData = res.data.map(item => {return item.humidity});
+                let { code, data } = res;
+                let text;
+                let count = 0;
+                if (code == 200) {
+                    //定义经纬度不为0的数组[i]为起点
+                    for (let i = 0; i < data.length; i++) {
+                        if (data[i].gpsLatitude != 0 && data[i].gpsLongitude != 0) {
+                            //定义经纬度不为0的数组[j]为终点
+                            for	(let j = data.length - 1; j > i; j--) {
+                                if (data[j].gpsLatitude != 0 && data[j].gpsLongitude != 0) {
+                                    for (let z = i; z < j; z = z + Math.trunc((j - i) / 9)) {
+                                        // console.log("i",i)
+                                        text += `&via[${count}][id][${z}]&via[${count}][lnglat]=${data[z].gpsLongitude},${data[z].gpsLatitude}` ;
+                                        this.resData[count] = res.data[z];
+                                        this.resX[count] = res.data[z].hisDate;
+                                        this.resYTemperature[count] = res.data[z].temperature;
+                                        this.resYHumidity[count] = res.data[z].humidity / 100;
+                                        count++;
+                                    }
+                                    // this.position = data;
+                                    // let url = `//uri.amap.com/navigation?from=${data[0].gpsLongitude},${data[0].gpsLatitude},startpoint&to=${data[data.length-1].gpsLongitude},${data[data.length-1].gpsLatitude},endpoint&via=${data[260].gpsLongitude},${data[260].gpsLatitude},midwaypoint&mode=car&policy=0&src=mypage&coordinate=gaode&callnative=0`
+                                    let url = `https://ditu.amap.com/dir?type=car&policy=1&from[lnglat]=${data[i].gpsLongitude},${data[i].gpsLatitude}&from[name]=startpoint&from[id]=${i}-from&to[lnglat]=${data[j].gpsLongitude},${data[j].gpsLatitude}&to[name]=endpoint&to[id]=${i}-to${text}&src=mypage&callnative=0&platform=pc&innersrc=uriapi`
+                                    console.log(url, 'url---------------------');
+                                    this.url = url;
+                                    this.xData = res.data.temperature;
+                                    this.tableData = this.resData;
+                                    // window.location.href = url;
+                                    // window.open(url, "newWindow", "width=1000,height=1000");
+                                    // window.location.reload();
+                                    this.xData = this.resX;
+                                    this.temperatureData = this.resYTemperature;
+                                    this.humidityData = this.resYHumidity;
+                                    // console.log('this.xData',this.xData);
+                                    // console.log('this.temperatureData',this.temperatureData);
+                                    // console.log('this.humidityData',this.humidityData);
+                                    this.initEcharts();
+                                    console.log(text,'text')
+                                    return;
+                                }
+                            }
+                        }
+                    }
+                }
+            })
+            // queryAddress({})
+        }
+    },
+    created() {
+        console.log(this.$route.query,'this.$route')
+        this.carMessage = this.$route.query;
+        this.handleQuery();
+    }
+};
+</script>
+
+<style>
+
+</style>

+ 3 - 6
src/views/material/basicFile/details.vue

@@ -1323,19 +1323,16 @@
       },
       // 除基本信息之后的修改
       handleOtherEdit() {
-        console.log('除基本信息之后的修改', this.otherDeatils.queryKey);
-
-        if ((this.otherDeatils.queryKey && this.otherDeatils.queryKey != '') || this.mainMsg.checkedList.length == 1) {
+        console.log('除基本信息之后的修改');
+        if (this.mainMsg.checkedList.length == 1) {
           this.otherDeatils.show = true;
           this.otherDeatils.isEdit = true;
           let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
+          this.otherDeatils.queryKey = this.mainMsg.checkedList[0].id;
           this.otherDeatils.title = activeTab.label;
-          this.otherDeatils.queryKey = this.otherDeatils.queryKey || this.mainMsg.checkedList[0].id;
           console.log(this.otherDeatils, 'this.otherDeatils');
           // 查询其他标签页列表详情
           this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
-
-
         } else {
           this.$message({
             message: '修改请选择单个数据!',

+ 1 - 1
src/views/material/changeApply/add.vue

@@ -107,7 +107,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="生产许可证/经营许可证/备案号" prop="remark">
+              <el-form-item label="生产许可证" prop="remark">
                 <el-input :disabled="disable" v-model="basicForm.productionPermit"></el-input>
               </el-form-item>
             </el-col>

+ 79 - 9
src/views/purchase/DemandSummary/add.vue

@@ -4,9 +4,10 @@
       <span>采购需求处理详情</span>
       <div class="btn_grooup">
         <el-button type="primary" size="small" @click="editLine">编辑</el-button>
+        <el-button type="danger" size="small" v-if="!lineDisable" @click="cancelEdit">取消编辑</el-button>
         <el-button type="success" size="small" v-if="!lineDisable" @click="saveLine">保存</el-button>
         <el-button type="primary" size="small" @click="closeLine">行关闭</el-button>
-        <el-button type="primary" size="small">重取批量</el-button>
+        <el-button type="primary" size="small" @click="reloadBatch">重取批量</el-button>
       </div>
 
       <el-table 
@@ -18,7 +19,8 @@
         <el-table-column show-overflow-tooltip type="selection" width="55" />
         <el-table-column show-overflow-tooltip label="序号" align="center" type="index"/>
         <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo"/>
-        <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode"/>
+        <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="120px" :formatter="hangStatus"/>
+        <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="180"/>
         <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
         <el-table-column show-overflow-tooltip label="单位" align="center" prop="unit"/>
@@ -67,7 +69,13 @@
         <el-table-column show-overflow-tooltip label="业务类型" align="center" prop="billType" width="150"/>
         <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" width="150"/>
         <el-table-column show-overflow-tooltip label="收货仓库" align="center" prop="deliveryWarehouseName" width="150"/>
-        <el-table-column show-overflow-tooltip label="收货货位" align="center" prop="deliveryAllocationName" width="150"/>
+        <el-table-column show-overflow-tooltip label="收货货位" align="center" prop="deliveryAllocationName" width="200">
+          <template slot-scope="scope">
+            <el-input clearable :disabled="lineDisable" size="small" v-model="scope.row.deliveryAllocationName" @clear="clean(scope.row)" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '收货货位', scope.row.deliveryWarehouse)">
+              <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '收货货位', scope.row.deliveryWarehouse)"></el-button>
+            </el-input>
+          </template>
+        </el-table-column>
         <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="150"/>
         <el-table-column show-overflow-tooltip label="制单人" align="center" prop="billMaker" width="150"/>
         <el-table-column show-overflow-tooltip label="审核人员" align="center" prop="approver" width="150"/>
@@ -112,13 +120,19 @@
         <el-button size="small" plain @click="back">返回</el-button>
       </el-col>
     </div>
+
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
   </div>
 </template>
 
 <script>
-import {getSummaryDetail, shutDownSummary, editSummaryMx } from '@/api/purchase/DemandSummary.js'
+import Refers from '@/components/Refers/refers.vue'
+import {getSummaryDetail, shutDownSummary, editSummaryMx, reloadBatch } from '@/api/purchase/DemandSummary.js'
 export default {
   name: 'checkDemandSummary',
+  components: {
+    Refers
+  },
   props: ['pageStu','row', 'disable'],
   model: {
     prop: 'isList',
@@ -126,6 +140,22 @@ export default {
   },
   data() {
     return{
+      hangStatus(row) {
+        switch (row.status) {
+          case '0':
+            return '需补货'
+          case '1':
+            return '待计划确认'
+          case '2':
+            return '计划已确认'
+          case '3':
+            return '计划已审核'
+          case '4':
+            return '行关闭'
+          case '5':
+            return '总供应可满足'
+        }
+      },
       priceClass(row) {
         switch (row.priceType) {
           case 'order':
@@ -142,6 +172,12 @@ export default {
       tableList: [],
       ids: [],
       lineDisable: true,
+      tableIndex: '',
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      }
     }
   },
   created() {
@@ -160,11 +196,11 @@ export default {
     },
     back() {
       this.$emit('jugislist', true)
-      let queryParams = {
-        pageNum: 1,
-        pageSize: 10
-      }
-      this.$emit('refresh', queryParams)
+      // let queryParams = {
+      //   pageNum: 1,
+      //   pageSize: 10
+      // }
+      // this.$emit('refresh', queryParams)
     },
     // 如果需要回显则调用详情接口
     getDetails(row) {
@@ -178,6 +214,9 @@ export default {
       console.log('sonList`````', this.tableList)
       this.lineDisable = false
     },
+    cancelEdit() {
+      this.lineDisable = true
+    },
     saveLine() {
       editSummaryMx(this.tableList).then(res => {
         if (res.code === 200) {
@@ -201,6 +240,37 @@ export default {
         })
       }
     },
+    // 重取批量
+    reloadBatch() {
+      let param = this.tableList.map(item => { return item.demandItemId})
+      reloadBatch(param).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("操作成功");
+          this.getDetails(this.row)
+        }
+      })
+      
+    },
+    // 明细行选择货位
+    chooseMxHW(index, type, isPage, title, stordocId) {
+      this.tableIndex = index
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.referCondition.stordocId = stordocId
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      if (this.referCondition.title == '收货货位') {
+        this.tableList[this.tableIndex].deliveryAllocationName = selection[0].name
+        this.tableList[this.tableIndex].deliveryAllocation = selection[0].id
+      }
+    },
+    // 清空选中的货位
+    clean(row) {
+      row.deliveryAllocation = ''
+      row.deliveryAllocationName = ''
+    }
   }
 }
 </script>

+ 217 - 206
src/views/purchase/DemandSummary/index.vue

@@ -1,235 +1,237 @@
 <template>
   <div id="demandSummary">
     <div v-if="isList">
-      <el-form class="search_area" label-width="100px">
-        <el-row :gutter="10">
-          <el-col :span="1.5">
-            <el-form-item label="行状态">
-              <el-select multiple v-model="queryParams.rowStatus" size="small" style="width: 200px" clearable>
-                <el-option v-for="dict in dict.type.sys_row_status" :key="dict.value" :label="dict.label" :value="dict.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="采购员">
-              <el-select clearable size="small" v-model="queryParams.buyer" @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')" style="width: 200px">
-                <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="品类">
-              <el-select
-              v-model="queryParams.materialClassifyFourName"
-              size="small"
-              clearable
-              @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
-              style="width: 200px"
-              >
-              <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.name" />
-            </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="" label-width="20px">
-              <el-button type="primary" size="small" icon="el-icon-search" plain @click="search">搜索</el-button>
-              <el-button size="small" icon="el-icon-refresh" plain @click="reset">重置</el-button>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <CollapseTransition>
-        <div v-show="expanded">
+      <el-card>
+        <el-form class="search_area" label-width="100px">
           <el-row :gutter="10">
             <el-col :span="1.5">
-              <el-form-item label="生产厂家">
-                <el-input
-                v-model="queryParams.manufacturer"
-                size="small"
-                clearable
-                style="width: 200px"
-                />
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <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.label">
+              <el-form-item label="行状态">
+                <el-select multiple v-model="queryParams.rowStatus" size="small" style="width: 200px" clearable>
+                  <el-option v-for="dict in dict.type.sys_row_status" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
-              <el-form-item label="审核人">
-                <el-select clearable size="small" v-model="queryParams.puManagerAuditor" @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')" style="width: 200px">
-                  <el-option v-for="item in auditOptions" :key="item.id" :label="item.name" :value="item.code" />
+              <el-form-item label="采购员">
+                <el-select clearable size="small" v-model="queryParams.buyer" @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')" style="width: 200px">
+                  <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
                 </el-select>
               </el-form-item>
             </el-col>
-            <!-- <el-col :span="1.5">
-              <el-form-item label="周期单位">
-                <el-select v-model="queryParams.periodUnit" size="small" style="width: 200px" clearable>
-                  <el-option
-                    v-for="dict in dict.type.sys_period_unit" :key="dict.value" :label="dict.label" :value="dict.value">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col> -->
-          </el-row>
-
-          <el-row :gutter="10">
-            <!-- <el-col :span="1.5">
-              <el-form-item label="转请购单号">
-                <el-input
-                v-model="queryParams.zqgdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
-              </el-form-item>
-            </el-col> -->
-            <!-- <el-col :span="1.5">
-              <el-form-item label="业务部门">
-                <el-select clearable size="small" v-model="queryParams.departmentName" @focus="chooseRefer('DEPT_PARAM', true, '业务部门')" style="width: 200px">
-                  <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col> -->
-          </el-row>
-
-          <el-row :gutter="10">
             <el-col :span="1.5">
-              <el-form-item label="注册人">
-                <el-input
-                v-model="queryParams.registrant"
+              <el-form-item label="品类">
+                <el-select
+                v-model="queryParams.materialClassifyFourName"
                 size="small"
                 clearable
+                @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
                 style="width: 200px"
-                />
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="业务类型">
-                <el-select v-model="queryParams.businessType" size="small" style="width: 200px" clearable>
-                  <el-option
-                    v-for="dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
-                  </el-option>
-                </el-select>
+                >
+                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.name" />
+              </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
-              <el-form-item label="单据来源">
-                <el-select v-model="queryParams.billSource" size="small" style="width: 200px" clearable>
-                  <el-option
-                    v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
-                  </el-option>
-                </el-select>
+              <el-form-item label="" label-width="20px">
+                <el-button type="primary" size="small" icon="el-icon-search" plain @click="search">搜索</el-button>
+                <el-button size="small" icon="el-icon-refresh" plain @click="reset">重置</el-button>
               </el-form-item>
             </el-col>
           </el-row>
 
-          <el-row :gutter="10">
-            <el-col :span="1.5">
-              <el-form-item label="需求客户">
-                <el-select clearable size="small" v-model="queryParams.customer" @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
-                  <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="末级供应仓库">
-                <el-select clearable size="small" v-model="queryParams.lastWarehouse" @focus="chooseRefer('WAREHOUSE_PARAM', true, '末级供应仓库')" style="width: 200px">
-                  <el-option v-for="item in lastWarehouseOptions" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="末级供应库位">
-                <el-select clearable size="small" v-model="queryParams.lastAllocation" @focus="chooseRefer('ALLOCATION_PARAM', true, '末级供应库位')" style="width: 200px">
-                  <el-option v-for="item in lastAllocationOptions" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <!-- <el-col :span="1.5">
-              <el-form-item label="转请购时间">
-                <el-select v-model="queryParams.ywlx" size="small" style="width: 200px" clearable>
-                  <el-option
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col> -->
-          </el-row>
+          <CollapseTransition>
+          <div v-show="expanded">
+            <el-row :gutter="10">
+              <el-col :span="1.5">
+                <el-form-item label="生产厂家">
+                  <el-input
+                  v-model="queryParams.manufacturer"
+                  size="small"
+                  clearable
+                  style="width: 200px"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <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.label">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="审核人">
+                  <el-select clearable size="small" v-model="queryParams.puManagerAuditor" @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')" style="width: 200px">
+                    <el-option v-for="item in auditOptions" :key="item.id" :label="item.name" :value="item.code" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <!-- <el-col :span="1.5">
+                <el-form-item label="周期单位">
+                  <el-select v-model="queryParams.periodUnit" size="small" style="width: 200px" clearable>
+                    <el-option
+                      v-for="dict in dict.type.sys_period_unit" :key="dict.value" :label="dict.label" :value="dict.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col> -->
+            </el-row>
 
-          <el-row :gutter="10">
-            <el-col :span="1.5">
-              <el-form-item label="物料编码">
-                <el-input clearable size="small" v-model="queryParams.names" @focus="chooseMaterial" style="width: 200px">
-                  <el-button size="small" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
-                </el-input>
-                <el-input v-show="false" v-model="queryParams.materialCode"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="默认采购组织">
-                <el-select clearable size="small" v-model="queryParams.purchaseOrg" @focus="chooseRefer('ORG_PARAM', true, '默认采购组织')" style="width: 200px">
-                  <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="需求日期">
-                <el-date-picker
-                  v-model="queryParams.demandDate"
-                  type="date"
-                  value-format="yyyy-MM-dd"
+            <el-row :gutter="10">
+              <!-- <el-col :span="1.5">
+                <el-form-item label="转请购单号">
+                  <el-input
+                  v-model="queryParams.zqgdh"
                   size="small"
+                  placeholder=""
+                  clearable
                   style="width: 200px"
-                >
-                </el-date-picker>
-              </el-form-item>
-            </el-col>
-          </el-row>
+                  />
+                </el-form-item>
+              </el-col> -->
+              <!-- <el-col :span="1.5">
+                <el-form-item label="业务部门">
+                  <el-select clearable size="small" v-model="queryParams.departmentName" @focus="chooseRefer('DEPT_PARAM', true, '业务部门')" style="width: 200px">
+                    <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
+                  </el-select>
+                </el-form-item>
+              </el-col> -->
+            </el-row>
 
-          <el-row :gutter="10">
-            <el-col :span="1.5">
-              <el-form-item label="采购需求单号">
-                <el-input
-                v-model.trim="queryParams.code"
-                size="small"
-                clearable
-                style="width: 200px"
-                />
-              </el-form-item>
-            </el-col>
-            <el-col :span="1.5">
-              <el-form-item label="审批结束日期">
-                <el-date-picker
-                  v-model="queryParams.approverFinishTime"
-                  type="date"
+            <el-row :gutter="10">
+              <el-col :span="1.5">
+                <el-form-item label="注册人">
+                  <el-input
+                  v-model="queryParams.registrant"
+                  size="small"
                   clearable
-                  value-format="yyyy-MM-dd"
+                  style="width: 200px"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="业务类型">
+                  <el-select v-model="queryParams.businessType" size="small" style="width: 200px" clearable>
+                    <el-option
+                      v-for="dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="单据来源">
+                  <el-select v-model="queryParams.billSource" size="small" style="width: 200px" clearable>
+                    <el-option
+                      v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-row>
+
+            <el-row :gutter="10">
+              <el-col :span="1.5">
+                <el-form-item label="需求客户">
+                  <el-select clearable size="small" v-model="queryParams.customer" @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
+                    <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="末级供应仓库">
+                  <el-select clearable size="small" v-model="queryParams.lastWarehouse" @focus="chooseRefer('WAREHOUSE_PARAM', true, '末级供应仓库')" style="width: 200px">
+                    <el-option v-for="item in lastWarehouseOptions" :key="item.id" :label="item.name" :value="item.id" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="末级供应库位">
+                  <el-select clearable size="small" v-model="queryParams.lastAllocation" @focus="chooseRefer('ALLOCATION_PARAM', true, '末级供应库位', queryParams.lastWarehouse)" style="width: 200px">
+                    <el-option v-for="item in lastAllocationOptions" :key="item.id" :label="item.name" :value="item.id" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <!-- <el-col :span="1.5">
+                <el-form-item label="转请购时间">
+                  <el-select v-model="queryParams.ywlx" size="small" style="width: 200px" clearable>
+                    <el-option
+                      v-for="item in options"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col> -->
+            </el-row>
+
+            <el-row :gutter="10">
+              <el-col :span="1.5">
+                <el-form-item label="物料编码">
+                  <el-input clearable size="small" v-model="queryParams.names" @focus="chooseMaterial" style="width: 200px">
+                    <el-button size="small" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
+                  </el-input>
+                  <el-input v-show="false" v-model="queryParams.materialCode"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="默认采购组织">
+                  <el-select clearable size="small" v-model="queryParams.purchaseOrg" @focus="chooseRefer('ORG_PARAM', true, '默认采购组织')" style="width: 200px">
+                    <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="需求日期">
+                  <el-date-picker
+                    v-model="queryParams.demandDate"
+                    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-input
+                  v-model.trim="queryParams.code"
                   size="small"
+                  clearable
                   style="width: 200px"
-                >
-                </el-date-picker>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </div>
-        </CollapseTransition>
-      </el-form>
-      <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="审批结束日期">
+                  <el-date-picker
+                    v-model="queryParams.approverFinishTime"
+                    type="date"
+                    clearable
+                    value-format="yyyy-MM-dd"
+                    size="small"
+                    style="width: 200px"
+                  >
+                  </el-date-picker>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </div>
+          </CollapseTransition>
+        </el-form>
+        <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
     
-      <el-card>
+      
         <div class="btn_grooup">
           <el-button type="primary" size="small" @click="editList">编辑</el-button>
+          <el-button type="danger" size="small" v-if="!lineDisable" @click="cancelEdit">取消编辑</el-button>
           <el-button type="success" size="small" v-if="!lineDisable" @click="saveList">保存</el-button>
           <el-button type="primary" size="small" @click="confirms">确认</el-button>
           <el-button type="primary" size="small" @click="cancels">取消</el-button>
@@ -253,7 +255,7 @@
           fit
           show-summary
           :summary-method="getSummaries"
-          max-height="480"
+          max-height="550"
           @selection-change="handleSelectionChange"
           :key="isUpdate"
         >
@@ -289,14 +291,14 @@
           <el-table-column show-overflow-tooltip label="人工调整数" align="center" prop="artificialAdjust" width="100px"/>
           <el-table-column show-overflow-tooltip label="修改原因" align="center" prop="modifyReason" width="150px">
             <template slot-scope="scope">
-                <el-input :disabled="lineDisable" v-model="scope.row.modifyReason"/>
+                <el-input :disabled="scope.row.status !== '1'|| lineDisable" v-model="scope.row.modifyReason"/>
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
           <el-table-column show-overflow-tooltip label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/>
           <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="finalBuyQty" width="150">
             <template slot-scope="scope">
-                <el-input :disabled="lineDisable" v-model="scope.row.finalBuyQty"/>
+                <el-input :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty"/>
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip label="二级品类" align="center" prop="materialClassifyTwoName" width="150px"/>
@@ -304,15 +306,15 @@
           <el-table-column show-overflow-tooltip label="四级品类" align="center" prop="materialClassifyFourName" width="150px"/>
           <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyerName" width="150px">
             <template slot-scope="scope">
-                <el-input :disabled="lineDisable" size="small" v-model="scope.row.buyerName">
-                  <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '采购员')"></el-button>
+                <el-input :disabled="scope.row.status !== '1' || lineDisable" size="small" v-model="scope.row.buyerName">
+                  <el-button size="small" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '采购员')"></el-button>
                 </el-input>
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip label="默认采购组织" align="center" prop="purchaseOrgName" width="280px">
             <template slot-scope="scope">
-                <el-input :disabled="lineDisable" size="small" v-model="scope.row.purchaseOrgName">
-                  <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '默认采购组织')"></el-button>
+                <el-input :disabled="scope.row.status !== '1' || lineDisable" size="small" v-model="scope.row.purchaseOrgName">
+                  <el-button size="small" :disabled="scope.row.status !== '1' || lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '默认采购组织')"></el-button>
                 </el-input>
             </template>
           </el-table-column>
@@ -344,6 +346,7 @@
         </el-table>
 
         <el-pagination
+          background
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
           :current-page="1"
@@ -598,6 +601,9 @@ export default {
       console.log('Lists`````',this.tableList)
       this.lineDisable = false
     },
+    cancelEdit() {
+      this.lineDisable = true
+    },
     saveList() {
       editSummaryList(this.tableList).then(res => {
         if (res.code === 200) {
@@ -657,10 +663,11 @@ export default {
       } 
     },
     // 搜索区参照选择
-    chooseRefer(type, isPage, title) {
+    chooseRefer(type, isPage, title, stordocId) {
       this.referCondition.type = type
       this.referCondition.isPage = isPage
       this.referCondition.title = title
+      this.referCondition.stordocId = stordocId
       this.$refs.refer.init(this.referCondition)
     },
     selectionsToInput(selection) {
@@ -756,4 +763,8 @@ export default {
 .hang ::v-deep .el-form-item__content{
   margin-left: 0px !important;
 }
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
 </style>

+ 18 - 11
src/views/purchase/PurchaseDemandList/add.vue

@@ -41,7 +41,7 @@
           </el-col>
 
          <el-col :span="1.5">
-            <el-form-item label="需求客户" prop="customer" :rules="{ required: true, message: '请选择需求客户', trigger: 'blur' }">
+            <el-form-item label="需求客户">
               <el-select clearable size="small" v-model="basicForm.customer" :disabled="sonDisable" @clear="cleanCustomer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
                 <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
@@ -247,7 +247,7 @@
             </el-table-column>
             <el-table-column show-overflow-tooltip label="预留周期" align="center" prop="reservedPeriod" width="150px">
               <template slot-scope="scope">
-                <el-form-item class="hang">
+                <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'reservedPeriod'" :rules="{ required: isYl, message: '请填写预留周期', trigger: 'blur' }">
                   <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.reservedPeriod"/>
                 </el-form-item>
               </template>
@@ -423,7 +423,7 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column show-overflow-tooltip label="收货地址编码" align="center" prop="deliveryAddress" width="200px"></el-table-column>
+          <!-- <el-table-column show-overflow-tooltip label="收货地址编码" align="center" prop="deliveryAddress" width="200px"></el-table-column> -->
           <el-table-column show-overflow-tooltip label="联系人" align="center"  prop="contacts"/>
           <el-table-column show-overflow-tooltip label="联系人电话" align="center"  prop="contactsPhone" width="200px"/>
           <el-table-column show-overflow-tooltip label="详细地址" align="center"  prop="address" width="200px"/>
@@ -550,8 +550,7 @@ export default {
       deptOptions: [],
       customerOptions: [],
       isBDXQ: false,
-      // 刷新表格数据
-      refreshData: 0
+      isYl: false
     }
   },
   created() {
@@ -602,7 +601,13 @@ export default {
     },
     // 获取预留数量
     getYLSL(scope) {
-      scope.row.reservedQty = scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty
+      scope.row.reservedQty = Math.ceil(scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty)
+      // 如果选择预留比例,预留周期必填
+      if(scope.row.reservedQty && scope.row.reservedQty !== 0) {
+        this.isYl = true
+      } else {
+        this.isYl = false
+      }
     },
     copy() {
       this.$modal.msgSuccess("复制成功");
@@ -790,11 +795,11 @@ export default {
     },
     back() {
       this.$emit('jugislist', true)
-      let queryParams = {
-        pageNum: 1,
-        pageSize: 10
-      }
-      this.$emit('refresh', queryParams)
+      // let queryParams = {
+      //   pageNum: 1,
+      //   pageSize: 10
+      // }
+      // this.$emit('refresh', queryParams)
     },
     // 如果需要回显则调用详情接口
     getDetails(row) {
@@ -980,6 +985,8 @@ export default {
       // 物料存储条件和运输条件
       this.basicForm.puDemandItemList[this.tableIndex].transportationCondition = selection[0].transportationCondition
       this.basicForm.puDemandItemList[this.tableIndex].storageCondition = selection[0].storageCondition
+      // 选中骨科耗材时候的物料,需求客户不必填
+      
     },
     // 明细行选择业务部门参照带出业务部门数据
     chooseDept(index, type, isPage, title) {

+ 129 - 107
src/views/purchase/PurchaseDemandList/index.vue

@@ -1,115 +1,130 @@
 <template>
   <div id="PurchaseDemandList">
     <div v-if="isList">
-      <el-form class="search_area" label-width="100px">
-        <el-row :gutter="10">
-          <el-col :span="1.5">
-            <el-form-item label="单据编码">
-              <el-input
-                v-model.trim="queryParams.code"
-                size="small"
-                clearable
-                style="width: 200px"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="需求客户">
-              <el-select clearable size="small" v-model="queryParams.customer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
-                <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="是否客户指定">
-              <el-select clearable v-model="queryParams.isProcess" size="small" style="width: 200px" placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="" label-width="20px">
-              <el-button type="primary" size="small" icon="el-icon-search" plain @click="searchList">搜索</el-button>
-              <el-button size="small" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      <CollapseTransition>
-        <div v-show="expanded">
-        <el-row :gutter="10">
-          <el-col :span="1.5">
-            <el-form-item label="需求人员">
-              <el-select clearable size="small" v-model="queryParams.demandPersonal" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
-                <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="单据来源">
-              <el-select clearable v-model="queryParams.source" size="small" style="width: 200px">
-                <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="业务类型">
-              <el-select clearable v-model="queryParams.billType" size="small" style="width: 200px">
-                <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
+      <el-card>
+        <el-form class="search_area" label-width="100px">
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-form-item label="单据编码">
+                <el-input
+                  v-model.trim="queryParams.code"
+                  size="small"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="需求客户">
+                <el-select clearable size="small" v-model="queryParams.customer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
+                  <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="是否客户指定">
+                <el-select clearable v-model="queryParams.isProcess" size="small" style="width: 200px" placeholder="请选择">
+                  <el-option
+                    v-for="item in options"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="" label-width="20px">
+                <el-button type="primary" size="small" icon="el-icon-search" plain @click="searchList">搜索</el-button>
+                <el-button size="small" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        <CollapseTransition>
+          <div v-show="expanded">
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-form-item label="需求人员">
+                <el-select clearable size="small" v-model="queryParams.demandPersonal" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
+                  <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="单据来源">
+                <el-select clearable v-model="queryParams.source" size="small" style="width: 200px">
+                  <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="业务类型">
+                <el-select clearable v-model="queryParams.billType" size="small" style="width: 200px">
+                  <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
 
-        <el-row :gutter="10">
-          <el-col :span="1.5">
-            <el-form-item label="需求部门">
-              <el-select clearable v-model="queryParams.demandDept" size="small" :disabled="disable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
-                <el-option
-                  v-for="item in deptOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="需求日期">
-              <el-date-picker
-                v-model="queryParams.demandDate"
-                type="date"
-                clearable
-                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-input
-                v-model.trim="queryParams.remark"
-                size="small"
-                clearable
-                style="width: 200px"
-              />
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-form-item label="需求部门">
+                <el-select clearable v-model="queryParams.demandDept" size="small" :disabled="disable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
+                  <el-option
+                    v-for="item in deptOptions"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id">
+                  </el-option>
+                </el-select>
               </el-form-item>
             </el-col>
-        </el-row>
-        </div>
-      </CollapseTransition>
-      </el-form>
-      <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
+            <el-col :span="1.5">
+              <el-form-item label="需求日期">
+                <el-date-picker
+                  v-model="queryParams.demandDate"
+                  type="date"
+                  clearable
+                  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-input
+                  v-model.trim="queryParams.remark"
+                  size="small"
+                  clearable
+                  style="width: 200px"
+                />
+                </el-form-item>
+              </el-col>
+          </el-row>
 
-      <el-card>
+          <el-row :gutter="10">
+            <el-col>
+              <el-form-item label="物料编码">
+                <el-input
+                  v-model.trim="queryParams.materialCode"
+                  size="small"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          </div>
+        </CollapseTransition>
+        </el-form>
+        <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
+
+        
         <div class="btn_grooup">
           <el-button type="primary" size="small" @click="addDivision">新增</el-button>
 
@@ -139,7 +154,7 @@
         <el-table 
           :data="tableList" 
           fit
-          max-height="350"
+          max-height="550"
           @selection-change="handleSelectionChange"
         >
           <el-table-column show-overflow-tooltip type="selection" width="55" />
@@ -173,6 +188,7 @@
         </el-table>
 
         <el-pagination
+          background
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
           :current-page="1"
@@ -269,6 +285,7 @@ export default {
         demandDept: '',
         demandDate: '',
         remark: '',
+        materialCode: '',
         pageNum: 1,
         pageSize: 5
       },
@@ -353,6 +370,7 @@ export default {
         demandDept: '',
         demandDate: '',
         remark: '',
+        materialCode: '',
         pageNum: 1,
         pageSize: 5
       }
@@ -531,7 +549,7 @@ export default {
       }
       if (this.referCondition.type == 'CONTACTS_PARAM') {
         this.personOptions = selection
-        this.queryParams.demandPersonal = selection[0].id
+        this.queryParams.demandPersonal = selection[0].code
       }
       if (this.referCondition.type == 'DEPT_PARAM') {
         this.deptOptions = selection
@@ -557,4 +575,8 @@ export default {
 .lines {
   margin-top: 0;
 }
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
 </style>

+ 96 - 44
src/views/purchase/PurchaseDemandList/reserved.vue

@@ -1,55 +1,105 @@
 <template>
   <div class="reserved">
     <el-dialog
-      title="货权预留单"
       :visible.sync="visible"
       :before-close="handleClose"
       width="70%"
     >
-      <el-table :data="tableList1">
-        <el-table-column property="date" label="预留单型号" width="150"></el-table-column>
-        <el-table-column property="date" label="来源单据号" width="150"></el-table-column>
-        <el-table-column property="date" label="客户" width="150"></el-table-column>
-        <el-table-column property="date" label="客户名称" width="150"></el-table-column>
-        <el-table-column property="date" label="创建人" width="150"></el-table-column>
-        <el-table-column property="date" label="创建人名称" width="150"></el-table-column>
-        <el-table-column property="date" label="创建时间" width="150"></el-table-column>
-        <el-table-column property="date" label="更新人" width="150"></el-table-column>
-        <el-table-column property="date" label="更新人名称" width="150"></el-table-column>
-        <el-table-column property="date" label="更新时间" width="150"></el-table-column>
-      </el-table>
+    <el-descriptions class="margin-top" title="货权预留单" :column="3" size="small" border>
+      <el-descriptions-item>
+        <template slot="label">
+          预留单据号
+        </template>
+        {{ resData.code }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">
+          来源单据号
+        </template>
+        {{ resData.source }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">
+          客户
+        </template>
+        {{ resData.customer }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">
+          客户名称
+        </template>
+        {{ resData.customerName }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">
+          创建人
+        </template>
+        {{ resData.createBy }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">
+          创建人名称
+        </template>
+        {{ resData.createByName }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">
+          创建时间
+        </template>
+        {{ resData.createTime }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">
+          更新人
+        </template>
+        {{ resData.updateBy }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">
+          更新人名称
+        </template>
+        {{ resData.updateByName }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label">
+          更新时间
+        </template>
+        {{ resData.updateTime }}
+      </el-descriptions-item>
+    </el-descriptions>
+
       <el-table style="margin-top: 50px" :data="tableList2">
-        <el-table-column property="date" label="物料编码" width="150"></el-table-column>
-        <el-table-column property="date" label="物料名称" width="150"></el-table-column>
-        <el-table-column property="date" label="单位" width="150"></el-table-column>
-        <el-table-column property="date" label="单位名称" width="150"></el-table-column>
-        <el-table-column property="date" label="预留数量" width="150"></el-table-column>
-        <el-table-column property="date" label="预留比例" width="150"></el-table-column>
-        <el-table-column property="date" label="预留周期" width="150"></el-table-column>
-        <el-table-column property="date" label="仓库" width="150"></el-table-column>
-        <el-table-column property="date" label="仓库名称" width="150"></el-table-column>
-        <el-table-column property="date" label="货位" width="150"></el-table-column>
-        <el-table-column property="date" label="货位名称" width="150"></el-table-column>
-        <el-table-column property="date" label="可用量" width="150"></el-table-column>
-        <el-table-column property="date" label="已用量" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="material" label="物料编码" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="materialName" label="物料名称" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="unit" label="单位" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="unitName" label="单位名称" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="reservedQty" label="预留数量" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="reservedProportion" label="预留比例" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="reservedPeriod" label="预留周期" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="warehouse" label="仓库" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="warehouseName" label="仓库名称" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="allocation" label="货位" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="allocationName" label="货位名称" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="qty" label="可用量" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="usedQty" label="已用量" width="150"></el-table-column>
       </el-table>
       <el-table style="margin-top: 50px" :data="tableList3">
-        <el-table-column property="date" label="物料编码" width="150"></el-table-column>
-        <el-table-column property="date" label="物料名称" width="150"></el-table-column>
-        <el-table-column property="date" label="单位" width="150"></el-table-column>
-        <el-table-column property="date" label="单位名称" width="150"></el-table-column>
-        <el-table-column property="date" label="预留数量" width="150"></el-table-column>
-        <el-table-column property="date" label="预留比例" width="150"></el-table-column>
-        <el-table-column property="date" label="预留周期" width="150"></el-table-column>
-        <el-table-column property="date" label="调出仓库" width="150"></el-table-column>
-        <el-table-column property="date" label="调出仓库名称" width="150"></el-table-column>
-        <el-table-column property="date" label="调出货位" width="150"></el-table-column>
-        <el-table-column property="date" label="调出货位名称" width="150"></el-table-column>
-        <el-table-column property="date" label="调入仓库" width="150"></el-table-column>
-        <el-table-column property="date" label="调入仓库名称" width="150"></el-table-column>
-        <el-table-column property="date" label="调入货位" width="150"></el-table-column>
-        <el-table-column property="date" label="调入货位名称" width="150"></el-table-column>
-        <el-table-column property="date" label="调拨数量" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="material" label="物料编码" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="materialName" label="物料名称" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="unit" label="单位" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="unitName" label="单位名称" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="reservedQty" label="预留数量" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="reservedProportion" label="预留比例" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="reservedPeriod" label="预留周期" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="deliveryWarehouse" label="调出仓库" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="deliveryWarehouseName" label="调出仓库名称" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="deliveryAllocation" label="调出货位" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="deliveryAllocationName" label="调出货位名称" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="storageWarehouse" label="调入仓库" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="storageWarehouseName" label="调入仓库名称" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="storageAllocation" label="调入货位" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="storageAllocationName" label="调入货位名称" width="150"></el-table-column>
+        <el-table-column show-overflow-tooltip prop="allotQty" label="调拨数量" width="150"></el-table-column>
       </el-table>
     </el-dialog>
   </div>
@@ -76,7 +126,7 @@ export default {
   data() {
     return {
       visible:this.isVisible,
-      tableList1: [],
+      resData: {},
       tableList2: [],
       tableList3: [],
     }
@@ -85,7 +135,9 @@ export default {
     getDetails(row) {
       getResevedDetail(row.code).then(res => {
         if (res.code === 200) {
-          // this.basicForm = res.data
+          this.resData = res.data
+          this.tableList2 = res.data.stMaterialOwnershipItemList
+          this.tableList3 = res.data.stMaterialOwnershipHistoryList
         }
       })
     },

+ 75 - 57
src/views/purchase/purchase-order/add/column.js

@@ -21,7 +21,12 @@ export const Columns = [
     isShow:true,
     require: true,
   },
-  { key: "oaDemandNo", title: "OA需求单号", inputType: "Input",  isShow:true,},
+  { 
+    key: "oaDemandNo", 
+    title: "OA需求单号", 
+    inputType: "Input",  
+    isShow:true,
+  },
   {
     key: "code",
     title: "订单编号",
@@ -127,6 +132,7 @@ export const Columns = [
     inputType: "InputNumber",
     controlsPosition: "right",
     isShow:true,
+    disabled:true,
   },
   {
     key: "originalQty",
@@ -134,10 +140,11 @@ export const Columns = [
     inputType: "InputNumber",
     controlsPosition: "right",
     isShow:true,
+    disabled:true,
   },
-  { key: "money", title: "价税合计", inputType: "Input", isShow:true, },
-  { key: "originalMoney", title: "原始总金额", inputType: "Input",  isShow:true,},
-  { key: "notaxMoney", title: "无税金额", inputType: "Input",  isShow:true,},
+  { key: "money", title: "价税合计", inputType: "Input", isShow:true, disabled:true,},
+  { key: "originalMoney", title: "原始总金额", inputType: "Input",  isShow:true, disabled:true,},
+  { key: "notaxMoney", title: "无税金额", inputType: "Input",  isShow:true, disabled:true,},
   {
     key: "status",
     title: "单据状态",
@@ -146,10 +153,10 @@ export const Columns = [
     disabled: true,
     isShow:true,
   },
-  { key: "freezeCause", title: "冻结原因", inputType: "Checkbox", isShow:true, },
+  // { key: "freezeCause", title: "冻结原因", inputType: "Checkbox", isShow:true, },
   { key: "isBack", title: "退货", inputType: "Input", inputType: "Checkbox",  isShow:true,},
-  { key: "isMarketing", title: "已协同生成销售订单", inputType: "Checkbox",  isShow:true,},
-  { key: "isMarketingSource", title: "由销售订单协同生成", inputType: "Checkbox",  isShow:true,},
+  // { key: "isMarketing", title: "已协同生成销售订单", inputType: "Checkbox",  isShow:true,},
+  // { key: "isMarketingSource", title: "由销售订单协同生成", inputType: "Checkbox",  isShow:true,},
   {
     key: "warehouseName",
     title: "WMS入库仓库", 
@@ -177,13 +184,12 @@ export const Columns = [
       goodsAllocationName: 'name'
     },
      isShow:true,
-     require: true,
     queryParams: (params) => ({
       stordocId: params.warehouse,
     }),
     width: 200,
   },
-  { key: "isSendSrm", title: "是否同步SRM", inputType: "Checkbox",isShow:true, },
+  // { key: "isSendSrm", title: "是否同步SRM", inputType: "Checkbox",isShow:true, },
   { key: "isInvoice", title: "发票标识", inputType: "Checkbox", isShow:true,},
   { key: "supplierOrderNo", title: "供应商订单号", inputType: "Input",isShow:true, },
   { 
@@ -295,7 +301,13 @@ export const Columns = [
     valueFormat: "yyyy-MM-dd",
     isShow:true,
   },
-  { key: "applyPaymentMoney", title: "累计付款申请金额", inputType: "Input", isShow:true,},
+  { 
+    key: "applyPaymentMoney", 
+    title: "累计付款申请金额", 
+    inputType: "Input", 
+    isShow:true,
+    disabled:true,
+  },
   { key: "paymentMoney", title: "累计付款金额", inputType: "Input", isShow:true,},
   { key: "invoiceMoney", title: "发票金额", inputType: "Input",isShow:true, },
   {
@@ -316,7 +328,7 @@ export const Columns = [
       supplierId:params.supplier
     }),
   },
-  { key: "isDeliver", title: "是否发货", inputType: "Checkbox",  isShow:true,},
+  // { key: "isDeliver", title: "是否发货", inputType: "Checkbox",  isShow:true,},
   {
     key: "retReasonName",
     title: "退换原因",
@@ -343,7 +355,7 @@ export const Columns = [
      isShow:true,
     queryParams: () => ({}),
   },
-  { key: "isEnd", title: "整单关闭标识", inputType: "Input", isShow:true, },
+  { key: "isEnd", title: "整单关闭标识", inputType: "Checkbox", isShow:true, },
   {
     key: "projectNowName",
     title: "在建工程项目",
@@ -375,24 +387,24 @@ export const Columns = [
   { key: "midOrderNo", title: "中台采购订单号", inputType: "Input", isShow:true, },
   { key: "marketingCode", title: "销售订单号", inputType: "Input", isShow:true, },
   { key: "isArrival", title: "到货超期", inputType: "Checkbox",  isShow:true,},
-  { key: "createByName", title: "创建人名称", inputType: "Input", isShow:false, },
-  { key: "updateByName", title: "更新人名称", inputType: "Input", isShow:false, },
-  { key: "flowId", title: "OA流程ID", inputType: "Input", isShow:false, },
-  { key: "approver", title: "审批人", inputType: "Input", isShow:false, },
+  { key: "createByName", title: "创建人", inputType: "Input", isShow:false, },
   {
-    key: "approverFinishTime",
-    title: "审批时间",
+    key: "approveTime",
+    title: "提交时间",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
     isShow:false,
   },
+  { key: "approver", title: "审批人", inputType: "Input", isShow:false, },
   {
-    key: "approveTime",
-    title: "提交时间",
+    key: "approverFinishTime",
+    title: "审批时间",
     inputType: "DatePicker",
     valueFormat: "yyyy-MM-dd",
     isShow:false,
   },
+  { key: "updateByName", title: "更新人", inputType: "Input", isShow:false, },
+  // { key: "flowId", title: "OA流程ID", inputType: "Input", isShow:false, },
   {
     key: "sysFileRecordList",
     title: "附件",
@@ -438,7 +450,7 @@ export const TabColumns = [
           material: "id",
           materialName: "name",
           materialCode: "code",
-          materialClassify:'classifyIdName',
+          // materialClassify:'classifyIdName',
           materialManufacturersCode:'manufacturersMaterialCode',
           specification:'specification',
           model:'model',
@@ -468,14 +480,14 @@ export const TabColumns = [
         disabled:true,
         readonly:true,
       },
-      { //classifyIdName   classifyId
-        key: "materialClassify",
-        title: "物料分类", 
-        inputType: "Input",
-        width: 180,
-        disabled:true,
-        readonly:true, 
-      },
+      // { //classifyIdName   classifyId
+      //   key: "materialClassify",
+      //   title: "物料分类", 
+      //   inputType: "Input",
+      //   width: 180,
+      //   disabled:true,
+      //   readonly:true, 
+      // },
       { // manufacturersMaterialCode  manufacturersMaterialName
         key: "materialManufacturersCode",
          title: "厂家物料编码", 
@@ -549,23 +561,38 @@ export const TabColumns = [
         queryParams: () => ({}),
         width: 180,
       },
+      {
+        key: "priceType",
+        title: "价格类型",
+        inputType: "Select",
+        referName: "sys_price_type", // 字典名
+        width: 180,
+      },
       { 
         key: "taxPrice", 
         title: "含税单价", 
         inputType: "Input",
         require: true,
+        disabled:true,
         width: 120,
        },
-      { key: "money", title: "价税合计", inputType: "Input", },
+      { key: "money", title: "价税合计", inputType: "Input",disabled:true, },
       { //materialRate  materialRateName
         key: "tax", 
         title: "税率",
         inputType: "Input",
+        disabled:true,
       },
-      { key: "taxDeductMoneya", title: "折扣金额", inputType: "Input", },
-      { key: "arrivalQty", title: "已到货数量", inputType: "Input", },
-      { key: "unarrivedQty", title: "未到货数量", inputType: "Input", },
-      { key: "notaxMoney", title: "无税金额", inputType: "Input", },
+      { key: "taxDeductMoneya", title: "折扣金额", inputType: "Input",disabled:true, },
+      { key: "arrivalQty", title: "已到货数量", inputType: "Input", disabled:true,},
+      { key: "unarrivedQty", title: "未到货数量", inputType: "Input", disabled:true,},
+      { 
+        key: "price",
+        title: "无税单价",
+        inputType: "Input",
+        disabled:true,
+      },
+      { key: "notaxMoney", title: "无税金额", inputType: "Input", disabled:true,},
       // { key: "priceSource", title: "价格目录ID", inputType: "Input", },
       { key: "isStorage", title: "入库关闭", inputType: "Checkbox", },
       { key: "isInvoice", title: "开票关闭", inputType: "Checkbox", },
@@ -651,9 +678,9 @@ export const TabColumns = [
 
       { key: "isBatchLock", title: "批号锁定标识", inputType: "Checkbox", },
       { key: "isReplenishment", title: "补单标识", inputType: "Checkbox", },
-      { key: "isUrgency", title: "紧急标识", inputType: "Input", },
-      { key: "originalQty", title: "原始数量", inputType: "Input", },
-      { key: "originalMoney", title: "原始金额", inputType: "Input", },
+      { key: "isUrgency", title: "紧急标识", inputType: "Checkbox", },
+      { key: "originalQty", title: "原始数量", inputType: "Input", disabled:true,},
+      { key: "originalMoney", title: "原始金额", inputType: "Input", disabled:true,},
       { key: "directProductBatch", title: "直运产品批号", inputType: "Input", width: 180 },
       { key: "discountRule", title: "折扣规则编码", inputType: "Input", width: 180 },
       { key: "reservedQty", title: "预留数量", inputType: "Input", },
@@ -670,19 +697,12 @@ export const TabColumns = [
       { key: "sourceId", title: "上游单据ID", inputType: "Input", width: 180 },
       { key: "demandCode", title: "采购需求单号", inputType: "Input", width: 180 },
       { key: "arrivalDatePlan", title: "计划到货日期", inputType: "Input", width: 180 },
-      {
-        key: "priceType",
-        title: "价格类型",
-        inputType: "Select",
-        referName: "sys_price_type", // 字典名
-        width: 180,
-      },
-      { key: "isDistributionPrice", title: "配送价", inputType: "Input", },
-      { key: "createByName", title: "创建人名称", inputType: "Input", },
-      { key: "updateByName", title: "更新人名称", inputType: "Input", },
+     
+      { key: "isDistributionPrice", title: "配送价", inputType: "Checkbox", },
+     
       { //threeClass
         key: "materialClassifyOneName", 
-        title: "物料一级分类名称", 
+        title: "物料一级分类", 
         inputType: "Input",
         width: 180,
         disabled:true,
@@ -690,7 +710,7 @@ export const TabColumns = [
       },
       { //twoClass
         key: "materialClassifyTwoName",
-        title: "物料二级分类名称", 
+        title: "物料二级分类", 
         inputType: "Input",
         width: 180,
         disabled:true,
@@ -698,7 +718,7 @@ export const TabColumns = [
       },
       { //threeClass
         key: "materialClassifyThreeName", 
-        title: "物料三级分类名称", 
+        title: "物料三级分类", 
         inputType: "Input", 
         width: 180,
         disabled:true,
@@ -706,17 +726,15 @@ export const TabColumns = [
       },
       { //fourClass
         key: "materialClassifyFourName", 
-        title: "物料四级分类名称",
+        title: "物料四级分类",
         inputType: "Input", 
         width: 180,
         disabled:true,
         readonly:true,
       },
-      { 
-        key: "price",
-        title: "无税单价",
-        inputType: "Input",
-      }
+      { key: "createByName", title: "创建人", inputType: "Input", },
+      { key: "updateByName", title: "更新人", inputType: "Input", },
+      
     ]
   },
   {
@@ -742,7 +760,7 @@ export const TabColumns = [
           material: "id",
           materialName: "name",
           materialCode: "code",
-          materialClassify:'classifyIdName',
+          // materialClassify:'classifyIdName',
           materialManufacturersCode:'manufacturersMaterialCode',
           specification:'specification',
           model:'model',

+ 126 - 24
src/views/purchase/purchase-order/add/index.vue

@@ -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);
@@ -67,7 +68,6 @@ export default {
       handler(nVal, oVal) {
         // 组织变化
         if (this.visible && nVal.puOrg != oVal.puOrg) {
-          console.log(nVal.puOrg, "nVal.puOrg", oVal.puOrg, "oVal.puOrg");
           for (const key in this.params) {
             if (Array.isArray(this.params[key])) {
               this.params[key] = [];
@@ -110,7 +110,6 @@ export default {
     },
     // 复制赋值
     async setCopyParams(id) {
-      console.log(id, "iid-----------------------");
       try {
         const { code, msg, data } = await orderApi.details(id);
 
@@ -245,6 +244,7 @@ export default {
          console.log(isPrice,'isPrice');
           cb();
         } else {
+          this.$message.error('存在必填项未填写');
           console.log('error submit!!');
           return false;
         }
@@ -292,39 +292,142 @@ export default {
         }
       })
     },
+    // 主表参照改变之后
+   async handleReferChange(val, source, type){
+     console.log(val,'val-------------------');
+      // 供应商选择  
+      if( type === 'SUPPLIER_PARAM' ){
+
+        let page = { pageNum: 1 , pageSize: 10 };
+
+        let relevanceRefer = [
+          {
+            // 供应商联系人
+            key:'supplierContacts',
+            params:{
+              type:'SUPPLIERCONTACTS_PARAM',
+              supplierId:val.id,
+            }
+          },
+          {
+            // 供应商业务员
+            key:'supplierPersonal',
+            params:{
+              type:'PSNLICENSE_PARAM',
+              supplierId:val.id,
+              pkOrg: source.puOrg,
+            }
+          }
+        ]
+
+      await  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) {}
+          
+        })
+        
+      }
+    },
+
+    // 下拉框选择改变
+    handleSelectChange(val,typeName){
+
+      if(val === 'billType'){
+
+      this.params['billTypeName'] = this.dict.type[typeName].find(item => item.value == this.params[val]).label;
+
+      }
+
+    },
+
+
     // 子表参照改变之后
-    handleReferChange(val, source, type) {
-      console.log(val, "val");
-      console.log(source, "source");
-      console.log(type, "type");
+   async handleTabReferChange(val, source, type) {
 
-      // 触发物料参照询价
+      // 触发物料参照询价   && source.qty && source.qty != ""
       if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
-        this.handleGetPrice();
+
+        source['qty'] = 0;
+
+        source['whetherCompleteInquiry'] = false;
+
+        source['taxPrice'] = 0;
+
+        source['money'] = 0;
+
+        source['taxDeductMoneya'] = 0;
+
+        source['price'] = 0;
+        
+        source['notaxMoney'] = 0;
+
+        source['tax'] = 0;
+
+        this.params['qty'] = 0;
+        this.params['originalQty'] = 0;
+        this.params['money'] = 0;
+        this.params['originalMoney'] = 0;
+        this.params['notaxMoney'] = 0;
+        source.isDrug = val.materialMedcine.isDrug  == '0' ? 'Y' : 'N';
+
+        await this.handleGetPrice();
+
       }
 
-      // if(type == "MATERIAL_PARAM"){
-      //   source.isDrug = val.materialMedcine.isDrug  == '0' ? 'Y' : 'N';
-      // }
     },
 
     // 子表下拉框改变
-    handleSelectChange(type,row){
-      console.log(type,'type');
-
+    async handleTabSelectChange(type,row){
+     
       if(type == 'priceType' && row.material && row.qty && row.qty != ""){
-        this.handleGetPrice();
+
+        row['whetherCompleteInquiry'] = false;
+
+        await this.handleGetPrice();
       }
     },
 
     // 子表inputNumber
     handleInputChange(row, type) {
-      console.log(type, "type");
       // 物料数量变化----询价
       if (type == "qty" && row.material) {
+
+        row['whetherCompleteInquiry'] = false;
+
         this.handleGetPrice();
+
       }
     },
+
+    // 子表多选框改变
+    handleTabCheckbox(type,source){
+
+      // 勾选赠品,价税合计更新为0,含税单价、无税单价更新为0
+      if(type === 'isGift' && source.material && source.qty && source.qty != ""){
+
+        source['whetherCompleteInquiry'] = false;
+
+        this.handleGetPrice()
+      }
+
+    },
     // 询价 getPrice
     async handleGetPrice() {
       try {
@@ -338,12 +441,7 @@ export default {
       }
     },
 
-    // 下拉框选择改变
-    handleChangeSelect(val,typeName){
-      if(val === 'billType'){
-       this.params['billTypeName'] = this.dict.type[typeName].find(item => item.value == this.params[val]).label;
-      }
-    },
+    
 
   },
   created() {
@@ -430,6 +528,7 @@ export default {
                 :placeholder="column.placeholder"
                 :data-mapping="column.dataMapping"
                 :query-params="column.queryParams"
+                @change="handleReferChange"
               ></dr-popover-select>
 
               <el-input
@@ -459,6 +558,7 @@ export default {
                 :clearable="column.clearable"
                 :placeholder="column.placeholder"
                 style="width: 100%"
+                @change="handleSelectChange(column.key,column.referName)"
               >
                 <el-option
                   v-for="item in dict.type[column.referName]"
@@ -575,7 +675,7 @@ export default {
                       :placeholder="cColumn.placeholder"
                       :data-mapping="cColumn.dataMapping"
                       :query-params="cColumn.queryParams"
-                      @change="handleReferChange"
+                      @change="handleTabReferChange"
                       size="mini"
                     >
                     </dr-popover-select>
@@ -595,12 +695,13 @@ export default {
                     <el-select
                       v-if="cColumn.inputType === 'Select'"
                       v-model="scope.row[cColumn.key]"
+                      
                       size="mini"
                       :disabled="cColumn.disabled"
                       :clearable="cColumn.clearable"
                       :placeholder="cColumn.placeholder"
                       style="width: 100%"
-                      @change="handleSelectChange(cColumn.key,scope.row)"
+                      @change="handleTabSelectChange(cColumn.key,scope.row)"
                     >
                       <el-option
                         v-for="item in dict.type[cColumn.referName]"
@@ -616,6 +717,7 @@ export default {
                       :disabled="cColumn.disabled"
                       true-label="Y"
                       false-label="N"
+                      @change="handleTabCheckbox(cColumn.key,scope.row)"
                     ></el-checkbox>
                   </el-form-item>
                 </template>

+ 51 - 55
src/views/purchase/purchase-order/column.js

@@ -15,7 +15,7 @@ export const TableColumns = [
     inputType: "Select",
     referName: "sys_order_type",
   },
-  { key: "code", title: "订单编号",  inputType: "Input" },
+  { key: "code", title: "订单编号",  inputType: "Input",width:150, },
   {
     key: "status",
     title: "单据状态",
@@ -23,7 +23,7 @@ export const TableColumns = [
     width:80,
     referName: "documents_status", // 字典名
   },
-  { key: "billDate", title: "订单日期" },
+  { key: "billDate", title: "订单日期",width:100,},
   // { key: "supplier", title: "供应商" },
   { key: "supplierName", title: "供应商", inputType: "Input" },
   { key: "paymentAgreementName", title: "付款协议" },
@@ -37,16 +37,17 @@ export const TableColumns = [
   // { key: "paymentAgreement", title: "付款协议" },
   
   // { key: "buyer", title: "采购员" },ut
-  { key: "buyerName", title: "采购员" },
+  { key: "buyerName", title: "采购员" ,width:100,},
   // { key: "puDept", title: "采购部门" },
   { key: "puDeptName", title: "采购部门" },
   // { key: "customer", title: "收货客户" },
   { key: "customerName", title: "收货客户" },
-  { 
-    key: "isDeliver", 
-    title: "是否发货",
-    inputType: 'Checkbox',
-   },
+  // { 
+  //   key: "isDeliver", 
+  //   title: "是否发货",
+  //   inputType: 'Checkbox',
+  //   width:80,
+  //  },
   {
     key: "isArrival",
     title: "到货超期",
@@ -60,20 +61,20 @@ export const TableColumns = [
     width:80,
   },
   // { key: "freezeCause", title: "冻结原因" },
-  { key: "qty", title: "总数量" },
-  { key: "money", title: "总数量" },
-  {
-    key: "isMarketing",
-    title: "已协同生成销售订单",
-    inputType: 'Checkbox',
-  },
-  {
-    key: "isMarketingSource",
-    title: "由销售订单协同生成",
-    inputType: 'Checkbox',
-  },
+  { key: "qty", title: "总数量",width:100, },
+  { key: "money", title: "价税合计",width:100, },
+  // {
+  //   key: "isMarketing",
+  //   title: "已协同生成销售订单",
+  //   inputType: 'Checkbox',
+  // },
+  // {
+  //   key: "isMarketingSource",
+  //   title: "由销售订单协同生成",
+  //   inputType: 'Checkbox',
+  // },
   // { key: "personal", title: "人员" },
-  { key: "personalName", title: "人员" },
+  { key: "personalName", title: "人员" ,width:120,},
   // { key: "isSendSrm", title: "是否同步SRM" },
   {
     key: "isInvoice",
@@ -81,8 +82,8 @@ export const TableColumns = [
     inputType: 'Checkbox',
     width:80,
   },
-  { key: "rebateMoney", title: "订单使用返利金额" },
-  { key: "deductionMoney", title: "订单抵扣余款金额" },
+  { key: "rebateMoney", title: "订单使用返利金额" ,},
+  { key: "deductionMoney", title: "订单抵扣余款金额" ,},
   // { key: "warehouse", title: "WMS入库仓库" },
   { key: "warehouseName", title: "收货仓库" }, //WMS入库仓库名称
   // { key: "goodsAllocation", title: "货位" },
@@ -111,19 +112,7 @@ export const TableColumns = [
   // { key: "supplierPersonal", title: "供应商业务员" },
   { key: "supplierPersonalName", title: "供应商业务员" },
   { key: "marketingCode", title: "销售订单号" },
-  // { key: "tenantId", title: "租户号" },
-  // { key: "revision", title: "乐观锁" },
-  { key: "createByName", title: "创建人" },
-  { key: "updateByName", title: "更新人" },
-  // { key: "delFlag", title: "删除标记" },
-  { key: "flowId", title: "OA流程ID" },
-  { key: "approver", title: "审批人" },
-  { key: "approverFinishTime", title: "审批时间" },
-  { key: "approveTime", title: "提交时间" },
-  { key: "createTime", title: "制单日期/创建时间" },
-  { key: "remark", title: "备注" },
-  { key: "updateTime", title: "最后修改时间" },
-
+  // { key: "flowId", title: "OA流程ID" },
   { key: "oaDemandNo", title: "OA需求单号" },
   { key: "address", title: "收货地址" },
   { key: "contacts", title: "收获联系人" },
@@ -136,11 +125,19 @@ export const TableColumns = [
   { key: "retReasonName", title: "退换原因" },
   { key: "closeTime", title: "最终关闭日期" },
   { key: "processTypeName", title: "处理方式" },
-  { key: "isEnd", title: "整单关闭标识" },
+  { key: "isEnd", title: "整单关闭标识" ,inputType: "Checkbox"},
   { key: "projectNowName", title: "在建工程项目" },
   { key: "operatingItemsName", title: "经营性项目" },
   { key: "isArrivalReson", title: "到货超期原因" },
-  { key: "midOrderNo", title: "中台采购订单号" },
+  { key: "createByName", title: "创建人" ,width:100,},
+  { key: "createTime", title: "制单日期/创建时间", },
+  { key: "approveTime", title: "提交时间" ,width:100,},
+  { key: "approver", title: "审批人" ,width:100,},
+  { key: "approverFinishTime", title: "审批时间",width:100, },
+  { key: "updateByName", title: "更新人" ,width:100,},
+  { key: "updateTime", title: "最后修改时间" },
+  { key: "remark", title: "备注" },
+  // { key: "midOrderNo", title: "中台采购订单号" },
 ];
 
 export const TabColumns = [
@@ -148,12 +145,12 @@ export const TabColumns = [
     title: '物料信息',
     key: 'puOrderItemList',
     tableColumns: [
-      { key: "rowNo", title: "行号" },
+      { key: "rowNo", title: "行号",width:80, },
       // { key: "orderId", title: "采购订单ID" },
-      { key: "material", title: "物料" },
+      { key: "material", title: "物料ID" },
       { key: "materialName", title: "物料名称", width: 180 },
       { key: "materialCode", title: "物料编码", width: 180 },
-      { key: "materialClassify", title: "物料分类", width: 180 },
+      // { key: "materialClassify", title: "物料分类", width: 180 },
       { key: "materialManufacturersCode", title: "厂家物料编码", width: 180 },
       { key: "specification", title: "规格", width: 180 },
       { key: "model", title: "型号", width: 180 },
@@ -173,13 +170,14 @@ export const TabColumns = [
       { key: "unitName", title: "单位", width: 180 },
       { key: "qty", title: "数量" },
       // { key: "currency", title: "币种" },
-      // { key: "currencyName", title: "币种" },
+      { key: "currencyName", title: "币种" },
       { key: "taxPrice", title: "含税单价" },
       { key: "money", title: "价税合计" },
       { key: "tax", title: "税率" },
       { key: "taxDeductMoneya", title: "折扣金额" },
       { key: "arrivalQty", title: "已到货数量" },
       { key: "unarrivedQty", title: "未到货数量" },
+      { key: "price", title: "无税单价" },
       { key: "notaxMoney", title: "无税金额" },
       { key: "priceSource", title: "价格目录ID" },
       {
@@ -244,7 +242,12 @@ export const TabColumns = [
         inputType: 'Checkbox',
         width:80,
       },
-      { key: "isUrgency", title: "紧急标识" },
+      { 
+        key: "isUrgency", 
+        title: "紧急标识" ,
+        inputType: 'Checkbox',
+        width:80,
+      },
       { key: "originalQty", title: "原始数量" },
       { key: "originalMoney", title: "原始金额" },
       { key: "directProductBatch", title: "直运产品批号", width: 180 },
@@ -269,20 +272,13 @@ export const TabColumns = [
         inputType: 'Checkbox',
         width:80,
        },
-      // { key: "tenantId", title: "租户号" },
-      // { key: "revision", title: "乐观锁" },
-      { key: "createByName", title: "创建人" },
-      { key: "updateByName", title: "更新人" },
-      // { key: "delFlag", title: "删除标记" },
-      // { key: "materialClassifyOne", title: "物料一级分类" },
       { key: "materialClassifyOneName", title: "物料一级分类", width: 180 },
-      // { key: "materialClassifyTwo", title: "物料二级分类" },
       { key: "materialClassifyTwoName", title: "物料二级分类", width: 180 },
-      // { key: "materialClassifyThree", title: "物料三级分类" },
       { key: "materialClassifyThreeName", title: "物料三级分类", width: 180 },
-      // { key: "materialClassifyFour", title: "物料四级分类" },
       { key: "materialClassifyFourName", title: "物料四级分类", width: 180 },
-      { key: "price", title: "无税单价" }
+      { key: "createByName", title: "创建人",width:100, },
+      { key: "updateByName", title: "更新人" ,width:100,},
+      
     ]
   },
   {
@@ -291,8 +287,8 @@ export const TabColumns = [
     tableColumns: [
       // { key: "id", title: "主键" },
       // { key: "orderId", title: "采购订单ID", width: 180 },
-      { key: "rowno", title: "行号" },
-      { key: "material", title: "物料", width: 180 },
+      { key: "rowno", title: "行号",width:80, },
+      { key: "material", title: "物料ID", width: 180 },
       { key: "materialName", title: "物料名称", width: 180 },
       { key: "specification", title: "规格" },
       { key: "qty", title: "数量" },

+ 103 - 42
src/views/purchase/purchase-order/edit/index.vue

@@ -25,6 +25,7 @@ export default {
 
       tabColumns: editTabColumns,
       tabName: "puOrderItemList",
+      count:1
     };
   },
   computed: {},
@@ -67,19 +68,33 @@ export default {
     },
     // 同步子表物料
     handleSynchronousMaterial(key1, key2) {
+      let _this = this;
       // this.params[key1]-- -> this.params[key2]
-      this.params[key1] && this.params[key1].forEach((item, index) => {
-        this.params[key2][index].material = item.material;
-        this.params[key2][index].materialName = item.materialName;
-        this.params[key2][index].materialCode = item.materialCode;
-      })
+      this.params[key1] &&
+        this.params[key1].forEach((item, index) => {
+          for (const key in item) {
+            if (key in _this.params[key2][index]) {
+              if (
+                key == "material" ||
+                key == "materialName" ||
+                key == "materialCode"
+              ) {
+                _this.params[key2][index].material = item.material;
+                _this.params[key2][index].materialName = item.materialName;
+                _this.params[key2][index].materialCode = item.materialCode;
+              } else {
+                _this.params[key2][index][key] = item[key];
+              }
+            }
+          }
+        });
     },
     // 判断属性是否禁用
-    handleIsForbidden(status) {
-      console.log(status);
-      let {  updateColumns,updateTabColumns } = forbidden(status != '2');
-      this.columns = updateColumns;
-      this.tabColumns = updateTabColumns;
+   async handleIsForbidden(status,source) {
+        let { updateColumns, updateTabColumns } = await forbidden(status != '2',source);
+        this.columns = updateColumns;
+        this.tabColumns = updateTabColumns;
+        this.count++;
     },
     // 查询详细
     async fetchItem(prop) {
@@ -88,7 +103,7 @@ export default {
         const { code, msg, data } = await orderApi.details(prop);
         if (code === 200) {
           this.params = { ...this.params, ...data };
-          this.handleIsForbidden(this.params.status);
+          this.handleIsForbidden(this.params.status,this.params.source);
         }
       } catch (err) {
         //
@@ -130,6 +145,7 @@ export default {
             }
           // 是否完成询价,新增明细行需默认明细为false
           rowData['whetherCompleteInquiry'] = false;
+          rowData['delFlag'] = '0';
 
           this.params[key].push(rowData);
         }
@@ -145,8 +161,11 @@ export default {
       // prop.splice(index, 1);
       for (const key in this.params) {
 
-        if (Array.isArray(this.params[key])) {
-          this.params[key].splice(index, 1);
+        // if (Array.isArray(this.params[key])) {
+        if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
+
+          this.params[key][index].id ? (this.params[key][index]['delFlag'] = '2') :this.params[key].splice(index, 1);
+
         }
       }
     },
@@ -183,6 +202,7 @@ export default {
           cb();
 
         } else {
+          this.$message.error('存在必填项未填写');
           console.log('error submit!!');
           return false;
         }
@@ -190,6 +210,7 @@ export default {
     },
     // 保存
      handleSava() {
+      console.log(this.params,'this.params---------');
       this.judgeSaveCondition(async()=>{
         try {
             this.loading = true;
@@ -210,38 +231,86 @@ export default {
     beforeOpen() {
     },
     // 子表参照改变之后
-    handleReferChange(val, source, type) {
-      console.log(val, 'val');
-      console.log(source, 'source');
-      console.log(type, 'type');
-
+    async handleTabReferChange(val, source, type) {
+      
       // 触发物料参照
-      if (type == 'MATERIAL_PARAM' && source.qty && source.qty != '') {
+      if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
 
-        this.handleGetPrice();
-      }
+        source['qty'] = 0;
+
+        source['whetherCompleteInquiry'] = false;
+        
+        source['taxPrice'] = 0;
+
+        source['money'] = 0;
+
+        source['taxDeductMoneya'] = 0;
+
+        source['price'] = 0;
+        
+        source['notaxMoney'] = 0;
+        
+        source['tax'] = 0;
+
+        this.params['qty'] = 0;
+        this.params['originalQty'] = 0;
+        this.params['money'] = 0;
+        this.params['originalMoney'] = 0;
+        this.params['notaxMoney'] = 0;
 
-      if(type == "MATERIAL_PARAM"){
         source.isDrug = val.materialMedcine.isDrug  == '0' ? 'Y' : 'N';
-        // return source;
+        
+        await this.handleGetPrice();
+
       }
+
+    },
+
+    // 子表Select改变之后
+     handleSelectChange(val,typeName){
+
+      if(val === 'billType'){
+
+       this.params['billTypeName'] = this.dict.type[typeName].find(item => item.value == this.params[val]).label;
+      
+      }
+
     },
 
      // 子表下拉框改变
-     handleSelectChange(type,row){
-      console.log(type,'type');
+     handleTabSelectChange(type,row){
 
       if(type == 'priceType' && row.material && row.qty && row.qty != ""){
+
+        row['whetherCompleteInquiry'] = false;
+
         this.handleGetPrice();
+
       }
     },
     // 子表inputNumber
     handleInputChange(row, type) {
-      console.log(type, 'type');
       // 物料数量变化----询价
       if (type == 'qty' && row.material) {
+
+        row['whetherCompleteInquiry'] = false;
+
         this.handleGetPrice();
+
+      }
+
+    },
+    // 子表多选框改变
+    handleTabCheckbox(type,source){
+
+      // 勾选赠品,价税合计更新为0,含税单价、无税单价更新为0
+      if(type === 'isGift' && source.material && source.qty && source.qty != ""){
+
+        source['whetherCompleteInquiry'] = false;
+
+        this.handleGetPrice()
       }
+
     },
     // 询价 getPrice
     async handleGetPrice() {
@@ -261,19 +330,9 @@ export default {
     handleIsRevise(status) {
       return status == '2';
     },
-     // 下拉框选择改变
-     handleChangeSelect(val,typeName){
-      if(val === 'billType'){
-       this.params['billTypeName'] = this.dict.type[typeName].find(item => item.value == this.params[val]).label;
-      }
-    },
-  },
-  created() {
-    console.log("EDIT CREATED");
-    console.log(this.params, 'this.params');
-
-
+    
   },
+  created() {},
   mounted() { },
   destroyed() { },
 };
@@ -288,6 +347,7 @@ export default {
     @close="$emit('close')"
     >
     <el-form 
+      :key="count"
       v-loading="loading" 
       :size="size" 
       ref="orderEditForm" 
@@ -363,7 +423,7 @@ export default {
                 :clearable="column.clearable" 
                 :placeholder="column.placeholder" 
                 style="width: 100%"
-                @change="handleChangeSelect(column.key,column.referName)"
+                @change="handleSelectChange(column.key,column.referName)"
                 >
                 <el-option 
                   v-for="item in dict.type[column.referName]" 
@@ -429,7 +489,7 @@ export default {
             :label="column.title" 
             :name="column.key"
             >
-            <el-table :data="params[column.key]" style="width: 100%">
+            <el-table :data="params[column.key].filter(item => item.delFlag === '0')" style="width: 100%">
               <el-table-column label="序号">
                 <template slot-scope="scope">
                   {{ scope.$index + 1 }}
@@ -475,7 +535,7 @@ export default {
                     :data-mapping="cColumn.dataMapping"
                     :query-params="cColumn.queryParams" 
                     size="mini" 
-                    @change="handleReferChange"
+                    @change="handleTabReferChange"
                   ></dr-popover-select>
 
                   <el-select v-if="cColumn.inputType === 'Select'" 
@@ -484,7 +544,7 @@ export default {
                     :clearable="cColumn.clearable" 
                     :placeholder="cColumn.placeholder"
                     style="width: 100%"
-                    @change="handleSelectChange(cColumn.key,scope.row)"
+                    @change="handleTabSelectChange(cColumn.key,scope.row)"
                   >
                     <el-option 
                       v-for="item in dict.type[cColumn.referName]" 
@@ -499,6 +559,7 @@ export default {
                     :disabled="cColumn.disabled" 
                     true-label="Y" 
                     false-label="N"
+                    @change="handleTabCheckbox(cColumn.key,scope.row)"
                   ></el-checkbox>
                   <el-input-number v-if="cColumn.inputType === 'InputNumber'" 
                     v-model="scope.row[cColumn.key]"

+ 31 - 9
src/views/purchase/purchase-order/edit/initColumn.js

@@ -6,7 +6,8 @@ import deepCopy from "@gby/deep-copy";
 
 export const editColumns = initColumns(Columns);
 
-export const editTabColumns = TabColumns.map((element) => ({
+export const editTabColumns = TabColumns.map((element) => 
+({
   ...element,
   tableColumns: initColumns(element.tableColumns),
 }));
@@ -21,14 +22,35 @@ editTabColumns.forEach(column => {
 
 
 // 禁用项
-export const forbidden = (isEdit) => {
+export const forbidden = (isEdit,source) => {
 
-  let updateColumns = deepCopy(editColumns);
-  let updateTabColumns = deepCopy(editTabColumns);
+  // let updateColumns = deepCopy(editColumns);
+  // let updateTabColumns = deepCopy(editTabColumns);
+  let updateColumns = _.cloneDeep(editColumns);
+  let updateTabColumns = _.cloneDeep(editTabColumns);
 
-  console.log(isEdit, 'isEdit');
-  
-  if(!isEdit){  
+  console.log(isEdit, 'isEdit',source,'source');
+  if(isEdit){
+    // 编辑
+    // 订单来源为:自动协议直采和协议直采
+    if(source === '1' || source === '2'){
+
+      updateTabColumns.forEach(tab =>{
+
+        tab.tableColumns.forEach(cColumn => {
+
+          if(cColumn.key === 'materialName' || cColumn.key === 'qty'){
+
+            cColumn.disabled = true;
+
+          }
+
+        })
+
+      })
+    }
+  }
+  else{  
 
     console.log('修订');
     // 修订
@@ -36,7 +58,7 @@ export const forbidden = (isEdit) => {
 
       if (item.key == 'buyerName' || item.key == 'puDeptName' || item.key == 'deductionMoney' ||
         item.key == 'supplierContactsName' || item.key == 'agentName' || item.key == 'isInvoice' ||
-        item.key == 'rebateMoney' || t.key == 'remark') {
+        item.key == 'rebateMoney' || item.key == 'remark') {
         item.disabled = false;
         item.readonly = false;
       } else {
@@ -46,7 +68,6 @@ export const forbidden = (isEdit) => {
     })
 
     updateTabColumns.forEach(item => {
-
       item.tableColumns.forEach(t => {
 
         if (t.key == 'unit' || t.key == 'qty' ||
@@ -68,4 +89,5 @@ export const forbidden = (isEdit) => {
 
   return { updateColumns, updateTabColumns }
 
+
 }

+ 83 - 47
src/views/purchase/purchase-order/index.vue

@@ -8,6 +8,7 @@ import {
   initColumns,
   initDicts,
 } from "@/utils/init";
+import { async } from "q";
 
 
 export default {
@@ -76,23 +77,18 @@ export default {
     },
     handleSearchChange() {
       this.isSimpleSearch = !this.isSimpleSearch;
-      // this.$notify.info({
-      //   title: this.isSimpleSearch ? "Simple Search" : "All Search",
-      // });
     },
 
     // 刷新操作
     handleRefreshList() {
+      this.page = initPage();
       this.fetchList(this.params, this.page);
     },
     // 查询操作
     handleQueryList() {
-      console.log(this.params,'this.params---------------------');
       let {date} = this.params;
-      if(date){
-        this.params.startDate = date[0];
-        this.params.endDate = date[1];
-      }
+        this.params.startDate = date ? date[0] :'';
+        this.params.endDate = date ? date[1] : '';
       this.fetchList(this.params, this.page);
     },
     // 重置操作
@@ -151,34 +147,68 @@ export default {
         // this.loading = false;
       }
     },
-    // 删除操作
-     handleDeleteList(row) {
-      try {
-        this.loading = true;
 
-        this.$confirm('此操作将删除该订单, 是否继续?', '提示', {
+    // 操作提示弹窗
+    handleConfirmTips(success){
+
+      this.$confirm('是否继续此操作?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
-        }).then( async() => {
+        }).then(() => {
+
+          success();
+
+        }).catch(() => {
+
+          this.$message({
+            type: 'info',
+            message: '已取消操作!'
+          });          
+        });
+    },
+
+    // 删除操作
+    handleDeleteList(row) {
+      try {
+        this.loading = true;
+
+        this.handleConfirmTips(async()=>{
 
           const { id } = row;
 
           const { code } = await orderApi.remove(id);
-          
+
           if (code === 200) {
 
             this.fetchList(this.params, this.page);
 
           }
+        })
 
-        }).catch(() => {
+        // this.$confirm('此操作将删除该订单, 是否继续?', '提示', {
+        //   confirmButtonText: '确定',
+        //   cancelButtonText: '取消',
+        //   type: 'warning'
+        // }).then( async() => {
 
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          });          
-        });
+        //   const { id } = row;
+
+        //   const { code } = await orderApi.remove(id);
+          
+        //   if (code === 200) {
+
+        //     this.fetchList(this.params, this.page);
+
+        //   }
+
+        // }).catch(() => {
+
+        //   this.$message({
+        //     type: 'info',
+        //     message: '已取消删除'
+        //   });          
+        // });
         
       } catch (err) {
         //
@@ -187,17 +217,21 @@ export default {
       }
     },
     // 提交
-    async handleSubmit(row) {
-      try {
+    handleSubmit(row) {
 
-        let { code } = await orderApi.submit({ puOrderId: row.id });
-
-        if (code == 200) {
+      try {
 
-          this.fetchList(this.params, this.page);
+       this.handleConfirmTips(async()=>{
 
-        }
+         let { code } = await orderApi.submit({ puOrderId: row.id });
+ 
+         if (code == 200) {
+ 
+           this.fetchList(this.params, this.page);
+ 
+         }
 
+       })
       } catch (error) {
       } finally {
       }
@@ -222,28 +256,29 @@ export default {
           cancelButtonText: '取消',
           inputPattern: /\s*\S+?/,
           inputErrorMessage: '退回原因不能为空'
-        }).then(({ value }) => {
+        }).then(async ({ value }) => {
+
           let data = {
             id: this.checkedList[0].id,
             documentIds: [],
             baskCause: value,
           };
+
           console.log(data);
+
           try {
 
-            let { code, msg } = orderApi.documentsReturn(data);
+            let { code, msg } = await orderApi.documentsReturn(data);
 
-            if (code == 200) {
+            if (code === 200) {
 
               this.fetchList(this.params, this.page);
 
             }
           } catch (error) {
-          } finally {
+            console.log(error,'error------------');
           }
-        }).catch(() => {    
-        });
-      
+        }).catch(() => {   });
       
     },
     // 判断是否满足整单关闭
@@ -261,28 +296,27 @@ export default {
 
     },
     // 整单关闭
-    async handleAllClose() {
+     handleAllClose() {
       // 未审批状态下整单关闭
       try {
 
-        let puOrderIds = this.checkedList.map(order => {
-
-          return order.id;
+        this.handleDeleteList(async() =>{
 
-        })
+          let puOrderIds = this.checkedList.map(order => {
 
-        let { code } = await orderApi.close({ puOrderIds });
+            return order.id;
 
-        if (code === 200) {
+          })
 
-          this.fetchList(this.params, this.page);
+          let { code } = await orderApi.close({ puOrderIds });
 
-        }
+          if (code === 200) {
 
-      } catch (error) {
+            this.fetchList(this.params, this.page);
 
-      } finally {
-      }
+          }
+        })
+      } catch (error) { } 
     },
     // 付款协议
     async handlePaymentRequest(){
@@ -290,6 +324,8 @@ export default {
       try {
         // let {name} = this.$store.state.user;
 
+
+
         let {code,msg} = await orderApi.payRequest();
 
         if(code == 200){

+ 73 - 10
src/views/purchase/transferOrder/add.vue

@@ -4,7 +4,7 @@
       <el-row :gutter="10">
         <el-col :span="1.5">
           <el-form-item label="调出库存组织">
-            <el-select clearable size="small" v-model="basicForm.deliveryInventoryOrg" :disabled="sonDisable" @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')" style="width: 200px">
+            <el-select clearable size="small" v-model="basicForm.deliveryInventoryOrg" :disabled="sonDisable" @change="controlCk" @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')" style="width: 200px">
               <el-option v-for="item in chuOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
           </el-form-item>
@@ -36,6 +36,7 @@
                 :disabled="sonDisable"
                 type="date"
                 clearable
+                @change="changeBillDate"
                 value-format="yyyy-MM-dd"
                 style="width: 200px">
               </el-date-picker>
@@ -73,7 +74,7 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调入库存组织">
-              <el-select clearable size="small" v-model="basicForm.storageInventoryOrg" :disabled="sonDisable" @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.storageInventoryOrg" :disabled="sonDisable" @change="controlCk" @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')" style="width: 200px">
                 <el-option v-for="item in ruOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -87,7 +88,7 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调出部门">
-              <el-select clearable size="small" v-model="basicForm.deliveryDept" :disabled="sonDisable" @focus="chooseRefer('DEPT_PARAM', true, '调出部门', basicForm.deliveryInventoryOrg)" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.deliveryDept" :disabled="sonDisable || isOrg" @focus="chooseRefer('DEPT_PARAM', true, '调出部门', basicForm.deliveryInventoryOrg)" style="width: 200px">
                 <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -158,14 +159,14 @@
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调入仓库">
-              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable || isOrg" @change="controlDRHW" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')" style="width: 200px">
                 <el-option v-for="item in ruHouseOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
          </el-col>
         <el-col :span="1.5">
             <el-form-item label="调出仓库">
-              <el-select clearable size="small" v-model="basicForm.deliveryWarehouse" :disabled="sonDisable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调出仓库')" style="width: 200px">
+              <el-select clearable size="small" v-model="basicForm.deliveryWarehouse" :disabled="sonDisable || isOrg" @change="controlDCHW" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调出仓库', basicForm.deliveryInventoryOrg)" style="width: 200px">
                 <el-option v-for="item in chuHouseOptions" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -271,8 +272,8 @@
           <el-table-column show-overflow-tooltip label="调出货位" align="center" prop="deliveryAllocationName" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)">
-                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)"></el-button>
+                <el-input clearable :disabled="sonDisable || isDCCk" size="small" v-model="scope.row.deliveryAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)">
+                  <el-button size="small" :disabled="sonDisable || isDCCk" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)"></el-button>
                 </el-input>
               </el-form-item>
             </template>
@@ -289,8 +290,8 @@
           <el-table-column show-overflow-tooltip label="调入货位" align="center" prop="storageAllocationName" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang">
-                <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.storageAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)">
-                  <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)"></el-button>
+                <el-input clearable :disabled="sonDisable || isDRCk" size="small" v-model="scope.row.storageAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)">
+                  <el-button size="small" :disabled="sonDisable || isDRCk" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)"></el-button>
                 </el-input>
               </el-form-item>
             </template>
@@ -704,7 +705,10 @@ export default {
             );
           }
         }
-      }
+      },
+      isOrg: true,
+      isDRCk: true,
+      isDCCk: true,
     }
   },
   created() {
@@ -716,6 +720,43 @@ export default {
     }
   },
   methods: {
+    // 改变单据日期时清空子表的调拨日期
+    changeBillDate() {
+      this.materialInfo.forEach(item => {
+        item.allotDate = null
+      })
+    },
+    // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
+    controlCk() {
+      console.log('进了吗')
+      if (this.basicForm.deliveryInventoryOrg && this.basicForm.storageInventoryOrg) {
+        this.isOrg = false
+      } else {
+        this.basicForm.deliveryDept = ''
+        this.basicForm.storageWarehouse = ''
+        this.basicForm.deliveryWarehouse = ''
+        this.isOrg = true
+      // 选择调入库存组织时判断调拨方式
+        this.basicForm.allotType = ''
+      }
+    },
+    // 控制子表内货位是否可以填写,根据选择仓库内csFlag
+    controlDCHW() {
+      console.log("🚀 ~ file: add.vue:735 调出货位")
+      this.isDCCk = true
+      this.materialInfo.forEach(item => {
+        item.deliveryAllocation = null
+        item.deliveryAllocationName = null
+      })
+    },
+    controlDRHW() {
+      console.log("🚀 ~ file: add.vue:735 调入货位")
+      this.isDRCk = true
+      this.materialInfo.forEach(item => {
+        item.storageAllocation = null
+        item.storageAllocationName = null
+      })
+    },
     // 输入数量或者主数量同步改变
     getZSL(scope) {
       scope.row.qty = scope.row.mainQty
@@ -788,6 +829,8 @@ export default {
           if(this.basicForm.storageWarehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.storageWarehouse, '调入仓库') }
           if(this.basicForm.deliveryWarehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.deliveryWarehouse, '调出仓库') }
           if(this.basicForm.liacenter) { this.reBackRefer('LIACENTER_PARAM', this.basicForm.liacenter) }
+          // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
+          this.controlCk()
         }
       })
     },
@@ -893,6 +936,12 @@ export default {
         this.basicForm.deliveryInventoryOrg = selection[0].id
         this.basicForm.deliveryInventoryOrgCode = selection[0].code
         this.basicForm.deliveryInventoryOrgName = selection[0].name
+        // 选择调入库存组织时判断调拨方式
+        if (this.basicForm.storageInventoryOrg == this.basicForm.deliveryInventoryOrg) {
+          this.basicForm.allotType = '4'
+        } else {
+          this.basicForm.allotType = '2'
+        }
       }
       if (this.referCondition.title == '调入库存组织') {
         this.ruOrgOptions = selection
@@ -926,12 +975,24 @@ export default {
         this.ruHouseOptions = selection
         this.basicForm.storageWarehouse = selection[0].id
         this.basicForm.storageWarehouseName = selection[0].name
+        console.log('1111', selection[0].csFlag)
+        if(selection[0].csFlag == 'N') {
+          this.isDRCk = true
+        } else {
+          this.isDRCk = false
+        }
       }
       if (this.referCondition.title == '调出仓库') {
         this.chuHouseOptions = selection
         this.basicForm.deliveryWarehouse = selection[0].id
         this.basicForm.deliveryWarehouseCode = selection[0].code
         this.basicForm.deliveryWarehouseName = selection[0].name
+        console.log('2222', selection[0].csFlag)
+        if (selection[0].csFlag == 'N') {
+          this.isDCCk = true
+        } else {
+          this.isDCCk = false
+        }
       }
       if (this.referCondition.title == '调出货位') {
         this.materialInfo[this.tableIndex].deliveryAllocationName = selection[0].name
@@ -945,6 +1006,8 @@ export default {
         this.materialInfo[this.tableIndex].storageDeptName = selection[0].name
         this.materialInfo[this.tableIndex].storageDept = selection[0].id
       }
+      // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
+      this.controlCk()
     },
     chooseTreeRefer(type, isPage, title) {
       this.referCondition.type = type

+ 77 - 71
src/views/purchase/transferOrder/index.vue

@@ -1,92 +1,93 @@
 <template>
   <div id="transferOrder">
     <div v-if="isList">
-      <el-form class="search_area" label-width="120px">
-        <el-row :gutter="10">
-          <el-col :span="1.5">
-            <el-form-item label="调出库存组织">
-              <el-select clearable size="small" v-model="queryParams.deliveryInventoryOrg" @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')" style="width: 200px">
-                <el-option v-for="item in chuOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="单据日期">
-              <el-date-picker
-               style="width: 200px"
-               size="small"
-               clearable
-               value-format="yyyy-MM-dd"
-                v-model="queryParams.billDate"
-                type="date">
-              </el-date-picker>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="订单类型">
-              <el-select v-model="queryParams.billType" size="small" style="width: 200px" clearable>
-                <el-option v-for="dict in dict.type.sys_allot_billtype" :key="dict.value" :label="dict.label" :value="dict.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="调入库存组织">
-              <el-select clearable size="small" v-model="queryParams.storageInventoryOrg" @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')" style="width: 200px">
-                <el-option v-for="item in ruOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="单据号">
-              <el-input
-                v-model.trim="queryParams.code"
-                size="small"
-                clearable
-                style="width: 200px"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="1.5">
-            <el-form-item label="" label-width="20px">
-              <el-button type="primary" size="small" icon="el-icon-search" plain @click="searchList">搜索</el-button>
-              <el-button size="small" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <!-- <CollapseTransition>
-        <div v-show="expanded">
+      <el-card>
+        <el-form class="search_area" label-width="120px">
           <el-row :gutter="10">
             <el-col :span="1.5">
-              <el-form-item label="物料编码">
-                <el-input
-                v-model="queryParams.code"
+              <el-form-item label="调出库存组织">
+                <el-select clearable size="small" v-model="queryParams.deliveryInventoryOrg" @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')" style="width: 200px">
+                  <el-option v-for="item in chuOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="单据日期">
+                <el-date-picker
+                style="width: 200px"
                 size="small"
-                placeholder=""
                 clearable
-                style="width: 200px"
-                />
+                value-format="yyyy-MM-dd"
+                  v-model="queryParams.billDate"
+                  type="date">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="订单类型">
+                <el-select v-model="queryParams.billType" size="small" style="width: 200px" clearable>
+                  <el-option v-for="dict in dict.type.sys_allot_billtype" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="调入库存组织">
+                <el-select clearable size="small" v-model="queryParams.storageInventoryOrg" @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')" style="width: 200px">
+                  <el-option v-for="item in ruOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="单据号">
                 <el-input
-                v-model="queryParams.storageInventoryOrg"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
+                  v-model.trim="queryParams.code"
+                  size="small"
+                  clearable
+                  style="width: 200px"
                 />
               </el-form-item>
             </el-col>
+            <el-col :span="1.5">
+              <el-form-item label="" label-width="20px">
+                <el-button type="primary" size="small" icon="el-icon-search" plain @click="searchList">搜索</el-button>
+                <el-button size="small" icon="el-icon-refresh" plain @click="resetList">重置</el-button>
+              </el-form-item>
+            </el-col>
           </el-row>
-        </div>
-        </CollapseTransition> -->
-      </el-form>
+
+          <!-- <CollapseTransition>
+          <div v-show="expanded">
+            <el-row :gutter="10">
+              <el-col :span="1.5">
+                <el-form-item label="物料编码">
+                  <el-input
+                  v-model="queryParams.code"
+                  size="small"
+                  placeholder=""
+                  clearable
+                  style="width: 200px"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="1.5">
+                <el-form-item label="调入库存组织">
+                  <el-input
+                  v-model="queryParams.storageInventoryOrg"
+                  size="small"
+                  placeholder=""
+                  clearable
+                  style="width: 200px"
+                  />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </div>
+          </CollapseTransition> -->
+        </el-form>
       <!-- <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider> -->
 
-      <el-card>
+      
         <div class="btn_grooup">
           <el-button type="primary" size="small" @click="addOrder">新增</el-button>
         </div>
@@ -147,6 +148,7 @@
         </el-table-column>
         </el-table>
         <el-pagination
+          background
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
           :current-page="1"
@@ -477,4 +479,8 @@ export default {
 .lines {
   margin-top: 0;
 }
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
 </style>