mushencc před 3 roky
rodič
revize
d3d905d971

+ 3 - 1
src/components/confirm-delete/index.js

@@ -3,11 +3,12 @@ import Delete from './index.vue'
 const ConfirmDelete = Vue.extend(Delete) // 直接将Vue组件作为Vue.extend的参数
 let nId = 1;
 
-const Notice = ({content,type,title,then,cancel}) => {
+const Notice = ({content,type,title,then,cancel,formData}) => {
     let id = 'notice-' + nId++
   
     const ConfirmDeleteInstance = new ConfirmDelete({
       data: {
+        formData,
         content: content,
         type:type||'error',
         title:title||'确认删除'
@@ -16,6 +17,7 @@ const Notice = ({content,type,title,then,cancel}) => {
     ConfirmDeleteInstance.id = id
     ConfirmDeleteInstance.vm = ConfirmDeleteInstance.$mount() // 挂载但是并未插入dom,是一个完整的Vue实例
     ConfirmDeleteInstance.vm.show = true
+    ConfirmDeleteInstance.formData = formData
     ConfirmDeleteInstance.dom = ConfirmDeleteInstance.vm.$el
     document.body.appendChild(ConfirmDeleteInstance.vm.$el) // 将dom插入body
     ConfirmDeleteInstance.vm.$el.style.zIndex = nId + 100001 // 后插入的Notice组件z-index加一,保证能盖在之前的上面

+ 6 - 1
src/components/confirm-delete/index.vue

@@ -1,7 +1,12 @@
 <template>
     <div class="confirm-d">
         <Modal class-name="vertical-center-modal" :title='title' v-model="show" :width="444">
-            <div class='content-modal'>{{content}}</div>
+            <Form :label-width='80' class="confirm_form" v-if="formData">
+                <FormItem :label='item.title' v-for="(item,index) in formData" :key="index" style="display:flex;width:100%;justify-content: center;">
+                    <Input v-model="item.value"/>
+                </FormItem>
+            </Form>
+            <div class='content-modal' v-else>{{content}}</div>
             <div class="modal-footer" slot="footer">
                 <Button @click="cancel">取消</Button>
                 <Button @click="then" :type="type ? type :'error'">确认</Button>

+ 11 - 1
src/routerMap/index.js

@@ -1784,7 +1784,7 @@ const routerMap = [
   },
   {
     path: "/cms/BidSystem/OutputValue/list",
-    name: "outputValueList", //报表中心-->项目产值表
+    name: "outputValueList", //报表中心-->项目产值明细
     meta: {
       index: 3,
       // keepAlive: true,
@@ -1793,6 +1793,16 @@ const routerMap = [
       require(["@/views/BidSystem/OutputValue/list"], resolve),
   },
   {
+    path: "/cms/BidSystem/OutputValue/total",
+    name: "outputValueTotal", //报表中心-->项目产值汇总表
+    meta: {
+      index: 3,
+      // keepAlive: true,
+    },
+    component: (resolve) =>
+      require(["@/views/BidSystem/OutputValue/total"], resolve),
+  },
+  {
     path: "/cms/BidSystem/OutputValue/otherList",
     name: "outputValueOtherList", //报表中心-->产值表
     meta: {

+ 7 - 3
src/views/BidSystem/OutputValue/list.vue

@@ -1,6 +1,6 @@
 <template>
     <div>
-        <Toptitle title="项目产值表">
+        <Toptitle title="项目产值明细表">
             <slot name="titleButton"> 
           <Button type="success" ghost icon="md-exit" style="margin-right:10px;"
             >导出</Button
@@ -85,7 +85,11 @@ export default {
                   {title:'项目简称',align:"center",key:'abbreviation',minWidth:120},
                    {title:'合同金额',align:"center",key:'contract_price',minWidth:120},
                     {title:'核量金额',align:"center",key:'quantity_price',minWidth:120},
-                     {title:'本厂产值',align:"center",key:'local_value',minWidth:120},
+                     {title:'本厂产值',align:"center",key:'',minWidth:120,children:[
+                         {title:'车间产值',align:'center',key:'work_value',minWidth:80},
+                         {title:'安装产值',align:'center',key:'install_value',minWidth:80},
+                         {title:'合计',align:'center',key:'local_value',minWidth:80},
+                     ]},
                       {title:'外协产值',align:"center",key:'out_value',minWidth:120},
                        {title:'合计产值',align:"center",key:'total_value',minWidth:120},
                         {title:'未完成产值',align:"center",key:'un_total_value',minWidth:120},
@@ -110,7 +114,7 @@ export default {
                         return;
                     }
                     const values = data.map(item => Number(item[key]));
-                    if (key == 'contract_price'||key == 'quantity_price'||key == 'out_value'||key == 'un_total_value'||key == 'total_value'||key == 'local_value') {
+                    if (key == 'contract_price'||key == 'quantity_price'||key == 'out_value'||key == 'un_total_value'||key == 'total_value'||key == 'local_value'||key=='install_value'||key=='work_value') {
                         const v = values.reduce((prev, curr) => {
                             const value = Number(curr);
                             if (!isNaN(value)) {

+ 54 - 0
src/views/BidSystem/OutputValue/total.vue

@@ -0,0 +1,54 @@
+<template>
+    <div>
+        <Toptitle title="项目产值汇总表"></Toptitle>
+        <Table :data='tableData' :columns='tableColumns' border max-height='650' style="margin-top:20px"></Table>
+    </div>
+</template>
+<script>
+export default {
+    data(){
+        return{
+            year_value:{},
+            month_value:{},
+           tableData:[],
+            tableColumns:[
+                {title:'本月',align:'center',minWidth:300,children:[
+                    {title:"本厂",align:'center',key:'local_value',minWidth:100},
+                    {title:"外协",align:'center',key:'un_local_value',minWidth:100},
+                    {title:"合计",align:'center',key:'total',minWidth:100}
+                ]},
+                 {title:'本年',align:'center',minWidth:300,children:[
+                    {title:"本厂",align:'center',key:'month_local_value',minWidth:100},
+                    {title:"外协",align:'center',key:'month_un_local_value',minWidth:100},
+                    {title:"合计",align:'center',key:'month_total',minWidth:100}
+                ]},
+            ]
+        }
+    },
+    mounted(){
+      this.initData();
+    },
+    methods:{
+       initData(){
+           let promise = new Promise((resolve,reject)=>{
+               this.axios.post('/api/output_value_year').then(res=>{
+                   resolve(res)
+               })
+           })
+           promise.then(res=>{
+               this.axios.post('/api/output_value_month').then(resp=>{
+                   this.tableData = [{}];
+                   let obj ={};
+                   obj.month_local_value = resp.data.local_value;
+                   obj.month_un_local_value = resp.data.un_local_value;
+                   obj.month_total = resp.data.total;
+                   this.tableData[0] = Object.assign({...res.data,...obj});
+               })
+           })
+       }
+    }
+}
+</script>
+<style scoped lang='scss'>
+
+</style>

+ 1 - 1
src/views/Dispatching/Dispatching.vue

@@ -241,7 +241,7 @@ export default {
           title: "班组",
           align: "center",
           key: "",
-          minWidth: 150,
+          minWidth: 200,
           slot: "slotGroup",
         },
          { title: "区域", align: "center", key: "num", minWidth: 150 },

+ 7 - 1
src/views/ProductionOrderList/Deliverylist/Deliverylist.vue

@@ -466,10 +466,16 @@ export default {
         type == 1 ? "/api/orders_transport" : "/api/orders_transport_confirm";
       params.transport_no = row.transport_no || row.order_no;
       this.confirmDelete({
+        formData:type==1?[
+          {title:'车牌号:',value:''},
+          {title:'司机姓名:',value:''},
+          {title:'联系电话:',value:''}
+        ]:false,
         title: type == 1 ? "确认发货" : "确认收货",
-        content: type == 1 ? "确认发货么?" : "确认收货么?",
+        content: type == 1 ? "确认发货么?" : "确认收货么?", 
         type: "primary",
         then: (e) => {
+          console.log(123,e);
           this.axios.post(post_url, params).then((res) => {
             if (res.code == 200) {
               this.$Message.success(res.msg);

+ 10 - 1
src/views/ProductionOrderList/Dispatchlist/confirm.vue

@@ -8,6 +8,7 @@
       :logList="logList"
       @selectTable="selectTable"
       @changePage="changePage"
+      @changeSelected='changeSelected'
       @changeSize="changeSize"
       :tableColums="tableColums"
       :tableData="tableData"
@@ -61,6 +62,7 @@
 export default {
   data() {
     return {
+      url_number:[],
       finish_nickname:'',
       finish_modal:false,
       type: 1,
@@ -186,10 +188,13 @@ export default {
         },
         {
           title: "图号",
+          isTooltip:true,
+          showChooseAll:true,
           filterable: true,
           multiple:true,
+          change:true,
           name: "Select",
-          value: "",
+          value: this.url_number,
           optionName: "title",
           optionValue: "title",
           serverName: "url_number",
@@ -231,6 +236,10 @@ export default {
     },
   },
   methods: {
+    changeSelected(list){
+    
+        this.url_number = list[3].value;
+    },
     finish_Ok(){
       if(!this.finish_nickname){
          this.$Message.warning('请选择班组')

+ 8 - 1
src/views/ProductionOrderList/InboundForm/details.vue

@@ -328,6 +328,13 @@ export default {
           minWidth: 200,
           key: "part_detail_title",
         },
+          this.$route.query.type == 4
+          ?{
+             title: "精裁尺寸",
+              align: "center",
+              minWidth: 200,
+              key: "measure",
+          }:null,
         this.$route.query.type == 4
           ? {
               title: "包装码",
@@ -341,7 +348,7 @@ export default {
               minWidth: 200,
               key: "transport_no",
             },
-        { title: "单位", align: "center", minWidth: 100, key: "company" },
+        { title: "单位", align: "center", minWidth: 100, key: "unit" },
         {
           title: "包装完成状态",
           align: "center",

+ 67 - 15
src/views/PurchasingManage/DeliveryOutWarehouse/detail.vue

@@ -6,27 +6,30 @@
         <div style="height:85%;over-flow:auto">
         <Form style="display:flex;flex-wrap:wrap;margin:20px 0" :label-width='100'>
             <FormItem label='仓库名称:' class='form_item'>
-                <Select multiple>
-                    <Option></Option>
+                <Select multiple v-model="searchData.warehouse_id">
+                    <Option v-for="item in warehouse_list" :key="item.id" :value="item.id" :label="item.title"></Option>
                 </Select>
             </FormItem>
             <FormItem label='图号:' class='form_item'>
-                <Select multiple filterable>
-                    <Option/>
+                <Select multiple filterable v-model="searchData.url_number">
+                    <Option v-for="item in url_number_list" :key="item.id" :value="item.url_number" :label="item.url_number"/>
                 </Select>
             </FormItem>
             <FormItem label='产品名称:' class='form_item'>
-                <Select multiple filterable>
-                    <Option/>
+                <Select multiple filterable v-model="searchData.product_id">
+                    <Option v-for="item in product_list" :key="item.id" :value="item.id" :label='item.title'/>
                 </Select>
             </FormItem>
             <FormItem label='房间号:' class='form_item'>
-                <Select multiple filterable>
-                    <Option/>
+                <Select multiple filterable v-model="searchData.house_id">
+                    <Option v-for="item in house_list" :key="item.id" :value='item.value' :label="item.label"/>
                 </Select>
             </FormItem>
+            <FormItem>
+                <Button type="primary" @click="initData(searchData)">搜索</Button>
+            </FormItem>
         </Form>
-        <Table :data='tableData' :columns='tableColumns' border>
+        <Table :data='tableData' :columns='tableColumns' border max-height='550'>
         </Table>
         </div>
           <div style="text-align:center">
@@ -48,19 +51,68 @@
 export default {
     data(){
         return{
+               searchData:{
+            warehouse_id:[],
+            url_number:[],
+            product_id:[],
+            house_id:[]
+            },
+            house_list:[],
+            product_list:[],
+            url_number_list:[],
+            warehouse_list:[],
+            pageIndex:1,
+            pageSize:10,
+            total:0,
           tableData:[],
           tableColumns:[
-              {title:'仓库名称',align:'center',key:'',minWidth:80},
-              {title:'图号',align:'center',key:'',minWidth:80},
-               {title:'产品名称',align:'center',key:'',minWidth:80},
-                {title:'房间号',align:'center',key:'',minWidth:80},
-                 {title:'包数',align:'center',key:'',minWidth:80}
+              {title:'仓库名称',align:'center',key:'warehouse_title',minWidth:80},
+              {title:'图号',align:'center',key:'url_number',minWidth:80,tooltip:true},
+               {title:'产品名称',align:'center',key:'product_title',minWidth:80},
+                {title:'房间号',align:'center',key:'number',minWidth:80,render:(h,params)=>{
+                    const {row} = params;
+                    return h('span',{},`${row.house?`${row.house}-`:''}${row.unit?`${v.unit}-`:''}${row.layer?`${row.layer}-`:''}${row.number?row.number:''}`)
+                }},
+                 {title:'包数',align:'center',key:'num',minWidth:80}
           ],
         }
     },
+    mounted(){
+           this.initData();
+    },
     methods:{
-        back(){
+        initData(row){
+            this.proxyData = row;
+              this.axios.post('/api/warehouse_order_send_out_detail',{id:this.$route.query.id,page_index:this.pageIndex,page_size:this.pageSize,...row}).then(res=>{
+                  let obj = {};
+                  this.tableData = res.data.data;
+                  obj.warehouse_title = '总计';
+                  obj.num = res.data.total_num;
+                  this.tableData.push(obj);
+                  this.total = res.data.total;
+                  this.url_number_list=res.data.url_number_list;
+                  this.warehouse_list=res.data.warehouse_list;
+                  let arr = [];
+                  res.data.house_list.forEach(v => {
+                      let item = {};
+                      item.label = `${v.house?`${v.house}-`:''}${v.unit?`${v.unit}-`:''}${v.layer?`${v.layer}-`:''}${v.number?v.number:''}`;
+                      item.value = v.id;
+                      arr.push(item);
+                  });
+                  this.house_list=arr;
+                  this.product_list = res.data.product_list;
+              })
+        },   
+         back(){
             this.$router.go(-1)
+        },
+        changeSize(e){
+            this.pageSize =e;
+            this.initData(this.proxyData);
+        },
+        changePage(e){
+            this.pageIndex = e;
+            this.initData(this.proxyData);
         }
     }
 }

+ 31 - 10
src/views/PurchasingManage/DeliveryOutWarehouse/list.vue

@@ -6,29 +6,30 @@
       :label-width="120"
       style="display: flex; flex-wrap: wrap; margin: 15px 0"
     >
-    <FormItem label='项目编码'><Input/></FormItem>
-      <FormItem label="项目名称:"><Input /></FormItem>
+    <FormItem label='项目编码'><Input placeholder="请输入项目编码" clearable v-model="searchData.project_code"/></FormItem>
+      <FormItem label="项目名称:"><Input placeholder="请输入项目名称" clearable v-model="searchData.project_title"/></FormItem>
       <FormItem label="发货日期:">
         <DatePicker
           type="date"
           placeholder="请选择"
+          v-model="searchData.start_time"
           style="width: 200px"
         ></DatePicker
         >~
         <DatePicker
           type="date"
+          v-model="searchData.end_time"
           placeholder="请选择"
           style="width: 200px"
         ></DatePicker>
       </FormItem>
       <FormItem>
-        <Button type="primary">搜索</Button>
+        <Button type="primary" @click="search">搜索</Button>
       </FormItem>
     </Form>
     <Table border :data="tableData" :columns="tableColumns" max-height='550'> 
         <template slot="set" slot-scope="{row}">
-            <a style="margin-right:40px" @click="goPage(row)">详情</a>
-            <a>删除</a>
+            <a @click="goPage(row)">详情</a>
         </template>
     </Table>
     </div>
@@ -51,9 +52,16 @@
 export default {
   data() {
     return {
+      proxyData:[],
       pageIndex: 1,
       pageSize: 10,
       total: 0,
+      searchData:{
+        project_code:'',
+        project_title:'',
+        start_time:'',
+        end_time:''
+      },
       tableData: [],
       tableColumns: [
           {
@@ -68,7 +76,10 @@ export default {
           minWidth: 80,
           key: "project_title",
         },
-        { title: "入库日期", align: "center", minWidth: 80, key: "crt_time" },
+        { title: "发货日期", align: "center", minWidth: 80, key: "warehouse_time",render:(h,params)=>{
+          const {row} = params;
+          return h("span",{},this.func.replaceDateNoHMS(row.warehouse_time))
+        } },
         { title: "操作", align: "center", key: "", minWidth: 80,slot:'set' },
       ],
     };
@@ -77,19 +88,29 @@ export default {
     this.initData();
   },
   methods: {
+         search(){
+           let obj = JSON.parse(JSON.stringify(this.searchData));
+          obj.start_time = obj.start_time?Date.parse(obj.start_time).toString().slice(0,10):'';
+          obj.end_time = obj.end_time?Date.parse(obj.end_time).toString().slice(0,10):'';
+           this.initData(obj);
+         },
       goPage(row){
-            this.$router.push({path:'/cms/PurchasingManage/DeliveryOutWarehouse/detail',query:{...row}})
+            this.$router.push({path:'/cms/PurchasingManage/DeliveryOutWarehouse/detail',query:{id:row.id}})
       },
       initData(row){ 
-        setTimeout(()=>{
-            this.tableData = [{project_code:18758228279,project_title:'hw',crt_time:'1995-12-8'}]
-        },1)
+        this.proxyData = row;
+       this.axios.get('/api/warehouse_order_send_out_list',{params:{page_index:this.pageIndex,page_size:this.pageSize,...row}}).then(res=>{
+         this.tableData = res.data.data;
+         this.total = res.data.total;
+       })
       },
     changeSize(e) {
       this.pageSize = e;
+      this.initData(this.proxyData);
     },
     changePage(e) {
       this.pageIndex = e;
+      this.initData(this.proxyData);
     },
   },
 };

+ 1 - 3
src/views/PurchasingManage/InstockOrder/edit.vue

@@ -1015,12 +1015,11 @@ export default {
       if(this.modelTaxRate*1<0){
         this.modelTaxRate = 0
       }
-      console.log(this.tableData)
-      console.log(this.selectedTableData)
       this.tableData.forEach((v,index)=>{
          this.selectedTableData.forEach(m=>{
             if(v.indexSort==m.indexSort){
               console.log(index)
+              v.is_upd = true;
               v.tax_rate = JSON.parse(JSON.stringify(this.modelTaxRate));
              v.price = (v.no_tax_price*1*(1+(v.tax_rate*1)/100));
                     v.total = ((v.no_tax_price*1*(1+(v.tax_rate*1)/100))*v.num).toFixed(2);
@@ -1032,7 +1031,6 @@ export default {
       this.selectedTableData =[];
     },
     selectData(e){
-      console.log(e);
         this.selectedTableData=e;
     },
     changeCheckPage(e){

+ 9 - 1
src/views/PurchasingManage/ProductionInWarehouse/detail.vue

@@ -67,7 +67,10 @@ export default {
                   {title:'仓库名称',align:'center',minWidth:80,key:'warehouse_title'},
                   {title:'图号',align:'center',minWidth:80,key:'url_number',tooltip:true}, 
                    {title:'产品名称',align:'center',minWidth:80,key:'product_title'},
-                     {title:'房间号',align:'center',minWidth:80,key:'number'},
+                     {title:'房间号',align:'center',minWidth:80,key:'number',render:(h,params)=>{
+                    const {row} = params;
+                    return h('span',{},`${row.house?`${row.house}-`:''}${row.unit?`${v.unit}-`:''}${row.layer?`${row.layer}-`:''}${row.number?row.number:''}`)
+                }},
                           {title:'包数',align:'center',minWidth:80,key:'num'},
              ],
         }
@@ -79,6 +82,11 @@ export default {
         initData(row){
               this.axios.post('/api/warehouse_order_product_in_detail',{id:this.$route.query.id,page_size:this.pageSize,page_index:this.pageIndex,...row}).then(res=>{
                     this.tableData = res.data.data;
+                    let total_num = {};
+                    total_num.warehouse_title = '合计';
+                    total_num.num = res.data.total_num ||0;
+                    this.tableData.push(total_num);
+                    console.log(this.tableData);
                     this.total = res.data.total;
                     if(this.house_list.length==0&&this.product_list.length==0&&this.url_number_list.length==0&&this.warehouse_list.length==0){
                         res.data.house_list.forEach(v => {

+ 3 - 4
src/views/PurchasingManage/ProductionInWarehouse/list.vue

@@ -6,8 +6,8 @@
       :label-width="120"
       style="display: flex; flex-wrap: wrap; margin: 15px 0"
     >
-     <FormItem label="项目编码:"><Input v-model="searchData.project_code" clearable/></FormItem>
-      <FormItem label="项目名称:"><Input v-model="searchData.project_title" clearable/></FormItem>
+     <FormItem label="项目编码:"><Input v-model="searchData.project_code" clearable placeholder="请输入项目编码"/></FormItem>
+      <FormItem label="项目名称:"><Input v-model="searchData.project_title" clearable placeholder="请输入项目名称" /></FormItem>
       <FormItem label="入库日期:">
         <DatePicker
           type="date"
@@ -29,8 +29,7 @@
     </Form>
     <Table border :data="tableData" :columns="tableColumns" max-height='550'> 
         <template slot="set" slot-scope="{row}">
-            <a style="margin-right:40px" @click="goPage(row)">详情</a>
-            <a>删除</a>
+            <a  @click="goPage(row)">详情</a>
         </template>
     </Table>
     </div>

+ 16 - 2
src/views/PurchasingManage/PurchasingOrder/list.vue

@@ -38,12 +38,15 @@
           </Select>
         </FormItem>
         <FormItem label="供应商名称:" style="width:300px">
-          <Input type="text"
+          <!-- <Input type="text"
                  size="small"
                  v-model="searchData.supply_title"
                  style="width: 150px"
                  clearable
-                 placeholder="供应商名称" />
+                 placeholder="供应商名称" /> -->
+                 <Select filterable clearable v-model="searchData.supply_title" size="small" style="width:150px" placeholder="请选择">
+                   <Option v-for="item in supplierList" :key="item.id" :label="item.label" :value="item.value"></Option>
+                 </Select>
         </FormItem>
         <FormItem label="订单状态:" style="width:300px">
           <Select v-model="searchData.lock"
@@ -62,6 +65,7 @@
           <Select v-model="searchData.crt_id"
                   size="small"
                   clearable
+                  filterable
                   style="width: 150px">
             <Option v-for="(sitem) in userList"
                     :key="sitem.id"
@@ -86,6 +90,7 @@
           <Select v-model="searchData.check_id"
                   size="small"
                   clearable
+                  filterable
                   style="width: 150px">
             <Option v-for="(sitem) in userList"
                     :key="sitem.id"
@@ -269,10 +274,19 @@ export default {
       pageSize: 10,
       total: 0,
       userList: [],
+      supplierList:[],
     }
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   created () {
+    //获取供应商列表
+    this.axios({ method: 'get', url: '/api/supply_list', }).then((res) => { 
+      this.supplierList = res.data.data;
+         this.supplierList.forEach(v=>{
+        v.label = v.title;
+        v.value = v.title;
+      })
+    })
     // 获取采购类型
     this.axios({ method: 'get', url: '/api/basic_purchase_list',params:{type_id:2} }).then((res) => { this.purchaseTypeList = res.data.data }).catch((err) => { });
     // 获取操作员

+ 15 - 5
src/views/PurchasingManage/QualitycontrolOrder/list.vue

@@ -31,6 +31,7 @@
           <Select v-model="searchData.supply_id"
                   size="small"
                   clearable
+                  filterable
                   style="width: 150px">
             <Option v-for="_item in supply_title_list"
                     :key="_item.id"
@@ -54,6 +55,7 @@
           <Select v-model="searchData.user_id"
                   size="small"
                   clearable
+                  filterable
                   style="width: 150px">
             <Option v-for="(sitem) in userList"
                     :key="sitem.id"
@@ -78,9 +80,10 @@
           </Select>
         </FormItem>
         <FormItem label="审批人:">
-          <Select v-model="searchData.user_id"
+          <Select v-model="searchData.check_id"
                   size="small"
                   clearable
+                  filterable
                   style="width: 150px">
             <Option v-for="(sitem) in userList"
                     :key="sitem.id"
@@ -107,24 +110,26 @@
                       size="small"
                       style="width: 150px"
                       placeholder="年/月/日"
-                      v-model="searchData.start_time"></DatePicker>
+                      v-model="searchData.order_start_time"></DatePicker>
         
        ~
           <DatePicker type="date"
                       size="small"
                       style="width: 150px"
                       placeholder="年/月/日"
-                      v-model="searchData.end_time"></DatePicker>
+                      v-model="searchData.order_end_time"></DatePicker>
         </FormItem>
         <FormItem label="订单创建时间:" style="width:450px" :label-width='100'>
           <DatePicker type="date"
                       size="small"
+                      v-model="searchData.start_time"
                       style="width: 150px"
                       placeholder="年/月/日"
                      ></DatePicker>
         ~
           <DatePicker type="date"
                       size="small"
+                      v-model="searchData.end_time"
                       style="width: 150px"
                       placeholder="年/月/日"
                      ></DatePicker>
@@ -194,10 +199,13 @@ export default {
     return {
       supply_title_list:[],
       searchData: {
+        order_start_time:'',
+        order_end_time:'',
         order_no: '',
         project_title: '',
         supply_id: '',
         type_id: '',
+        check_id:"",
         user_id: '',
         lock: '',
         state: '',
@@ -275,8 +283,10 @@ export default {
   methods: {
     initData () {
       let obj = JSON.parse(JSON.stringify(this.searchData))
-      obj.start_time = parseInt(new Date(obj.start_time).getTime() / 1000) || ''
-      obj.end_time = parseInt(new Date(obj.end_time).getTime() / 1000) || ''
+      obj.order_start_time = obj.order_start_time?parseInt(new Date(obj.order_start_time).getTime() / 1000) : ''
+        obj.start_time = obj.start_time?parseInt(new Date(obj.start_time).getTime() / 1000) : ''
+      obj.order_end_time =obj.order_end_time?parseInt(new Date(obj.order_end_time).getTime() / 1000) : ''
+       obj.end_time =obj.end_time?parseInt(new Date(obj.end_time).getTime() / 1000) : ''
       this.axios({
         method: 'get',
         url: '/api/purchase_quality_list',

+ 2 - 0
src/views/PurchasingManage/RequisitionOrder/list.vue

@@ -53,6 +53,7 @@
         <FormItem label="制单人:">
           <Select v-model="searchData.crt_id"
                   size="small"
+                  filterable
                   clearable
                   style="width: 150px">
             <Option v-for="(sitem) in userList"
@@ -77,6 +78,7 @@
           <Select v-model="searchData.check_id"
                   size="small"
                   clearable
+                  filterable
                   style="width: 150px">
             <Option v-for="(sitem) in userList"
                     :key="sitem.id"

+ 25 - 14
src/views/Warehouse/Warehouse/highestStockList.vue

@@ -15,7 +15,7 @@
      <div class="warehouseList_top">
       <Form :label-width="100">
         <FormItem label="物料分类">
-          <Select v-model="searchData.type_title"
+          <Select v-model="searchData.material_type_id"
                   multiple
                   filterable
                   style="width:200px">
@@ -27,7 +27,7 @@
           </Select>
         </FormItem>
         <FormItem label="物料名称">
-          <Select v-model="searchData.material"
+          <Select v-model="searchData.material_id"
                   multiple
                   filterable
                   style="width:200px">
@@ -38,6 +38,11 @@
             </Option>
           </Select>
         </FormItem>
+         <FormItem label='规格型号'>
+              <Select v-model="searchData.material_detail_id" filterable multiple  style="width:200px">
+                <Option v-for="item in material_list" :key="item.material_detail_id" :value="item.material_detail_id" :label='`${item.long?item.long:0}*${item.width?item.width:0}*${item.high?item.high:0}`'/>
+              </Select>
+        </FormItem>
         <FormItem>
           <Button type="primary"
                   @click="handleSearchData">搜索</Button>
@@ -67,20 +72,26 @@
 export default {
     data(){
          return{
+           material_list:[],
               searchData:{
-                  type_title:[],
-                  material:[]
+                  material_type_id:[],
+                  material_id:[],
+                  material_detail_id:[]
               },
               materialTypeList:[],
               materialNameList:[],
               tableData:[],
               tableColums:[
-                  { title: '物料名称', align: 'center', key: 'title', minWidth: 120 },
-                  { title: '规格型号', align: 'center', key: 'model', minWidth: 120 },
+                  { title: '物料名称', align: 'center', key: 'material_title', minWidth: 120 },
+                  { title: '规格型号', align: 'center', key: 'model', minWidth: 120,render:(h,params)=>{
+                    const {row} = params;
+                    const text = `${row.long?row.high:0}*${row.width?row.width:0}*${row.high?row.high:0}`
+                    return h('span',{},text)
+                  }},
                   { title: '计量单位', align: 'center', key: 'unit', minWidth: 120 },
                   { title: '最高库存', align: 'center', key: 'top_number', minWidth: 120 },
                   { title: '现存量', align: 'center', key: 'num', minWidth: 120 },
-                  { title: '差量', align: 'center', key: 'difference', minWidth: 120 }
+                  { title: '差量', align: 'center', key: 'diff_num', minWidth: 120 }
               ],
               total:0,
               page_size:10,
@@ -88,6 +99,12 @@ export default {
          }
     },
     created(){
+        // 获取物料分类列表 
+    this.axios('/api/basics_material_index').then(res => { this.materialTypeList = res.data.data })
+    // 获取物料名称列表
+    this.axios('/api/material').then(res => { this.materialNameList = res.data.data })
+    },
+    mounted(){
        this.getData();
     },
   methods:{
@@ -112,14 +129,8 @@ export default {
         row = {...row,...this.searchData};
         this.axios.post('/api/warehouse_stock_highest_list',{...row}).then(res=>{
              this.tableData = res.data.data;
+             this.material_list= res.data.material_list;
              this.total = res.data.total;
-             for(let i =0;i<res.data.material.length;i++){
-                 this.materialNameList.push({id:res.data.material[i],title:res.data.material[i]})
-             }
-               for(let i =0;i<res.data.type_title.length;i++){
-                 this.materialTypeList.push({id:res.data.type_title[i],title:res.data.type_title[i]})
-             }
-             
         })
     }
   }

+ 18 - 15
src/views/Warehouse/Warehouse/minStockList.vue

@@ -11,6 +11,7 @@
         </div>
       </slot>
     </Toptitle>
+    <div style="height:80%;over-flow:auto">
     <div class="warehouseList_top">
       <Form :label-width="100">
         <FormItem label="物料分类">
@@ -40,8 +41,8 @@
           </Select>
         </FormItem>
         <FormItem label='规格型号'>
-              <Select>
-                <Option/>
+              <Select v-model="searchData.material_detail_id" filterable multiple>
+                <Option v-for="item in material_list" :key="item.material_detail_id" :value="item.material_detail_id" :label='`${item.long?item.long:0}*${item.width?item.width:0}*${item.high?item.high:0}`'/>
               </Select>
         </FormItem>
         <FormItem>
@@ -55,6 +56,8 @@
              :data="tableData"
              border>
       </Table>
+      </div>
+     </div>
       <div class="pageSlotStyle">
         <Page :page-size-opts="[10, 20, 30, 40,100,1000]"
               @on-page-size-change='changeSize'
@@ -65,7 +68,7 @@
               show-sizer
               :page-size='page_size' />
       </div>
-    </div>
+    
   </div>
 </template>
 
@@ -78,11 +81,12 @@ export default {
   data () {
     // 这里存放数据
     return {
+      material_list:[],
       searchData: {
-        warehouse_id: null,
-        material_type_id: null,
-        material_id: null,
-        state: null,
+       
+        material_type_id: [],
+        material_id: [],
+       material_detail_id:[]
       },
       tableColums: [
         { title: '物料名称', align: 'center', key: 'material_title', minWidth: 100 },
@@ -132,13 +136,11 @@ export default {
   },
   methods: {
     handleSearchData () {
-      let obj = {
-        warehouse_id: this.searchData.warehouse_id ? this.searchData.warehouse_id.join(',') : null,
-        material_type_id: this.searchData.material_type_id ? this.searchData.material_type_id.join(',') : null,
-        material_id: this.searchData.material_id ? this.searchData.material_id.join(',') : null,
-        page_index:this.page_index,
-        page_size:this.page_size,
-      }
+      let obj = JSON.parse(JSON.stringify(this.searchData));
+       
+        obj.page_index=this.page_index
+        obj.page_size=this.page_size
+    
       this.getData(obj)
     },
     init (row) {
@@ -150,8 +152,9 @@ export default {
     },
     getData (row) {
       this.loading = true;
-      this.axios('/api/warehouse_stock_warning_list', { params: row }).then(res => {
+      this.axios.post('/api/warehouse_stock_warning_list', { ...row }).then(res => {
         this.loading = false;
+        this.material_list = res.data.material_list;
         this.tableData = res.data.data;
         this.total = res.data.total;
       })

+ 256 - 112
src/views/Warehouse/Warehouse/stockingList.vue

@@ -14,32 +14,32 @@
     <div style="height:90%;over-flow:auto">
     <div class="warehouseList_top">
       <Form :label-width="100">
-        <FormItem label='仓库分类'>
-          <Select>
-            <Option />
-          </Select>
-        </FormItem>
-        <FormItem label="仓库名称">
-          <Select v-model="searchData.warehouse_id"
+        <FormItem label="仓库分类">
+          <Select
                   clearable
-                  multiple
-                  filterable
+                  @on-change='change_type'
                   style="width:200px">
             <Option v-for="item in warehouseList"
                     :key="item.id"
-                    :value="item.id"
-                    :label="item.title">
+                    :value="item.type_id"
+                    :label="item.type_title">
             </Option>
           </Select>
         </FormItem>
-   <FormItem label='物料分类'>
-          <Select>
-            <Option />
+  <FormItem label='仓库名称' v-show="show">
+          <Select v-model="warehouse_id">
+            <Option v-for="item in warehouseNameList" :key="item.id" :value="item.id" :label="item.title"/>
           </Select>
         </FormItem>
-        <FormItem label="物料名称">
-          <Select v-model="searchData.material_id"
-                  clearable
+   <FormItem label='物料分类'  v-show="up_show">
+          <Select v-model="up_searchData.material_type_id" filterable clearable @on-change='material_select'>
+            <Option v-for="item in materialTypeList" :key="item.id" :value="item.id" :label="item.title"/>
+          </Select>
+        </FormItem>
+        <FormItem label="物料名称"  v-show="up_show_material">
+          <Select 
+                  v-model="up_searchData.material_id"
+                  @on-change='material_select_name'
                   multiple
                   filterable
                   style="width:200px">
@@ -50,18 +50,42 @@
             </Option>
           </Select>
         </FormItem>
-         <FormItem label='规格型号'>
-          <Select>
-            <Option />
+         <FormItem label='规格型号'  v-show="up_show_material_size">
+          <Select v-model="up_searchData.material_detail_id" filterable multiple>
+            <Option v-for="item in material_size_list" :key="item.id" :value="item.id" :label="item.label"/>
+          </Select>
+        </FormItem>
+<FormItem label='项目名称:' v-show="down_show">
+          <Select filterable multiple v-model="down_searchData.project_title">
+            <Option v-for="(item,index) in project_title_list" :key="index" :value="item.value" :label="item.label"/>
+          </Select>
+        </FormItem>
+       <FormItem label='图号:' v-show="down_show">
+          <Select filterable multiple v-model="down_searchData.url_number">
+            <Option v-for="(item,index) in url_number_list" :key="index" :value="item.url_number" :label="item.url_number"/>
+          </Select>
+        </FormItem>
+         <FormItem label='产品名称' v-show="down_show">
+          <Select filterable multiple v-model="down_searchData.product_id">
+            <Option v-for="item in product_list" :key="item.id" :value="item.id" :label="item.title"/>
+          </Select>
+        </FormItem>
+        <FormItem label='房间号:' v-show="down_show">
+          <Select filterable multiple v-model="down_searchData.house_id" >
+            <Option v-for="item in house_list" :key="item.house_id" :value="item.house_id" :label="item.label"/>
           </Select>
         </FormItem>
-        <FormItem>
+        <FormItem v-show="up_show">
           <Button type="primary"
-                  @click="handleSearchData">搜索</Button>
+                  @click="up_search">搜索</Button>
+        </FormItem>
+          <FormItem v-show="down_show">
+          <Button type="primary"
+                  @click="down_search">搜索</Button>
         </FormItem>
       </Form>
     </div>
-    <div class="warehouseList_content">
+    <div class="warehouseList_content" v-show="up_show">
       <Table :columns="tableColumns"
              :data="tableData"
              border
@@ -79,68 +103,22 @@
               :page-size='page_size' />
       </div>
     </div>
-     <div class="warehouseList_top" style="margin-top:40px">
-      <Form :label-width="100">
-        <FormItem label='仓库分类:'>
-          <Select>
-            <Option />
-          </Select>
-        </FormItem>
-        <FormItem label="仓库名称:">
-          <Select v-model="searchData.warehouse_id"
-                  clearable
-                  multiple
-                  filterable
-                  style="width:200px">
-            <Option v-for="item in warehouseList"
-                    :key="item.id"
-                    :value="item.id"
-                    :label="item.title">
-            </Option>
-          </Select>
-        </FormItem>
-   <FormItem label='项目名称:'>
-          <Select>
-            <Option />
-          </Select>
-        </FormItem>
-       <FormItem label='图号:'>
-          <Select>
-            <Option />
-          </Select>
-        </FormItem>
-         <FormItem label='产品名称'>
-          <Select>
-            <Option />
-          </Select>
-        </FormItem>
-        <FormItem label='房间号:'>
-          <Select>
-            <Option />
-          </Select>
-        </FormItem>
-        <FormItem>
-          <Button type="primary"
-                  @click="handleSearchData">搜索</Button>
-        </FormItem>
-      </Form>
-    </div>
-    <div class="warehouseList_content">
+    <div class="warehouseList_content" v-show="down_show">
       <Table :columns="footTableColumns"
-             :data="tableData"
+             :data="footTableData"
              border
              :summary-method="handleSummary"
              show-summary>
       </Table>
       <div class="pageSlotStyle">
         <Page :page-size-opts="[10, 20, 30, 40,100,1000]"
-              @on-page-size-change='changeSize'
-              @on-change='changePage'
-              :current='page_index'
+              @on-page-size-change='down_changeSize'
+              @on-change='down_changePage'
+              :current='down_page_index'
               show-total
-              :total="total"
+              :total="down_total"
               show-sizer
-              :page-size='page_size' />
+              :page-size='down_page_size' />
       </div>
     </div>
     </div>
@@ -156,11 +134,24 @@ export default {
   data () {
     // 这里存放数据
     return {
-      searchData: {
-        warehouse_id: null,
-        material_type_id: null,
-        material_id: null,
-        state: null,
+      material_size_list:[],
+      up_show_material_size:false,
+      warehouse_id:'',
+      up_show_material:false,
+      type:'',
+      up_show:false,
+      down_show:false,
+      show:false,
+      up_searchData: {
+        material_type_id: '',
+        material_detail_id:[],
+        material_id:[],
+      },
+      down_searchData:{
+        project_title:[],
+        url_number:[],
+        product_id:[],
+        house_id:[]
       },
       tableColumns: [
         { title: '仓库名称', align: 'center', key: 'warehouse_title', minWidth: 150 },
@@ -180,7 +171,7 @@ export default {
           title: '单价(元)', align: 'center', key: '', minWidth: 100,
           render: (h, params) => {
             const { row } = params
-            let text = (Number(row.total_price) / Number(row.num)).toFixed(6)
+            let text = (Number(row.price) / Number(row.num)).toFixed(6)
             return h('span', {}, text)
           }
         },
@@ -188,53 +179,198 @@ export default {
           title: '金额', align: 'center', key: 'total_price', minWidth: 100,
           render: (h, params) => {
             const { row } = params
-            let text = (row.total_price).toFixed(2)
+            let text = (row.price*1*row.num).toFixed(2)
             return h('span', {}, text)
           }
         },
       ],
       footTableColumns:[  { title: '仓库名称', align: 'center', key: 'warehouse_title', minWidth: 150 },
-        { title: '项目名称', align: 'center', key: 'warehouse_title', minWidth: 150 },
-          { title: '图号', align: 'center', key: 'warehouse_title', minWidth: 150 },
-            { title: '产品名称', align: 'center', key: 'warehouse_title', minWidth: 150 },
-              { title: '房间号', align: 'center', key: 'warehouse_title', minWidth: 150 },
-                { title: '包数', align: 'center', key: 'warehouse_title', minWidth: 150 },],
+        { title: '项目名称', align: 'center', key: 'project_title', minWidth: 150 },
+          { title: '图号', align: 'center', key: 'url_number', minWidth: 150 },
+            { title: '产品名称', align: 'center', key: 'product_title', minWidth: 150 },
+              { title: '房间号', align: 'center', key: 'number', minWidth: 150 },
+                { title: '包数', align: 'center', key: 'num', minWidth: 150 },],
       tableData: [],
+      footTableData:[],
       page_index: 1,
+      down_page_index:1,
       page_size: 10,
+      down_page_size:10,
+      down_total:0,
       total: 0,
       loading: false,
       proxyObj: {},
       selects: [],
-      salesmanList: [],
       warehouseList: [],
+      warehouseNameList:[],
       materialTypeList: [],
       materialNameList: [],
+      url_number_list:[],
+      product_list:[],
+      house_list:[],
       processModal: false,
       order_no: '',
       currencyEditRow: {},
-      submitData: []
+      submitData: [],
+      project_title_list:[],
     }
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   mounted () {
-    this.page_index = 1
-    this.proxyObj.page_index = this.page_index;
-    this.proxyObj.page_size = this.page_size;
-    this.getData(this.proxyObj)
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   created () {
-    // 获取用户
-    this.axios('/api/user').then(res => { this.salesmanList = res.data.data })
+    //获取项目名称
+    //  this.axios.get('/api/purchase_orders_list').then(res=>{
+    //             let arr = [];
+    //             res.data.project_name.forEach(v=>{
+    //               let obj = {};
+    //               obj.value = v;
+    //               obj.label = v;
+    //               arr.push(obj);
+    //             })
+    //             this.project_title_list = arr;
+    //         })
     // 获取仓库列表   warehouse_id   
     this.axios('/api/warehouse').then(res => { this.warehouseList = res.data })
     // 获取物料分类列表 
     this.axios('/api/basics_material_index').then(res => { this.materialTypeList = res.data.data })
-    // 获取物料名称列表
-    this.axios('/api/material').then(res => { this.materialNameList = res.data.data })
+    // // 获取物料名称列表
+    // this.axios('/api/material').then(res => { this.materialNameList = res.data.data })
   },
   methods: {
+    material_select_name(e){
+      console.log(e);
+      if(e.length!=0){
+      let obj = e.toString();
+      this.up_searchData.material_detail_id = [];
+         this.axios.get('/api/material',{params:{id:obj}}).then(res=>{
+                 this.up_show_material_size = true;
+                 let arr =[];
+                 let option= [];
+                 res.data.forEach(v=>{
+                   v.detail.forEach(m=>{
+                     m.title = v.title;
+                   })
+                   arr.push(...v.detail);
+                 })
+                 arr.forEach(v=>{
+                   let obj ={};
+                   obj.label = `${v.title}-${v.long?v.long:0}*${v.width?v.width:0}*${v.high?v.high:0}`
+                   obj.id =v.id
+                   option.push(obj) 
+                 })
+                 console.log(option);
+         
+                   this.material_size_list = JSON.parse(JSON.stringify(option));
+        
+
+         })
+      }else{
+        this.up_show_material_size = false;
+        this.up_searchData.material_detail_id = [];
+      }
+    },
+    material_select(e){
+      if(e){
+        this.up_searchData.material_id = [];
+        this.up_searchData.material_detail_id =[];
+          this.axios('/api/material',{params:{type_id:e}}).then(res => { 
+         this.materialNameList = res.data.data;
+         this.up_show_material = true;
+         })
+      }else{
+        this.up_show_material = false;
+        this.up_show_material_size = false;
+        this.up_searchData.material_id =[];
+        this.up_searchData.material_detail_id = [];
+      }
+     
+    },
+    standingCropData(){
+          this.axios.post('/api/warehouse_stock_material_list').then(res=>{
+                this.tableData = res.data.data;
+                this.total = res.data.total;
+          })
+    },
+    packData(){
+     this.axios.post('/api/warehouse_stock_pack_list').then(res=>{
+             this.footTableData = res.data.data;
+                         this.down_total = res.data.total;
+                         res.data.order_list.forEach(v=>{
+                           v.value = v.project_title;
+                           v.label = v.project_title;
+                         })
+                         this.project_title_list = res.data.order_list;
+                this.url_number_list = res.data.url_number_list;
+                res.data.house_list.forEach(v=>{
+                  v.label = `${v.house?`${v.house}-`:''}${v.unit?`${v.unit}-`:''}${v.layer?`${v.layer}-`:''}${v.number?v.number:''}`
+                })
+                this.house_list = res.data.house_list;
+                this.product_list = res.data.product_list;
+     })
+    },
+    change_type(e){
+     this.type = e;
+     this.page_index=1;
+     this.page_size=10;
+     this.down_page_index =1;
+     this.down_page_size =10;
+     if(this.type==1){
+       this.down_show = false;
+       this.show = true;
+       this.up_show = true;
+        this.down_show = false;
+       this.footTableData = [];
+       this.up_show_material = false;
+       this.up_show_material_size = false;
+         this.down_searchData.project_title=[]
+        this.down_searchData.url_number=[]
+        this.down_searchData.product_id=[]
+        this.down_searchData.house_id=[]
+       this.warehouse_id = '';
+      this.standingCropData();
+      let arr = [];
+      this.warehouseList.forEach(v=>{
+         if(v.type_id==this.type){
+           arr.push(v)
+         }
+      })
+      this.warehouseNameList=arr;
+     }else if(this.type==2){
+        this.down_show = true;
+        this.show=true;
+       this.up_show = false;
+     this.up_searchData.material_type_id = '';
+       this.tableData = [];
+       this.up_show_material = false;
+       this.up_show_material_size = false;
+       this.warehouse_id = '';
+       this.packData();
+        let arr = [];
+      this.warehouseList.forEach(v=>{
+         if(v.type_id==this.type){
+           arr.push(v)
+         }
+      })
+      this.warehouseNameList=arr;
+     }else{
+       this.down_show = false;
+       this.show = false;
+       this.up_show = false;
+       this.tableData = [];
+       this.footTableData = [];
+       this.up_show_material = false;
+       this.up_show_material_size = false;
+       this.warehouse_id = '';
+       this.up_searchData.material_type_id='';
+        this.down_searchData.project_title=[]
+        this.down_searchData.url_number=[]
+        this.down_searchData.product_id=[]
+        this.down_searchData.house_id=[]
+     }
+    },
+
      handleSummary ({ columns, data }) {
                 const sums = {};
                 columns.forEach((column, index) => {
@@ -288,16 +424,18 @@ export default {
 
                 return sums;
             },
-    handleSearchData () {
-      let obj = {
-        warehouse_id: this.searchData.warehouse_id ? this.searchData.warehouse_id.join(',') : null,
-        material_type_id: this.searchData.material_type_id ? this.searchData.material_type_id.join(',') : null,
-        material_id: this.searchData.material_id ? this.searchData.material_id.join(',') : null,
-        page_index: this.page_index,
-        page_size: this.page_size,
-      }
-      this.getData(obj)
-    },
+         up_search(){
+               this.axios.post('/api/warehouse_stock_material_list',{...this.up_searchData,warehouse_id:this.warehouse_id,page_size:this.page_size,page_index:this.page_index}).then(res=>{
+                    this.tableData = res.data.data;
+                    this.total = res.data.total;
+               })
+         },
+         down_search(){
+                       this.axios.post('/api/warehouse_stock_pack_list',{...this.down_searchData,warehouse_id:this.warehouse_id,page_index:this.down_page_index,page_size:this.down_page_size}).then(res=>{
+                         this.footTableData = res.data.data;
+                         this.down_total = res.data.total;
+                       })
+         },
     init (row) {
       this.page_index = 1
       row.page_index = this.page_index;
@@ -315,14 +453,20 @@ export default {
     },
     changePage (e) {
       this.page_index = e;
-      this.proxyObj.page_index = this.page_index;
-      this.getData(this.proxyObj)
+      this.up_search();
     },
     changeSize (e) {
       this.page_size = e;
-      this.proxyObj.page_size = this.page_size;
-      this.getData(this.proxyObj)
+      this.up_search();
     },
+    down_changePage(e){
+       this.down_page_index = e;
+       this.down_search();
+    },
+    down_changeSize(e){
+this.down_page_size = e;
+this.down_search();
+    }
     // async exportData () {
     //   const res = await this.axios('/api/measure_orders_export', { params: { ...this.proxyObj } })
     //   if (res.code == 200) {

+ 183 - 110
src/views/Warehouse/Warehouse/stockingTable.vue

@@ -11,15 +11,15 @@
         </div>
       </slot>
     </Toptitle>
+    <div style="height:82%;over-flow:auto">
     <div class="warehouseList_top">
       <Form :label-width="100">
         <FormItem label="物料名称:">
-          <Select v-model="searchData.warehouse_id"
+          <Select @on-change='selectMaterial'
                   clearable
-                  multiple
                   filterable
                   style="width:200px">
-            <Option v-for="item in warehouseList"
+            <Option v-for="item in materialNameList"
                     :key="item.id"
                     :value="item.id"
                     :label="item.title">
@@ -28,12 +28,12 @@
         </FormItem>
 
         <FormItem label="规格型号:">
-          <Select v-model="searchData.material_id"
+          <Select v-model="searchData.material_detail_id"
                   clearable
-                  multiple
+                  :disabled='material_size'
                   filterable
                   style="width:200px">
-            <Option v-for="item in materialNameList"
+            <Option v-for="item in materialSizeList"
                     :key="item.id"
                     :value="item.id"
                     :label="item.title">
@@ -44,8 +44,8 @@
          <span>原材料仓</span>
         </FormItem>
         <FormItem label='仓库名称'>
-          <Select>
-          <Option/>
+          <Select v-model="searchData.warehouse_id" filterable multiple>
+          <Option v-for="item in warehouseList" :key="item.id" :value="item.id" :label="item.title"/>
           </Select>
         </FormItem>
         <FormItem label="选择时间">
@@ -76,13 +76,13 @@
       </Table> -->
       <vxe-table border
                  resizable
-                 max-height="500"
+                 max-height="550"
                  align="center"
                  :merge-cells="mergeCells"
                  :data="tableData">
         <vxe-table-column field="crt_time"
                           title="单据日期"
-                          min-width="110">
+                          min-width="122">
           <template #default="{ row }">
             {{ (row.crt_time*1)? func.replaceDate(row.crt_time+'') :row.crt_time}}
           </template>
@@ -92,23 +92,23 @@
                           title="单据号"></vxe-table-column>
         <vxe-table-column field="warehouse_title"
                           title="仓库"
-                          min-width="60"></vxe-table-column>
+                          min-width="65"></vxe-table-column>
         <vxe-table-column field="type"
                           title="单据类型"
                           min-width="80">
           <template #default="{ row }">
-            {{(row.type==1?'入库单':'出库单')}}
+            {{(row.type==1||row.type==3?'入库单':'出库单')}}
           </template>
         </vxe-table-column>
         <vxe-table-column field="in_num"
-                          min-width="100"
+                          min-width="90"
                           title="入库数量"></vxe-table-column>
         <vxe-table-column field="in_price"
-                          min-width="100"
+                          min-width="105"
                           title="入库单价">
-          <template #default="{ row }">
+          <!-- <template #default="{ row }">
             {{(row.in_total_price&&row.in_total_price!=0)&&(row.in_num!=0?1 * row.in_total_price / row.in_num:0)}}
-          </template>
+          </template> -->
         </vxe-table-column>
         <vxe-table-column field="in_total_price"
                           min-width="100"
@@ -117,14 +117,14 @@
                           min-width="100"
                           title="出库数量"></vxe-table-column>
         <vxe-table-column field="out_price"
-                          min-width="100"
+                          min-width="105"
                           title="出库单价">
-          <template #default="{ row }">
+          <!-- <template #default="{ row }">
             {{(row.out_total_price&&row.out_total_price!=0)&&(row.out_num!=0?1 * row.out_total_price / row.out_num:0)}}
-          </template>
+          </template> -->
         </vxe-table-column>
         <vxe-table-column field="out_total_price"
-                          min-width="100"
+                          min-width="105"
                           title="出库金额"></vxe-table-column>
         <vxe-table-column field="before_num"
                           min-width="100"
@@ -132,24 +132,26 @@
         <vxe-table-column field="before_price"
                           min-width="100"
                           title="结存单价">
-          <template #default="{ row }">
+          <!-- <template #default="{ row }">
             {{ row.before_num != 0 ? 1 * row.before_total_price / row.before_num : 0 }}
-          </template>
+          </template> -->
         </vxe-table-column>
         <vxe-table-column field="before_total_price"
                           min-width="100"
                           title="结存金额"></vxe-table-column>
         <vxe-table-column field=""
-                          min-width="100"
+                          width="100"
                           title="操作">
           <template #default="{ row }">
             <a style="margin:0 5px"
                v-show="row.crt_time*1"
-               @click="handleSet(row,1)">详情</a>
+               @click="handleSet(row)">详情</a>
           </template>
         </vxe-table-column>
 
       </vxe-table>
+      </div>
+      </div>
       <div class="pageSlotStyle">
         <Page :page-size-opts="[10, 20, 30, 40,100,1000]"
               @on-page-size-change='changeSize'
@@ -160,7 +162,7 @@
               show-sizer
               :page-size='page_size' />
       </div>
-    </div>
+    
     <Modal v-model="processModal"
            title="编辑"
            @on-ok="handleProcess"
@@ -214,56 +216,57 @@ export default {
   data () {
     // 这里存放数据
     return {
+      material_size:true,
+      materialSizeList:[],
       searchData: {
+        material_detail_id:null,
         warehouse_id: null,
-        material_type_id: null,
-        material_id: null,
         date: null,
         start_time: null,
         end_time: null,
       },
-      tableColums: [
-        {
-          title: '单据日期', align: 'center', key: 'crt_time', minWidth: 150,
-          render: (h, params) => {
-            return h('span', {}, this.func.replaceDate(params.row.crt_time))
-          }
-        },
-        { title: '单据号', align: 'center', key: 'order_no', minWidth: 120 },
-        { title: '仓库', align: 'center', key: 'warehouse_title', minWidth: 100 },
-        { title: '单据类型', align: 'center', key: 'type', minWidth: 100 },
-        { title: '入库数量', align: 'center', key: 'in_num', minWidth: 100, },
-        {
-          title: '入库单价', align: 'center', key: '', minWidth: 100,
-          render: (h, params) => {
-            const { row } = params
-            let text = row.in_num != 0 ? 1 * row.in_total_price / row.in_num : 0
-            return h('span', {}, text)
-          }
-        },
-        { title: '入库金额', align: 'center', key: 'in_total_price', minWidth: 100 },
-        { title: '出库数量', align: 'center', key: 'out_num', minWidth: 100, },
-        {
-          title: '出库单价', align: 'center', key: '', minWidth: 100,
-          render: (h, params) => {
-            const { row } = params
-            let text = row.out_num != 0 ? 1 * row.out_total_price / row.out_num : 0
-            return h('span', {}, text)
-          }
-        },
-        { title: '出库金额', align: 'center', key: 'out_total_price', minWidth: 100 },
-        { title: '结存数量', align: 'center', key: 'before_num', minWidth: 100, },
-        {
-          title: '结存单价', align: 'center', key: '', minWidth: 100,
-          render: (h, params) => {
-            const { row } = params
-            let text = row.before_num != 0 ? 1 * row.before_total_price / row.before_num : 0
-            return h('span', {}, text)
-          }
-        },
-        { title: '结存金额', align: 'center', key: 'before_total_price', minWidth: 100 },
-        { title: '操作', align: 'center', key: 'set', slot: 'set', fixed: 'right', minWidth: 100 },
-      ],
+      // tableColums: [
+      //   {
+      //     title: '单据日期', align: 'center', key: 'crt_time', minWidth: 150,
+      //     render: (h, params) => {
+      //       return h('span', {}, this.func.replaceDate(params.row.crt_time))
+      //     }
+      //   },
+      //   { title: '单据号', align: 'center', key: 'order_no', minWidth: 120 },
+      //   { title: '仓库', align: 'center', key: 'warehouse_title', minWidth: 100 },
+      //   { title: '单据类型', align: 'center', key: 'type', minWidth: 100 },
+      //   { title: '入库数量', align: 'center', key: 'in_num', minWidth: 100, },
+      //   {
+      //     title: '入库单价', align: 'center', key: '', minWidth: 100,
+      //     render: (h, params) => {
+      //       const { row } = params
+      //       let text = row.in_num != 0 ? 1 * row.in_total_price / row.in_num : 0
+      //       return h('span', {}, text)
+      //     }
+      //   },
+      //   { title: '入库金额', align: 'center', key: 'in_total_price', minWidth: 100 },
+      //   { title: '出库数量', align: 'center', key: 'out_num', minWidth: 100, },
+      //   {
+      //     title: '出库单价', align: 'center', key: '', minWidth: 100,
+      //     render: (h, params) => {
+      //       const { row } = params
+      //       let text = row.out_num != 0 ? 1 * row.out_total_price / row.out_num : 0
+      //       return h('span', {}, text)
+      //     }
+      //   },
+      //   { title: '出库金额', align: 'center', key: 'out_total_price', minWidth: 100 },
+      //   { title: '结存数量', align: 'center', key: 'before_num', minWidth: 100, },
+      //   {
+      //     title: '结存单价', align: 'center', key: '', minWidth: 100,
+      //     render: (h, params) => {
+      //       const { row } = params
+      //       let text = row.before_num != 0 ? 1 * row.before_total_price / row.before_num : 0
+      //       return h('span', {}, text)
+      //     }
+      //   },
+      //   { title: '结存金额', align: 'center', key: 'before_total_price', minWidth: 100 },
+      //   { title: '操作', align: 'center', key: 'set', slot: 'set', fixed: 'right', minWidth: 100 },
+      // ],
       tableData: [],
       page_index: 1,
       page_size: 10,
@@ -286,16 +289,44 @@ export default {
     this.page_index = 1
     this.proxyObj.page_index = this.page_index;
     this.proxyObj.page_size = this.page_size;
-    this.getData(this.proxyObj)
+    // this.getData(this.proxyObj)
+  },
+ beforeRouteLeave(to, from, next) {
+    if (to.path == "/cms/PurchasingManage/InstockOrder/detail"||to.path == "/cms/PurchasingManage/redFontInstockOrder/detail"||to.path == "/cms/PurchasingManage/OutstockOrder/detail"||to.path == "/cms/PurchasingManage/redFontOutstockOrder/detail") {
+      console.log(11212)
+      this.$route.meta.keepAlive = true;
+    } else {
+      this.$route.meta.keepAlive = false;
+    }
+    next();
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   created () {
     // 获取仓库列表   warehouse_id   
-    this.axios('/api/warehouse').then(res => { this.warehouseList = res.data })
+    this.axios('/api/warehouse').then(res => { 
+      this.warehouseList = res.data.filter(v=>{
+        return v.type_id ==1
+      })
+       })
     // 获取物料名称列表
     this.axios('/api/material').then(res => { this.materialNameList = res.data.data })
   },
   methods: {
+    selectMaterial(e){
+      if(e){
+          this.axios.get('/api/material',{params:{id:e}}).then(res=>{
+           this.materialSizeList = res.data[0].detail;
+           this.materialSizeList.forEach(v=>{
+             v.title = `${v.long?v.long:0}*${v.width?v.width:0}*${v.high?v.high:0}`
+           })
+           this.material_size = false;
+         })
+      }else{
+        this.searchData.material_detail_id = '';
+        this.material_size = true;
+      }
+       
+    },
     handleProcess () {
       this.axios({
         method: 'post',
@@ -309,32 +340,39 @@ export default {
       }).catch((err) => { });
     },
     handleSearchData () {
+      if(!this.searchData.material_detail_id){
+       return this.$Message.warning('请先选择物料名称和规格!')
+      }
+      if(!this.searchData.date[0]&&!this.searchData.date[1]){
+        return this.$Message.warning('请选择时间!')
+      }
       let obj = {
         warehouse_id: this.searchData.warehouse_id ? this.searchData.warehouse_id.join(',') : null,
-        material_type_id: this.searchData.material_type_id ? this.searchData.material_type_id.join(',') : null,
-        material_id: this.searchData.material_id ? this.searchData.material_id.join(',') : null,
-        start_time: this.searchData.date[0] ? this.func.replaceDateNoHMS(this.searchData.date[0]) : null,
-        end_time: this.searchData.date[0] ? this.func.replaceDateNoHMS(this.searchData.date[1]) : null,
+        material_detail_id: this.searchData.material_detail_id ? this.searchData.material_detail_id : null,
+        start_time: this.searchData.date[0] ? Date.parse(this.searchData.date[0]).toString().slice(0,10) : 0,
+        end_time: this.searchData.date[1] ? Date.parse(this.searchData.date[1]).toString().slice(0,10) : 0,
         page_index: this.page_index,
         page_size: this.page_size,
       }
+      this.proxyObj = obj;
       this.getData(obj)
     },
     handleSelectionChange (selection) { this.submitData = selection },
     //审核、弃审  2编辑
-    handleSet (row, type) {
-      switch (type) {
-        case 1:
-          // 1入库 2出库
-          this.$router.push({
-            path: '/cms/Warehouse/Warehouse/stockingTableEdit',
-            query: {
-              type: row.type,
-              order_no: row.order_no
-            }
-          })
-          break;
-      }
+    handleSet (row) {
+        // 1入库2红字入库3出库4红字出库
+        if(row.type == 1){
+          this.$router.push({path:'/cms/PurchasingManage/InstockOrder/detail',query:{order_in_no:row.order_no}})
+        }
+        if(row.type == 2){
+          this.$router.push({path:'/cms/PurchasingManage/redFontInstockOrder/detail',query:{order_red_no:row.order_no}})
+        }
+        if(row.type == 3){
+ this.$router.push({path:'/cms/PurchasingManage/OutstockOrder/detail',query:{order_out_no:row.order_no}})
+        }
+        if(row.type == 4){
+ this.$router.push({path:'/cms/PurchasingManage/redFontOutstockOrder/detail',query:{order_red_no:row.order_no}})
+        }
     },
     init (row) {
       this.page_index = 1
@@ -346,36 +384,68 @@ export default {
     getData (row) {
       this.loading = true;
       this.axios('/api/warehouse_stock_detail', { params: row }).then(res => {
+        if(res.code == 200){
+        this.tableData = [];
+        this.mergeCells = [];
         this.loading = false;
-        res.data.list.forEach(element => {
-          // 期初
-          this.tableData.push({
-            crt_time: '期初',
-            before_num: element.before.before_num,
-            before_total_price: element.before.before_total_price,
-            before_price: element.before_num != 0 ? 1 * element.before.before_total_price / element.before.before_num : 0,
-          })
-          this.tableData = this.tableData.concat(element.list)
+                // 期初
+        res.data.data.forEach(element => {
+           element.before_num = element.remain_num;
+           element.before_total_price = (element.remain_price*1).toFixed(2);
+           element.before_price = ((element.remain_price*1)/(element.remain_num*1)).toFixed(2);
+           if(element.type==1||element.type==3){
+             element.in_num = element.num;
+             element.in_price = (element.price*1).toFixed(2);
+             element.in_total_price = (element.num*1*element.price).toFixed(2);
+           }
+           if(element.type == 2||element.type == 4){
+             element.out_num = element.num;
+             element.out_price = (element.price).toFixed(2);
+             element.out_total_price =  (element.num*1*element.price).toFixed(2);
+           }
+           if(element.type==-1){
+             let obj = JSON.parse(JSON.stringify(element));
+             element.in_num = obj.in_num;
+             element.in_price = obj.in_price.toFixed(2);
+             element.in_total_price = (obj.in_num*1*obj.in_price).toFixed(2);
+               element.out_num = obj.out_num;
+             element.out_price = obj.out_price.toFixed(2);
+             element.out_total_price = (obj.out_num*1*obj.out_price).toFixed(2);
+              element.before_num = '';
+           element.before_total_price = '';
+           element.before_price = '';
+           }
+          this.tableData = this.tableData.concat(element)
           // 合计
+        
+        });
           this.tableData.push({
-            crt_time: '本月合计',
-            before_num: element.total.before_num,
-            before_total_price: element.total.before_total_price,
-            before_price: element.before_num != 0 ? 1 * element.total.before_total_price / element.total.before_num : 0,
-            in_num: element.total.in_num,
-            in_total_price: element.total.in_total_price,
-            in_price: element.in_num != 0 ? 1 * element.total.in_total_price / element.total.in_num : 0,
-            out_num: element.total.out_num,
-            out_total_price: element.total.out_total_price,
-            out_price: element.in_total_price != 0 ? 1 * element.total.out_total_price / element.total.out_num : 0,
+            crt_time: '合计',
+             type:-1,
+            in_num: res.data.total_data.in_num,
+            in_total_price: res.data.total_data.in_total_price.toFixed(2),
+          out_num:res.data.total_data.out_num,
+            out_total_price: res.data.total_data.out_total_price.toFixed(2),
+          })
+            this.tableData.unshift({
+            crt_time: '期初',
+            type:-1,
+            before_num: res.data.total_data.before_num,
+            before_total_price: res.data.total_data.before_total_price.toFixed(2),
+            before_price: res.data.total_data.before_num != 0 ? ((1 * res.data.total_data.before_total_price) / (res.data.total_data.before_num*1)).toFixed(2) : 0,
           })
-        });
         this.tableData.forEach((element, index) => {
           // 表内容合并
-          !(element.crt_time * 1) && this.mergeCells.push({ row: index, col: 0, rowspan: 0, colspan: 4 })
+         if(element.type==-1){
+            this.mergeCells.push({ row: index, col: 0, rowspan: 0, colspan: 4 });
+            !(element.crt_time) && (element.crt_time = '本月合计');
+
+         }
+       
         });
         this.total = res.data.total;
-      })
+      }
+    })
     },
     changePage (e) {
       this.page_index = e;
@@ -454,4 +524,7 @@ export default {
 /deep/.ivu-table-fixed-body {
   padding-bottom: 20px;
 }
+/deep/.vxe-body--row td{
+ height: 50px!important;
+}
 </style>