web100 vor 2 Jahren
Ursprung
Commit
1b390f64fa

+ 10 - 0
src/api/basicData/inventoryAccount.js

@@ -73,3 +73,13 @@ export function LockingQuantity() {
     method: 'get'
   })
 }
+//明细账
+export const selectStockInventory = (params) => {
+  return request({
+    url: '/api/blade-deliver-goods/allot/selectStockInventory',
+    method: 'get',
+    params: {
+      ...params
+    }
+  })
+}

+ 142 - 161
src/components/bill/billDetailList.vue

@@ -1,193 +1,174 @@
 <template>
   <div>
-    <avue-crud :option="option"
-               :table-loading="loading"
-               :data="data"
-               :search.sync="search"
-               ref="crud"
-               @refresh-change="refreshChange"
-               @selection-change="selectionChange"
-               @search-change="searchChange"
-               @saveColumn="saveColumn"
-               :page.sync="page"
-               @on-load="onLoad">
+    <avue-crud :option="option" :table-loading="loading" :data="data" :search.sync="search" ref="crud"
+      @refresh-change="refreshChange" @selection-change="selectionChange" @search-change="searchChange"
+      @saveColumn="saveColumn" :page.sync="page" @on-load="onLoad">
       <template slot="costTypeSearch">
-        <breakdown-select
-            v-model="search.costType"
-            :configuration="breakConfiguration"
-        ></breakdown-select>
+        <breakdown-select v-model="search.costType" :configuration="breakConfiguration"></breakdown-select>
       </template>
       <template slot="menuLeft">
         <el-tabs v-model="activeName" @tab-click="tabHandle">
           <el-tab-pane label="查询结果" name="searchList"></el-tab-pane>
-          <el-tab-pane
-              label="已选定数据"
-              name="importStaging"
-          ></el-tab-pane>
+          <el-tab-pane label="已选定数据" name="importStaging"></el-tab-pane>
         </el-tabs>
       </template>
       <template slot-scope="scope" slot="menu">
-        <el-button
-            type="text"
-            icon="el-icon-edit"
-            size="small"
-            @click.stop="importStagList(scope.row, scope.index)"
-            v-if="activeName == 'searchList'"
-            :disabled=" goodsListSave.findIndex(item => item.id == scope.row.id) !== -1 "
-        >选择
+        <el-button type="text" icon="el-icon-edit" size="small" @click.stop="importStagList(scope.row, scope.index)"
+          v-if="activeName == 'searchList'"
+          :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1">选择
         </el-button>
-        <el-button
-            type="text"
-            icon="el-icon-delete"
-            size="small"
-            @click.stop="removeStagList(scope.row, scope.index)"
-            v-else
-        >移除
+        <el-button type="text" icon="el-icon-delete" size="small" @click.stop="removeStagList(scope.row, scope.index)"
+          v-else>移除
         </el-button>
       </template>
     </avue-crud>
     <div class="dialogButton">
-       <span slot="footer" class="dialog-footer" >
-           <el-button @click="$emit('closeFun')">取 消</el-button>
-           <el-button type="primary" @click="importProMent" :disabled="goodsListSave.length == 0">导入</el-button>
-       </span>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="$emit('closeFun')">取 消</el-button>
+        <el-button type="primary" @click="importProMent" :disabled="goodsListSave.length == 0">导入</el-button>
+      </span>
     </div>
   </div>
 </template>
 
 <script>
-  import option from './config/mainList.json'
-  import { getBillList } from "@/api/financialManagement/paymentRequest";
+import option from './config/mainList.json'
+import { getBillList } from "@/api/financialManagement/paymentRequest";
 
-  export default {
-    name: "index",
-    props: {
-      billType:{
-        type: String
-      },
-      flag:{
-        type: Number
-      },
-      params:{
-        type: Object
+export default {
+  name: "index",
+  props: {
+    billType: {
+      type: String
+    },
+    flag: {
+      type: Number
+    },
+    params: {
+      type: Object
+    },
+    itemId: {
+      type: String
+    },
+    closeFun: {
+      type: Function
+    }
+  },
+  data() {
+    return {
+      activeName: "searchList",
+      option: option,
+      loading: false,
+      search: {},
+      data: [],
+      selectList: [],
+      page: {
+        pageSize: 20,
+        pagerCount: 1,
+        total: 0,
+        pageSizes: [20, 200, 300, 500, 700, 1000]
       },
-      itemId: {
-        type: String
+      breakConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        disabled: false,
+        searchShow: true,
+        collapseTags: false,
+        clearable: true,
+        placeholder: '请点击右边按钮选择',
+        dicData: []
       },
-      closeFun: {
-        type: Function
+      goodsListShow: [],
+      goodsListSave: []
+    }
+  },
+  watch: {
+    'params.corpId'(newVal, oldVal) {
+      if (newVal != oldVal) {
+        this.onLoad(this.page, this.search)
       }
+    }
+  },
+  async created() {
+    // this.option = await this.getColumnData(this.getColumnName(45), option);
+  },
+  methods: {
+    importStagList(row, index) {
+      // this.goodsListSave.push(row);
+      this.$refs.crud.toggleSelection([row]);
+    },
+    removeStagList(row, index) {
+      this.goodsListSave.splice(row.$index, 1);
     },
-    data(){
-      return {
-        activeName: "searchList",
-        option: option,
-        loading: false,
-        search: {},
-        data: [],
-        selectList: [],
-        page: {
-          pageSize: 20,
-          pagerCount: 1,
-          total: 0,
-          pageSizes: [20, 200, 300, 500, 700, 1000]
-        },
-        breakConfiguration: {
-          multipleChoices: false,
-          multiple: false,
-          disabled: false,
-          searchShow: true,
-          collapseTags: false,
-          clearable: true,
-          placeholder: '请点击右边按钮选择',
-          dicData: []
-        },
-        goodsListShow: [],
-        goodsListSave: []
+    // 标签页切换
+    tabHandle(data) {
+      if (data.name == "searchList") {
+        this.goodsListSave = this.data;
+        this.data = this.goodsListShow;
+        this.page.total = this.page.totalTwo
+      } else if (data.name == "importStaging") {
+        this.goodsListShow = this.data;
+        this.data = this.goodsListSave;
+        this.page.totalTwo = this.page.total;
+        this.page.total = 0;
       }
     },
-    watch:{
-      'params.corpId' (newVal,oldVal){
-        if(newVal != oldVal){
-          this.onLoad(this.page, this.search)
-        }
+    refreshChange() {
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      if (params.createStart) {
+        params.createStartDate = params.createStart[0]
+        params.createEndDate = params.createStart[1]
       }
+      this.onLoad(this.page, params);
+      done()
     },
-    async created() {
-      // this.option = await this.getColumnData(this.getColumnName(45), option);
+    selectionChange(row) {
+      // this.selectList = row
+      this.goodsListSave = row
+    },
+    onLoad(page, params) {
+
+      if(params && params.rentStartDate ){
+        params.createStartDate = params.rentStartDate[0] + " " + "00:00:00"?params.rentStartDate[0] + " " + "00:00:00":'';
+        params.createEndDate = params.rentStartDate[1] + " " + "23:59:59"?params.rentStartDate[1] + " " + "23:59:59":'';
+        this.$delete(params, 'rentStartDate')
+      }
+       
+      this.loading = true;
+      params = {
+        ...params,
+        ...this.params
+      }
+      params.billType = this.billType
+      if (this.$store.getters.userInfo.tenant_id === "673511") {
+        params.type = "CMY"
+      }
+      params.flag = this.flag
+      getBillList(page.currentPage, page.pageSize, params).then(res => {
+        this.data = res.data.data.records
+        this.page.total = res.data.data.total
+      }).finally(() => {
+        this.loading = false;
+      })
+    },
+    importProMent() {
+      this.$emit('importProMent', this.goodsListSave);
+    },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(45),
+        this.option
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
     },
-    methods: {
-      importStagList(row, index) {
-        // this.goodsListSave.push(row);
-        this.$refs.crud.toggleSelection([row]);
-      },
-      removeStagList(row, index) {
-        this.goodsListSave.splice(row.$index, 1);
-      },
-      // 标签页切换
-      tabHandle(data) {
-        if (data.name == "searchList") {
-          this.goodsListSave = this.data;
-          this.data = this.goodsListShow;
-          this.page.total = this.page.totalTwo
-        } else if (data.name == "importStaging") {
-          this.goodsListShow = this.data;
-          this.data = this.goodsListSave;
-          this.page.totalTwo = this.page.total;
-          this.page.total = 0;
-        }
-      },
-      refreshChange() {
-        this.onLoad(this.page);
-      },
-      searchChange(params, done) {
-        if (params.createStart) {
-          params.createStartDate = params.createStart[0]
-          params.createEndDate = params.createStart[1]
-        }
-        this.onLoad(this.page, params);
-        done()
-      },
-      selectionChange(row){
-        // this.selectList = row
-        this.goodsListSave = row
-      },
-      onLoad(page, params){
-        this.loading = true;
-        params = {
-          ...params,
-          ...this.params
-        }
-        params.billType = this.billType
-        if (this.$store.getters.userInfo.tenant_id === "673511") {
-          params.type = "CMY"
-        }
-        params.flag = this.flag
-        getBillList(page.currentPage, page.pageSize,params).then(res=>{
-          this.data = res.data.data.records
-          this.page.total = res.data.data.total
-        }).finally(()=>{
-          this.loading = false;
-        })
-      },
-      importProMent(){
-        this.$emit('importProMent',this.goodsListSave);
-      },
-      //列保存触发
-      async saveColumn() {
-        const inSave = await this.saveColumnData(
-          this.getColumnName(45),
-          this.option
-        );
-        if (inSave) {
-          this.$message.success("保存成功");
-          //关闭窗口
-          this.$refs.crud.$refs.dialogColumn.columnBox = false;
-        }
-      },
-    }
   }
+}
 </script>
-<style scoped>
-
-</style>
+<style scoped></style>

+ 1 - 1
src/components/bill/config/mainList.json

@@ -68,7 +68,7 @@
     },{
       "label": "日期",
       "prop": "rentStartDate",
-      "searchProp": "rentStartDateList",
+
       "type": "date",
       "search": true,
       "unlinkPanels": true,

+ 3 - 0
src/page/index/tags.vue

@@ -312,6 +312,9 @@ export default {
         if (tag.label == "锁定订单明细") {
           this.$store.commit("DOMKC_OUT_DETAIL");
         }
+        if (tag.label == "明细账") {
+          this.$store.commit("DEMKC_OUT_DETAIL");
+        }
         if (tag.label == "销项发票") {
           this.$store.commit("OUTPUT_OUT_DETAIL");
         }

+ 13 - 0
src/router/views/index.js

@@ -1511,6 +1511,19 @@ export default [{
     component: () => import( /* webpackChunkName: "views" */ '@/views/dealer/stock/index')
   }]
 },
+{
+  path: '/dealer/stock/detail',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/dealer/stock/detail',
+    name: '明细账',
+    meta: {
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/dealer/stock/detail')
+  }]
+},
 //内贸库存账
 {
   path: '/businessManagement/inventoryAccount/index',

+ 8 - 0
src/store/modules/ifdetail.js

@@ -213,6 +213,14 @@ const ifdetail = {
     DOMKC_OUT_DETAIL(state) {
       state.domStockDetail = false;
     },
+    //库存账里面的账明细
+    DEMKC_IN_DETAIL(state){
+      state.domStockDetail = true;
+    },
+    DEMKC_OUT_DETAIL(state){
+      state.domStockDetail = false;
+
+    },
     DOMCG_IN_DETAIL(state) {
       state.domPurStatus = true;
     },

+ 99 - 0
src/views/dealer/stock/config/detail.json

@@ -0,0 +1,99 @@
+{
+    "searchShow": true,
+    "searchMenuSpan": 8,
+    "border": true,
+    "index": true,
+    "viewBtn": false,
+    "editBtn": false,
+    "delBtn": false,
+    "addBtn": false,
+    "align": "center",
+    "menuWidth": "120",
+    "menu": false,
+    "showSummary": true,
+    "searchIcon": true,
+    "searchIndex": 2,
+    "selection": true,
+    "tip": false,
+    "expand": false,
+    "expandWidth": 38,
+    "sumColumnList": [
+        {
+            "name": "addQuantity",
+            "type": "sum"
+        },
+        {
+            "name": "subQuantity",
+            "type": "sum"
+        },
+        {
+            "name": "totalQuantity",
+            "type": "sum"
+        }
+    ],
+    "column": [
+        {
+            "label": "业务编号",
+            "prop": "sysNo",
+            "search": false,
+            "index": 1,
+            "minWidth": 80,
+            "overHidden": true,
+            "searchSpan": 8
+        },
+        {
+            "label": "业务日期",
+            "prop": "businessDate",
+            "search": false,
+            "index": 2,
+            "minWidth": 80,
+            "overHidden": true,
+            "searchSpan": 8
+        },
+        {
+            "label": "名称",
+            "prop": "goodsName",
+            "search": false,
+            "index": 3,
+            "minWidth": 80,
+            "overHidden": true,
+            "searchSpan": 8
+        },
+        {
+            "label": "类型",
+            "prop": "orderType",
+            "index": 4,
+            "minWidth": 80,
+            "overHidden": true
+        },
+        {
+            "label": "增加",
+            "prop": "addQuantity",
+            "index": 4,
+            "minWidth": 80,
+            "overHidden": true
+        },
+        {
+            "label": "减少",
+            "prop": "subQuantity",
+            "index": 4,
+            "minWidth": 80,
+            "overHidden": true
+        },
+        {
+            "label": "结余",
+            "prop": "totalQuantity",
+            "index": 4,
+            "hide":true,
+            "minWidth": 80,
+            "overHidden": true
+        },
+        {
+            "label": "状态",
+            "prop": "status",
+            "index": 4,
+            "minWidth": 80,
+            "overHidden": true
+        }
+    ]
+}

+ 147 - 0
src/views/dealer/stock/detail.vue

@@ -0,0 +1,147 @@
+<template>
+    <basic-container>
+      <avue-crud
+        ref="crud"
+        :data="dataList"
+        :option="option"
+        v-model="form"
+        :search.sync="search"
+        :table-loading="loading"
+        @saveColumn="saveColumn"
+        @resetColumn="resetColumn"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+      >
+        <template slot="orderNo" slot-scope="{ row, index }">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(row, index)">{{ row.orderNo }}</span>
+        </template>
+      </avue-crud>
+    </basic-container>
+  </template>
+  
+  <script>
+  import option from "./config/detail.json";
+  import {selectStockInventory} from "@/api/basicData/inventoryAccount";
+  
+  export default {
+    name: "detail",
+    data() {
+      return {
+        option: {},
+        dataList: [],
+        form: {},
+        page: {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        },
+        search: {},
+        loading: false,
+        params: null,
+      }
+    },
+    async created() {
+      // this.option = option
+      this.option = await this.getColumnData(this.getColumnName(67), option);
+      this.$store.commit("DEMKC_IN_DETAIL");
+    },
+    activated() {
+      this.params = {
+        goodsId: this.$route.query.goodsId,
+        stockId:this.$route.query.stockId
+      }
+      this.onLoad(this.page)
+    },
+    methods: {
+      onLoad(page, params) {
+        if (!this.params) return
+        params = {...params, ...this.params}
+        this.dataList.forEach(item => {
+          this.$refs.crud.toggleRowExpansion(item, false)
+        })
+        this.loading = true;
+        selectStockInventory(params)
+          .then(res => {
+            console.log('res',res);
+            this.dataList = res.data.data? res.data.data : [];
+            this.page.total = res.data.data.total;
+            if (this.page.total) {
+              this.option.height = window.innerHeight - 260;
+            }
+          })
+          .finally(() => {
+            this.loading = false;
+          });
+      },
+      searchChange(params, done) {
+        this.onLoad(this.page, params);
+        done();
+      },
+      currentChange(val) {
+        this.page.currentPage = val;
+      },
+      sizeChange(val) {
+        this.page.currentPage = 1;
+        this.page.pageSize = val;
+      },
+      refreshChange() {
+        this.dataList.forEach(item => {
+          this.$refs.crud.toggleRowExpansion(item, false)
+        })
+        this.page.currentPage = 1;
+        this.onLoad(this.page, this.search);
+      },
+      async saveColumn() {
+        const inSave = await this.saveColumnData(
+          this.getColumnName(67),
+          this.option
+        );
+        if (inSave) {
+          this.$message.success("保存成功");
+          //关闭窗口
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+      },
+      async resetColumn() {
+        this.option = option;
+        const inSave = await this.delColumnData(
+          this.getColumnName(67),
+          option
+        );
+        if (inSave) {
+          this.$message.success("重置成功");
+          //关闭窗口
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+      },
+      // 跳转
+      beforeOpenPage(row,index) {
+        if (this.$store.getters.domSaleStatus) {
+          this.$alert("销售单存在,请保存关闭销售单再进行操作", "温馨提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+            callback: action => {
+              console.log(action);
+            }
+          });
+        } else {
+          this.$router.$avueRouter.closeTag("/businessManagement/salesOrder/index");
+          this.$router.push({
+            path: "/businessManagement/salesOrder/index",
+            query: {
+              id: row.id
+            },
+          });
+        }
+      },
+    },
+  }
+  </script>
+  
+  <style scoped>
+  
+  </style>
+  

+ 28 - 0
src/views/dealer/stock/index.vue

@@ -12,6 +12,10 @@
           <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 1)">{{ row.cname }}
           </span>
         </template>
+        <template slot-scope="{ row }" slot="surplusRouteQuantity">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="quantityOpen(row)">{{ row.surplusRouteQuantity }}
+          </span>
+        </template>
         <template slot-scope="scope" slot="lockingQuantity">
           <span v-if="Number(scope.row.lockingQuantity) > 0" style="color: #409EFF;cursor: pointer"
             @click.stop="viewCell(scope.row, scope.index)">{{ scope.row.lockingQuantity }}</span>
@@ -178,6 +182,30 @@ export default {
       };
       this.show = false;
     },
+    quantityOpen(row) {
+      console.log('this.$store.getters.domStockDetail', this.$store.getters.domStockDetail);
+      if (this.$store.getters.domStockDetail) {
+        this.$alert("明细账已存在,请保存关闭明细账再进行操作", "温馨提示", {
+          confirmButtonText: "确定",
+          type: "warning",
+          callback: action => {
+            console.log(action);
+          }
+        });
+      } else {
+        this.params.corpId = row.corpId
+        this.params.itemId = row.goodsId
+        this.params.storageId = row.storageId
+        this.$router.$avueRouter.closeTag("/dealer/stock/detail");
+        this.$router.push({
+          path: "/dealer/stock/detail",
+          query: {
+            stockId: row.storageId,
+            goodsId: row.goodsId
+          },
+        });
+      }
+    },
     deletePrice(row, index) {
       if (row.id) {
         this.$confirm("确定将选择数据删除?", {

+ 2 - 1
src/views/financialManagement/paymentSettle/paymentSettle.vue

@@ -217,11 +217,12 @@
         return params
       },
       onLoad(page, params) {
+
+        console.log(params);
         this.loading = true
         params =  this.paramsAdjustment(params)
         params.billType = "付费"
         params.settlementType = 1
-
         getList(page.currentPage, page.pageSize,params).then(res =>{
           this.dataList = res.data.data.records
           this.page.total = res.data.data.total

+ 16 - 13
src/views/tirePartsMall/basicData/customerInformation/components/index.vue

@@ -107,6 +107,7 @@ export default {
     },
     //新增修改时保存触发
     rowSave(row, done, loading) {
+      console.log('33333333333333');
       row.corpType = customerParameter.code;
       typeSave(row).then(
         res => {
@@ -114,8 +115,8 @@ export default {
             type: "success",
             message: "操作成功!"
           });
-          done(row);
           this.onLoad(this.page);
+          done(row);
         },
         error => {
           window.console.log(error);
@@ -125,17 +126,17 @@ export default {
     },
     //查询全部
     initData() {
-      // customerList({corpType: customerParameter.code}).then(res => {
-      //   const column = this.findObject(this.option.column, "parentId");
-      //   column.dicData = res.data.data.records;
-      // });
+      customerList({corpType: customerParameter.code}).then(res => {
+        const column = this.findObject(this.option.column, "parentId");
+        column.dicData = res.data.data.records;
+      });
     },
     //新增子项触发
     handleAdd(row) {
-      // this.parentId = row.id;
-      // const column = this.findObject(this.option.column, "parentId");
-      // column.value = row.id;
-      // column.addDisabled = true;
+      this.parentId = row.id;
+      const column = this.findObject(this.option.column, "parentId");
+      column.value = row.id;
+      column.addDisabled = true;
       this.$refs.crud.rowAdd();
     },
     //新增子项和新增触发查询所有
@@ -152,10 +153,11 @@ export default {
     },
     //点击新增时触发
     beforeClose(done) {
-      // this.parentId = "";
-      // const column = this.findObject(this.option.column, "parentId");
-      // column.value = "";
-      // column.addDisabled = false;
+      console.log(1);
+      this.parentId = "";
+      const column = this.findObject(this.option.column, "parentId");
+      column.value = "";
+      column.addDisabled = false;
       done();
     },
     //点击搜索按钮触发
@@ -204,6 +206,7 @@ export default {
       values.parentId = 0;
       customerList(values)
         .then(res => {
+          console.log('24324');
           this.dataList = res.data.data.records;
           this.page.total = res.data.data.total;
         })

+ 2 - 1
src/views/tirePartsMall/basicData/customerInformation/configuration/mainList.json

@@ -53,7 +53,8 @@
       "prop": "parentId",
       "dicData": [],
       "type": "tree",
-      "hide": false,
+      "hide": true,
+      "showColumn":false,
       "addDisabled": false,
       "props": {
         "label": "cname",

+ 4 - 0
src/views/tirePartsMall/basicData/customerInformation/detailsPage.vue

@@ -60,6 +60,10 @@
             <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
               :disabled="detailData.status == 1" circle></el-button>
           </template>
+          <!-- <template slot="menuLeft">
+                    <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addRows">录入明细
+                    </el-button>
+                </template> -->
           <template slot-scope="{type,size,row,index,disabled}" slot="menu">
             <el-button :size="size" :disabled="disabled" :type="type"
               :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="$refs.crud.rowEdit(row, index)">{{

+ 16 - 16
src/views/tirePartsMall/basicData/supplier/components/corpType/index.vue

@@ -23,15 +23,15 @@
         @on-load="onLoad"
         @tree-load="treeLoad"
     >
-      <!--<template slot-scope="scope" slot="menu">-->
-      <!--  <el-button-->
-      <!--    type="text"-->
-      <!--    icon="el-icon-circle-plus-outline"-->
-      <!--    size="small"-->
-      <!--    @click.stop="handleAdd(scope.row, scope.index)"-->
-      <!--    >新增子项-->
-      <!--  </el-button>-->
-      <!--</template>-->
+      <template slot-scope="scope" slot="menu">
+       <el-button
+         type="text"
+         icon="el-icon-circle-plus-outline"
+         size="small"
+         @click.stop="handleAdd(scope.row, scope.index)"
+         >新增子项
+       </el-button>
+      </template>
     </avue-crud>
   </template>
   
@@ -128,16 +128,16 @@
       },
       //查询全部
       initData() {
-        // customerList({corpType: this.corpType?this.corpType:customerParameter.code}).then(res => {
-        //   const column = this.findObject(this.option.column, "parentId");
-        //   column.dicData = res.data.data.records;
-        // });
+        customerList({corpType: this.corpType?this.corpType:customerParameter.code}).then(res => {
+          const column = this.findObject(this.option.column, "parentId");
+          column.dicData = res.data.data.records;
+        });
       },
       //新增子项触发
       handleAdd(row) {
-        // this.parentId = row.id;
-        // const column = this.findObject(this.option.column, "parentId");
-        // column.value = row.id;
+        this.parentId = row.id;
+        const column = this.findObject(this.option.column, "parentId");
+        column.value = row.id;
         // column.addDisabled = true;
         this.$refs.crud.rowAdd();
       },

+ 7 - 7
src/views/tirePartsMall/basicData/supplier/components/index.vue

@@ -128,16 +128,16 @@ export default {
     },
     //查询全部
     initData() {
-      // customerList({corpType: this.corpType?this.corpType:customerParameter.code}).then(res => {
-      //   const column = this.findObject(this.option.column, "parentId");
-      //   column.dicData = res.data.data.records;
-      // });
+      customerList({corpType: this.corpType?this.corpType:customerParameter.code}).then(res => {
+        const column = this.findObject(this.option.column, "parentId");
+        column.dicData = res.data.data.records;
+      });
     },
     //新增子项触发
     handleAdd(row) {
-      // this.parentId = row.id;
-      // const column = this.findObject(this.option.column, "parentId");
-      // column.value = row.id;
+      this.parentId = row.id;
+      const column = this.findObject(this.option.column, "parentId");
+      column.value = row.id;
       // column.addDisabled = true;
       this.$refs.crud.rowAdd();
     },

+ 3 - 3
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/detailsPage.vue

@@ -248,13 +248,12 @@ export default {
                     {
                         label: "入库单号",
                         prop: "billno",
-                        disabled: false,
+                        disabled: true,
                     },
                     {
                         label: "来源单号",
                         prop: "ordNo",
-                        disabled: false,
-
+                        disabled: true,
                     }, {
                         label: '备注',
                         disabled: false,
@@ -277,6 +276,7 @@ export default {
                 border: true,
                 menuWidth: 120,
                 stripe: true,
+                span:8,
                 index: true,
                 menu: true,
                 dialogTop: 25,

+ 16 - 4
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/index.vue

@@ -16,7 +16,7 @@
         <template slot-scope="{row,index}" slot="stockClerkName">
           <el-select placeholder="请选择" v-if="row.$cellEdit" v-model="row.stockClerkName" size="small" filterable
             allow-create default-first-option clearable>
-            <el-option v-for="item in stockClerkNameList" :key="item" :label="item.account" :value="item"></el-option>
+            <el-option v-for="item in stockClerkNameList" :key="item" :label="item.account" :value="item.account"></el-option>
           </el-select>
           <span v-else>{{ row.stockClerkName }}</span>
         </template>
@@ -133,6 +133,8 @@ export default {
         }, {
           label: "仓库",
           prop: "storageName",
+          // searchProp:"storageId",
+          // searchProp: "createUser",
           search: true,
           overHidden: true,
           // width: 120,
@@ -182,10 +184,15 @@ export default {
           overHidden: true,
           type: 'select',
           props: {
-            label: 'name',
+            label: 'realName',
             value: 'id'
           },
-          dicUrl: "/api/blade-user/getWarehouseKeeper?salesCompanyId=" + JSON.parse(localStorage.getItem("saber-userInfo")).content.dept_id,
+          dicUrl: '/api/blade-user/stockClerkList',
+          // props: {
+          //   label: 'name',
+          //   value: 'id'
+          // },
+          // dicUrl: "/api/blade-user/getWarehouseKeeper?salesCompanyId=" + JSON.parse(localStorage.getItem("saber-userInfo")).content.dept_id,
           // width: 200
         }, {
           label: "制单人",
@@ -303,16 +310,21 @@ export default {
       });
     },
     searchChange(params, done) {
+      console.log(params);
       done();
       this.onLoad(this.page, params)
     },
     onLoad(page, params = {}) {
+      console.log(this.search);
       params = {
         ...params,
         current: page.currentPage,
         size: page.pageSize,
         bizTypeName: "SHGD,TKSHGD",
-        ...Object.assign(params, this.search)
+        ...Object.assign(params, this.search),
+        storageId:this.search.storageName,
+        statusName:this.search.$statusName,
+        stockClerkName:this.search.$stockClerkName
       }
       this.loading = true
       getList(params).then(res => {

+ 126 - 23
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -62,6 +62,7 @@
                     <el-tab-pane label="销售明细" name="sale_detail">
                         <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
                             :data="form.orderItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
+                            @row-close="rowClose" :before-close="beforeClose"
                             @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
                             @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)">
                             <template slot-scope="{scope,row}" slot="menuLeft">
@@ -156,21 +157,26 @@ import check from "@/components/check/check";
 import { getList } from "@/api/paymentManagement/paymentRecord"
 import TicketDistribution from "../../../oceanShipping/maritimeExport/components/ticketDistribution.vue";
 import M from "minimatch";
+import da from "element-ui/src/locale/lang/da";
+import { number } from "echarts";
 export default {
     name: "detailsPage",
 
     data() {
         return {
             inventory: 0,
+            isStatus: 1,
             goodsIdoptions: [],
             dataList: [],
             dicUrlWithCustomId: '',
+            sharedCompanyId: 0,
             isAddBtn: true,
             isSaveBtn: false,
             viewDisabled: false,
             isAdd: false,
             editButton: true,
             isEditButton: false,
+            goods: [],
             isDisabled: false,
             isDisabledTask: false,
             contactsOption: [],
@@ -459,8 +465,11 @@ export default {
                         trigger: "blur"
                     }, {
                         validator: (rule, value, callback) => {
+                            console.log(this.formContacts.inventory);
                             if (value < 0) {
                                 callback(new Error("数量不能小于0"));
+                            } else if (Number(value) > Number(this.formContacts.inventory)) {
+                                callback(new Error("数量不能大于库存"));
                             } else {
                                 callback();
                             }
@@ -703,6 +712,7 @@ export default {
         this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
             if (this.formContacts.goodsId !== value) {
                 goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
+                    this.goods = res.data.data
                     this.formContacts.goodsNo = res.data.data.code
                     this.formContacts.brandId = res.data.data.brandId
                     this.formContacts.inventory = res.data.data.inventory
@@ -714,6 +724,21 @@ export default {
                     this.formContacts.goodsDescription = res.data.data.goodsDescription
                     this.formContacts.units = res.data.data.unit
                     this.formContacts.price = res.data.data.price
+                    //
+                    this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId
+                    console.log(res.data.data.sharedCompanyId);
+                    console.log(res.data.data.sharedCompanyName);
+                    this.form.sharedCompanyId = res.data.data.sharedCompanyId
+                    this.form.sharedCompanyName = res.data.data.sharedCompanyName
+                    this.sharedCompanyId = res.data.data.sharedCompanyId
+                    console.log(res.data.data.sharedCompanyId);
+                    console.log(this.form.orderItemsList);
+                    for (let i = 0; i < this.form.orderItemsList.length; i++) {
+                        console.log(Number(this.form.orderItemsList[i].sharedCompanyId));
+                        if (Number(this.form.orderItemsList[i].sharedCompanyId) != Number(res.data.data.sharedCompanyId)) {
+                            this.isStatus = 0
+                        }
+                    }
                     if (res.data.data.whether == 0) {
                         this.findObject(this.optionContactsBack.column, "dot").disabled = true
                     } else {
@@ -736,16 +761,26 @@ export default {
 
             if (this.formContacts.goodsId !== value) {
                 goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
+                    this.goods = res.data.data
                     this.formContacts.goodsNo = res.data.data.code
                     this.formContacts.brandId = res.data.data.brandId
                     this.formContacts.inventory = res.data.data.inventory
                     // this.formContacts.brandId = res.data.data.brandName
                     // this.formContacts.brandName = res.data.data.brandId
-
                     this.formContacts.propertyName = res.data.data.specificationAndModel
                     this.formContacts.pattern = res.data.data.brandItem
                     this.formContacts.goodsDescription = res.data.data.goodsDescription
                     this.formContacts.units = res.data.data.unit
+                    this.sharedCompanyId = res.data.data.sharedCompanyId
+                    this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId
+                    //
+                    this.form.sharedCompanyId = res.data.data.sharedCompanyId
+                    this.form.sharedCompanyName = res.data.data.sharedCompanyName
+                    for (let i = 0; i < this.form.orderItemsList.length; i++) {
+                        if (this.form.orderItemsList[i].sharedCompanyId != res.data.data.sharedCompanyId) {
+                            this.isStatus = 0
+                        }
+                    }
                     if (res.data.data.whether == 0) {
                         this.findObject(this.optionContacts.column, "dot").disabled = true
                     } else {
@@ -817,6 +852,30 @@ export default {
                 this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
             })
         },
+        'form.orderItemsList.length'(newformContacts, oldformContacts) {
+            console.log(this.formContacts);
+            console.log(this.form.orderItemsList);
+            // for (let i = 0; i < this.form.orderItemsList.length - 1; i++) {
+            //     const currentItem = this.form.orderItemsList[i];
+            //     const nextItem = this.form.orderItemsList[i + 1];
+
+            //     if (currentItem.sharedCompanyId !== nextItem.sharedCompanyId) {
+            //         console.log('不能添加');
+            //     }
+            // }
+            if (this.form.orderItemsList.length) {
+                this.findObject(this.optionForm.column, 'storageId').disabled = true
+            } else {
+                this.findObject(this.optionForm.column, 'storageId').disabled = false
+            }
+        },
+        'form.sharedCompanyId'(newSharedCompanyId, oldSharedCompanyId) {
+            console.log(newSharedCompanyId, oldSharedCompanyId);
+            if (newSharedCompanyId != oldSharedCompanyId) {
+                console.log('不能添加');
+            }
+            console.log(this.sharedCompanyId);
+        },
         $route(to, from) {
             if (this.onLoad.id && this.detailData.id) {
                 this.$set(this.optionForm, 'disabled', true)
@@ -901,7 +960,7 @@ export default {
             this.isDisabled = false
             this.isAdd = false
             if (this.form.businessSource == "外部销售") {
-                if(this.form.status == '待发货'){
+                if (this.form.status == '待发货') {
                     this.isSaveBtn = false;
                     this.isDisabledTask = false;
                     this.viewDisabled = false;
@@ -1031,7 +1090,7 @@ export default {
                     })
                     loading.close()
                 }
-                if(this.form.status == '待发货'){
+                if (this.form.status == '待发货') {
                     this.isSaveBtn = false;
                     this.isDisabledTask = false;
                     this.viewDisabled = false;
@@ -1065,7 +1124,6 @@ export default {
                         this.$set(this.optionForm, 'disabled', true)
                         this.$set(this.optionContactsBack, 'disabled', true)
                         this.$refs["form"].validate((valid, done) => {
-                            done();
                             if (valid) {
                                 const loading = this.$loading({
                                     lock: true,
@@ -1083,22 +1141,48 @@ export default {
                                 //     items.goodsName = goodsName
 
                                 // })
-                                this.save()
-                                generateShipTask(this.form).then(res => {
-                                    console.log(2);
-                                    console.log(res.data);
-                                    this.refresh(res.data.data.id, true)
-                                    this.isContacts = true
-                                    // 将按钮文本更改为"撤销任务"
-                                    this.buttonText = '撤销任务';
-                                    // 将按钮颜色更改为对应的颜色
-                                    this.buttonColor = 'warning'; // 比如改为warning
-                                    this.$message.success("生成出库任务成功");
-                                    this.isApplySettlement = false
-                                    loading.close();
-                                }).finally(() => {
-                                    loading.close();
+                                this.$refs["form"].validate((valid, done) => {
+                                    done();
+                                    if (valid) {
+                                        const loading = this.$loading({
+                                            lock: true,
+                                            text: '加载中',
+                                            spinner: 'el-icon-loading',
+                                            background: 'rgba(255,255,255,0.7)'
+                                        });
+                                        submit({
+                                            bsType: "XS",
+                                            ...this.form
+                                        }).then(res => {
+                                            console.log(1);
+                                            this.refresh(res.data.data.id)
+                                            this.isDisabledTask = false
+                                            generateShipTask(this.form).then(res => {
+                                                console.log(2);
+                                                console.log(res.data);
+                                                this.refresh(res.data.data.id, true)
+                                                this.isContacts = true
+                                                // 将按钮文本更改为"撤销任务"
+                                                this.buttonText = '撤销任务';
+                                                // 将按钮颜色更改为对应的颜色
+                                                this.buttonColor = 'warning'; // 比如改为warning
+                                                this.$message.success("生成出库任务成功");
+                                                this.isApplySettlement = false
+                                                loading.close();
+                                            }).finally(() => {
+                                                loading.close();
+                                            });
+
+                                            loading.close();
+                                        }).finally(() => {
+                                            loading.close();
+                                        });
+                                    } else {
+                                        return false;
+                                    }
                                 });
+
+                                done();
                             } else {
                                 this.$message.error('请选择仓库')
                             }
@@ -1106,9 +1190,8 @@ export default {
                     }
                 } else {
                     this.$refs["form"].validate((valid, done) => {
-                        done();
                         console.log(valid);
-                        if (true) {
+                        if (valid) {
                             const loading = this.$loading({
                                 lock: true,
                                 text: '加载中',
@@ -1146,6 +1229,8 @@ export default {
                             }).finally(() => {
                                 loading.close();
                             });
+                            done();
+
                         }
                     })
                 }
@@ -1229,6 +1314,17 @@ export default {
                 }
             });
         },
+        //关闭弹窗表单
+        beforeClose(done, type) {
+            console.log(type);
+            // if(row == "add"){
+            //     this.form.sharedCompanyId = this.form.sharedCompanyId?this.form.sharedCompanyId:''
+            //     this.form.sharedCompanyName = this.form.sharedCompanyName?this.form.sharedCompanyName:''
+            // }
+            console.log('this.form.sharedCompanyId', this.form.sharedCompanyId);
+            console.log('this.form.sharedCompanyName', this.form.sharedCompanyName);
+            done()
+        },
         refresh(id, type) {
             const loading = this.$loading({
                 lock: true,
@@ -1259,7 +1355,7 @@ export default {
                     this.isSaveBtn = true;
                     this.isDisabledTask = true;
                     this.viewDisabled = true;
-                }else{
+                } else {
                     this.isSaveBtn = true;
                     this.isDisabledTask = true;
                     this.viewDisabled = true;
@@ -1485,7 +1581,14 @@ export default {
             );
         },
         rowSave(form, done, loading) {
-            done(form)
+            if (this.isStatus) {
+                done(form)
+            } else {
+                this.$message.error('请选择相同商户的轮胎')
+            }
+            console.log(form);
+            // this.form.sharedCompanyId = res.data.data.sharedCompanyId
+            // this.form.sharedCompanyName = res.data.data.sharedCompanyName
         },
         rowUpdate(form, index, done, loading) {
             done(form)

+ 1 - 1
src/views/tirePartsMall/salesManagement/saleOrder/index.vue

@@ -7,7 +7,7 @@
         @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 269)" :page.sync="page">
         <template slot-scope="{type,size,row,index}" slot="menu">
           <!-- <el-button :size="size" :type="type" @click="check(row)">查看</el-button> -->
-          <el-button :size="size" :type="type" :disabled="row.status != '录入' && row.status != '待确认' && row.item>=1 " @click="$refs.crud.rowDel(row, index)">删除</el-button>
+          <el-button :size="size" :type="type" :disabled="row.status != '录入' && row.status != '待确认' && row.item>=1 || row.businessSource == '外部销售'" @click="$refs.crud.rowDel(row, index)">删除</el-button>
         </template>
         <template slot="corpNameSearch">
           <crop-select v-model="search.corpId" corpType="KH" :refresh="false"></crop-select>