Browse Source

修改bug

qukaidi 3 years ago
parent
commit
ebf6f28a9c

+ 6 - 0
src/enums/column-name.js

@@ -816,6 +816,12 @@ const columnName = [{
 }, {
   code: 195,
   name: '融资管理-融资总账明细表'
+}, {
+  code: 196,
+  name: '融资管理-盘点列表页'
+}, {
+  code: 197,
+  name: '融资管理-盘点明细表'
 }
 ]
 export const getColumnName = (key) => {

+ 178 - 0
src/views/financing/inventory/config/customerContact.json

@@ -0,0 +1,178 @@
+{
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "addBtn": false,
+  "delBtn": false,
+  "headerAlign": "center",
+  "menuWidth": 150,
+  "refreshBtn": false,
+  "showSummary": true,
+  "column": [
+    {
+      "index": 1,
+      "prop": "containerNo",
+      "label": "箱号",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 2,
+      "prop": "storageId",
+      "label": "库区",
+      "overHidden": true,
+      "type": "select",
+      "props": {
+        "label": "cname",
+        "value": "id"
+      },
+      "dicData": [],
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 3,
+      "prop": "itemId",
+      "label": "品名",
+      "type": "select",
+      "props": {
+        "label": "cname",
+        "value": "id"
+      },
+      "dicData": [],
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 4,
+      "prop": "itemType",
+      "label": "品牌",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 5,
+      "prop": "grade",
+      "label": "等级",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 6,
+      "prop": "length",
+      "label": "长度(mm)",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 7,
+      "prop": "width",
+      "label": "宽度(mm)",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 8,
+      "prop": "thickness",
+      "label": "厚度(mm)",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 9,
+      "prop": "widthItem",
+      "label": "宽度明细(mm)",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 10,
+      "prop": "billNo",
+      "label": "捆包号",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 11,
+      "prop": "sliceNumber",
+      "label": "片数",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 12,
+      "prop": "storageInQuantity",
+      "label": "出库量",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 13,
+      "prop": "unit",
+      "label": "出库单位",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 14,
+      "prop": "price",
+      "label": "出库单价",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 15,
+      "prop": "storageAmount",
+      "label": "出库金额",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 16,
+      "prop": "itemProp",
+      "label": "产地",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    },
+    {
+      "index": 17,
+      "prop": "oneCode",
+      "label": "一维码",
+      "overHidden": true,
+      "width": 100
+    },
+    {
+      "index": 18,
+      "prop": "qRCode",
+      "label": "二维码",
+      "overHidden": true,
+      "width": 100
+    },
+    {
+      "index": 24,
+      "prop": "remarks",
+      "label": "备注",
+      "overHidden": true,
+      "cell": true,
+      "width": 100
+    }
+  ]
+}

+ 160 - 0
src/views/financing/inventory/config/mainList.json

@@ -0,0 +1,160 @@
+{
+  "searchShow": true,
+  "searchMenuSpan": 24,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "menu":false,
+  "headerAlign": "center",
+  "menuWidth": "70",
+  "showSummary": true,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "selection": true,
+  "tip": false,
+  "column": [
+    {
+      "label": "货权人",
+      "prop": "purchaserId",
+      "index": 1,
+      "width": 120,
+      "search": true,
+      "searchSpan": 8,
+      "overHidden": true
+    },
+    {
+      "label": "出库单号",
+      "prop": "sysNo",
+      "index": 2,
+      "width": 120,
+      "search": true,
+      "searchSpan": 8,
+      "overHidden": true
+    },
+    {
+      "label": "业务类型",
+      "prop": "businessType",
+      "index": 3,
+      "width": 120,
+      "type": "select",
+      "props": {
+        "label": "dictValue",
+        "value": "dictKey"
+      },
+      "dicData": [],
+      "search": true,
+      "searchSpan": 8,
+      "overHidden": true
+    },
+    {
+      "label": "出库日期",
+      "prop": "stockTime",
+      "index": 4,
+      "width": 120,
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "search": true,
+      "searchSpan": 8,
+      "overHidden": true
+    },
+    {
+      "label": "仓库",
+      "prop": "storageId",
+      "type": "cascader",
+      "props": {
+        "label": "title",
+        "value": "value"
+      },
+      "dicData": [],
+      "checkStrictly": true,
+      "showAllLevels": false,
+      "emitPath": false,
+      "index": 5,
+      "width": 120,
+      "search": true,
+      "searchSpan": 8,
+      "overHidden": true
+    },
+    {
+      "label": "提单号",
+      "prop": "billNo",
+      "index": 6,
+      "width": 120,
+      "search": true,
+      "searchSpan": 8,
+      "overHidden": true
+    },
+    {
+      "label": "供应商",
+      "prop": "corpId",
+      "index": 7,
+      "width": 120,
+      "search": true,
+      "searchSpan": 8,
+      "overHidden": true
+    },
+    {
+      "label": "车船号",
+      "prop": "vehicleShipNumber",
+      "index": 8,
+      "width": 120,
+      "search": true,
+      "searchSpan": 8,
+      "overHidden": true
+    },
+    {
+      "label": "出库量",
+      "prop": "storageQuantity",
+      "index": 9,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "出库金额",
+      "prop": "storageAmount",
+      "index": 10,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "制单人",
+      "prop": "salesName",
+      "index": 11,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "创建时间",
+      "prop": "createTime",
+      "index": 12,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "审核状态",
+      "prop": "status",
+      "index": 13,
+      "width": 120,
+      "type": "select",
+      "dataType": "number",
+      "props": {
+        "label": "dictValue",
+        "value": "dictKey"
+      },
+      "dicData": [],
+      "overHidden": true
+    },
+    {
+      "label": "备注",
+      "prop": "orderRemark",
+      "index": 14,
+      "width": 120,
+      "search": true,
+      "searchSpan": 8,
+      "overHidden": true
+    }
+  ]
+}

+ 488 - 0
src/views/financing/inventory/detailsPage.vue

@@ -0,0 +1,488 @@
+<template>
+  <div class="borderless" v-loading="pageLoading">
+    <div class="customer-head">
+      <div class="customer-back">
+        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+          @click="backToList">返回列表
+        </el-button>
+      </div>
+      <div class="add-customer-btn">
+        <el-button type="primary" size="small" :disabled="form.status>0" v-if="detailData.status == 1"
+          class="el-button--small-yh " @click.stop="openEdit">编辑
+        </el-button>
+        <el-button type="primary" @click="editCustomer" :loading="subLoading" v-if="detailData.status != 1"
+          size="small">{{ form.id ? '修改数据' : '保存数据' }}
+        </el-button>
+        <el-dropdown style="padding: 0 6px;line-height: 0">
+          <el-button type="primary" size="small" :loading="buttonLoading" :disabled="!form.id">
+            审核处理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item :disabled="form.status>0" @click.native="auditCheck">审核数据</el-dropdown-item>
+            <el-dropdown-item :disabled="form.status<1" @click.native="checkScheduleDialog = true">审核进度
+            </el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+      </div>
+    </div>
+    <div class="customer-main">
+      <trade-card title="基础信息">
+        <avue-form ref="form" class="trading-form" v-model="form" :option="option">
+          <template slot="purchaserId">
+            <crop-select v-model="form.purchaserId" corpType="KH" :refresh="false" @getCorpData="getKHData"
+              :disabled="detailData.status == 1"></crop-select>
+          </template>
+          <template slot="corpId">
+            <crop-select v-model="form.corpId" corpType="GYS" :refresh="false" @getCorpData="getGYSData"
+              :disabled="detailData.status == 1"></crop-select>
+          </template>
+          <template slot="storageId">
+            <el-cascader v-model="form.storageId" :options="storagetreeList" :show-all-levels="false" :disabled="detailData.status == 1"
+              :props="{ checkStrictly: true, emitPath: false, label: 'title' }" clearable @change="storagetreeChange">
+            </el-cascader>
+          </template>
+        </avue-form>
+      </trade-card>
+      <trade-card title="出库明细">
+        <avue-crud ref="crud" :data="itemsVOList" :option="tableOption" @row-del="rowDel" @saveColumn="saveColumn"
+          @resetColumn="resetColumn" :cell-style="cellStyle">
+          <template slot="menuLeft">
+            <el-button type="primary" icon="el-icon-plus" size="small" :disabled="detailData.status == 1"
+              @click.stop="addRow">录入明细
+            </el-button>
+            <el-button type="success" icon="el-icon-bottom" size="small" @click.stop="getTemplate">下载模板
+            </el-button>
+            <el-button type="info" icon="el-icon-top" size="small" :disabled="detailData.status == 1"
+              @click.stop="addRow">导入
+            </el-button>
+          </template>
+          <template slot="menu" slot-scope="{ row, index }">
+            <div style="display:flex;justify-content: center;">
+              <el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)"
+                :disabled="disabled || detailData.status == 1">{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
+              <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
+                :disabled="detailData.status == 1">删除</el-button>
+            </div>
+          </template>
+        </avue-crud>
+      </trade-card>
+      <fee-info ref="feeInfo" :orderFeesList="orderFeesList" :disabled="detailData.status == 1"
+        feeUrl="/blade-purchase-sales/entranceOrder/removeOrderFees" optionType="JK" itemType="申请" :inCropId="true"
+        :tabShow="2" :billingShow="false" />
+      <upload-file ref="uploadFile" title="合同附件" :disabled="detailData.status == 1" :orderFilesList="orderFilesList"
+        delUrl="" />
+      <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
+        :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
+        <check-schedule :checkId="form.id" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun">
+        </check-schedule>
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+import { detail, submit, checkWarehousing, getStoragetree, getStorage, getAllgoods } from "@/api/purchasingManagement/inStock";
+import tableOption from "./config/customerContact.json";
+import feeInfo from "@/components/fee-info/main";
+import checkSchedule from "../../../components/check/checkSchedule";
+import uploadFile from "@/components/upload-file/main";
+import { getToken } from "@/util/auth";
+export default {
+  name: "detailsPageEdit",
+  data() {
+    return {
+      form: {},
+      checkScheduleDialog: false,
+      tableOption: {},
+      option: {
+        disabled: false,
+        menuBtn: false,
+        labelWidth: 100,
+        column: [
+          {
+            label: "货权人",
+            prop: "purchaserId",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 6
+          },
+
+          {
+            label: "出库日期",
+            prop: "stockTime",
+            type: "datetime",
+            format: "yyyy-MM-dd HH:mm:ss",
+            valueFormat: "yyyy-MM-dd HH:mm:ss",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 6
+          },
+          {
+            label: "仓库",
+            prop: "storageId",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 6
+          },
+          {
+            label: "提单号",
+            prop: "billNo",
+            span: 6
+          },
+          {
+            label: "业务类型",
+            prop: "businessType",
+            type: "select",
+            props: {
+              label: "dictValue",
+              value: "dictKey"
+            },
+            dicData: [],
+            span: 6
+          },
+          {
+            label: "车船号",
+            prop: "vehicleShipNumber",
+            span: 6
+          },
+          {
+            label: "供应商",
+            prop: "corpId",
+            span: 6
+          },
+          {
+            label: "出库单号",
+            prop: "sysNo",
+            disabled: true,
+            span: 6
+          },
+          {
+            label: "审核状态",
+            prop: "status",
+            type: "select",
+            dataType: 'number',
+            props: {
+              label: "dictValue",
+              value: "dictKey"
+            },
+            dicData: [],
+            disabled: true,
+            span: 6
+          },
+          {
+            label: "备注",
+            prop: "orderRemark",
+            type: "textarea",
+            minRows: 2,
+            span: 18
+          },
+        ]
+      },
+      itemsVOList: [],
+      orderFeesList: [],
+      orderFilesList: [],
+      subLoading: false,
+      pageLoading: false,
+      batchNo: '',
+      storagetreeList: []
+    };
+  },
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
+  components: {
+    feeInfo,
+    checkSchedule,
+    uploadFile
+  },
+  async created() {
+    if (this.detailData.status == 1) {
+      this.option.disabled = true;
+    }
+    if (this.detailData.id) {
+      this.getDetail(this.detailData.id);
+    }
+    this.tableOption = await this.getColumnData(
+      this.getColumnName(197),
+      tableOption
+    );
+    getStoragetree().then(res => {
+      this.storagetreeList = res.data.data;
+    })
+    this.getWorkDicts("approval_status").then(res => {
+      this.findObject(this.option.column, "status").dicData =
+        res.data.data;
+    });
+    this.getWorkDicts("CMY_business_type").then(res => {
+      this.findObject(this.option.column, "businessType").dicData =
+        res.data.data;
+    });
+    getAllgoods().then(res => {
+      this.findObject(this.tableOption.column, "itemId").dicData =
+        res.data.data;
+    })
+    if (this.$route.query.generateId) {
+      this.getGenerate(this.$route.query.generateId);
+    }
+  },
+  activated() {
+    setTimeout(() => {
+      if (this.$route.query.generateId) {
+        this.getGenerate(this.$route.query.generateId);
+      }
+    }, 100);
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    getStorage() {
+      getStorage({ storageTypeId: this.form.storageId }).then(res => {
+        this.findObject(this.tableOption.column, "storageId").dicData = res.data;
+      })
+    },
+    storagetreeChange(row) {
+      if (row) {
+        if (this.itemsVOList.length > 0) {
+          this.getStorage()
+          this.itemsVOList.forEach(e => {
+            e.storageId = null
+          })
+          this.$message.warning("请重新选择库区!")
+        }
+      } else {
+        if (this.itemsVOList.length > 0) {
+          this.findObject(this.tableOption.column, "storageId").dicData = []
+          this.itemsVOList.forEach(e => {
+            e.storageId = null
+          })
+          this.$message.warning("请重新选择库区!")
+        }
+
+      }
+    },
+    getKHData(row) {
+      this.form.purchaser = row.cname
+    },
+    getGYSData(row) {
+      this.form.corpName = row.cname
+    },
+    choceScheduleFun() {
+      this.checkScheduleDialog = false
+    },
+    addRow() {
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          this.itemsVOList.push({ $cellEdit: true });
+          this.getStorage()
+        } else {
+          return false;
+        }
+      });
+
+    },
+    rowCell(row, index) {
+      if (row.$cellEdit == true) {
+        this.$set(row, "$cellEdit", false);
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
+    },
+    rowSave(row) {
+      this.$set(row, "$cellEdit", false);
+    },
+    rowDel(row) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.$message({
+          type: "success",
+          message: "删除成功!"
+        });
+        this.itemsVOList.splice(row.$index, 1);
+      });
+    },
+    getDetail(id) {
+      this.pageLoading = true;
+      detail(id)
+        .then(res => {
+          this.form = res.data.data;
+          this.itemsVOList = res.data.data.itemsVOList;
+          this.orderFeesList = res.data.data.orderFeesList;
+          this.orderFilesList = res.data.data.orderFilesList;
+          this.getStorage()
+        })
+        .finally(() => {
+          this.pageLoading = false;
+        });
+    },
+    getGenerate(id) {
+      this.pageLoading = true;
+      detail(id)
+        .then(res => {
+          delete res.data.data.id
+          delete res.data.data.createTime
+          delete res.data.data.createUser
+          delete res.data.data.createUserName
+          delete res.data.data.sysNo
+          delete res.data.data.status
+          res.data.data.itemsVOList.forEach(e => {
+            delete e.id
+          })
+          // res.data.data.orderFeesList.forEach(e => {
+          //   delete e.id
+          // })
+          // res.data.data.orderFilesList.forEach(e => {
+          //   delete e.id
+          // })
+          this.form = res.data.data;
+          this.itemsVOList = res.data.data.itemsVOList;
+          // this.orderFeesList = res.data.data.orderFeesList;
+          // this.orderFilesList = res.data.data.orderFilesList;
+          this.getStorage()
+        })
+        .finally(() => {
+          this.pageLoading = false;
+        });
+    },
+    //修改提交触发
+    editCustomer(status) {
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          let orderFeesList = this.$refs.feeInfo.submitData();
+          this.subLoading = true;
+          let data = {
+            ...this.form,
+            billType: 'CK',
+            itemsVOList: this.itemsVOList,
+            orderFeesList: orderFeesList,
+            orderFilesList: this.orderFilesList
+          };
+          submit(data).then(res => {
+            this.form = res.data.data;
+            this.itemsVOList = res.data.data.itemsVOList;
+            this.orderFeesList = res.data.data.orderFeesList;
+            this.orderFilesList = res.data.data.orderFilesList;
+            this.$message({
+              type: "success",
+              message: "保存成功!"
+            });
+          })
+            .finally(() => {
+              this.subLoading = false;
+            });
+        } else {
+          return false;
+        }
+      });
+    },
+    //请核
+    auditCheck() {
+      this.$confirm("确定审核此订单?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.buttonLoading = true
+        const data = {
+          id: this.form.id,
+          checkType: 'CK',
+          url: '/salesManagement/outStock/index',
+          pageStatus: "this.$store.getters.entranceXsStatus",
+          pageLabel: "出库管理",
+          checkFlag: 2,
+        }
+        checkWarehousing(data).then(res => {
+          if (res.data.success) {
+            this.$message.success("操作成功!")
+            this.viewDisabled = true
+            this.approverDisabled = true
+          }
+        })
+      }).finally(() => {
+        this.buttonLoading = false
+      })
+    },
+    getTemplate() {
+      window.open(`/api/trade-purchase/woodHarvestingCloud/export-template?${this.website.tokenHeader}=${getToken()}`)
+    },
+    //返回列表
+    backToList() {
+      this.$emit("goBack");
+    },
+    openEdit() {
+      this.detailData.status = 2;
+      this.option.disabled = false;
+      this.$refs.crud.refreshTable();
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(197),
+        this.tableOption
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.tableOption = tableOption;
+      const inSave = await this.delColumnData(
+        this.getColumnName(197),
+        tableOption
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("重置成功");
+        //关闭窗口
+        setTimeout(() => {
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }, 1000);
+      }
+    }
+  },
+  watch: {
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.trading-form ::v-deep .el-form-item {
+  margin-bottom: 8px !important;
+}
+
+::v-deep .el-form-item__error {
+  display: none !important;
+}
+
+::v-deep .select-component {
+  display: flex !important;
+}
+</style>

+ 218 - 0
src/views/financing/inventory/index.vue

@@ -0,0 +1,218 @@
+<template>
+    <div>
+        <basic-container v-show="show" class="page-crad">
+            <avue-crud ref="crud" :option="option" :data="dataList" v-model="form" :page.sync="page"
+                :search.sync="search" @search-change="searchChange" @current-change="currentChange"
+                @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading"
+                @saveColumn="saveColumn" @resetColumn="resetColumn" :cell-style="cellStyle"
+                @selection-change="selectionChange" @search-criteria-switch="searchCriteriaSwitch">
+                <!-- <template slot="menuLeft">
+                    <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newAdd()">创建单据
+                    </el-button>
+                </template> -->
+                <template slot-scope="{ row,index}" slot="menu">
+                    <el-button type="text" icon="el-icon-delete" size="small" @click.stop="rowDel(row, index)">删除
+                    </el-button>
+                </template>
+                <template slot="stockTimeSearch">
+                    <el-date-picker v-model="search.stockTime" type="daterange" start-placeholder="开始日期"
+                        end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
+                    </el-date-picker>
+                </template>
+                <template slot="purchaserIdSearch">
+                    <crop-select v-model="search.purchaserId" corpType="KH" :refresh="false"></crop-select>
+                </template>
+                <template slot="corpIdSearch">
+                    <crop-select v-model="search.corpId" corpType="GYS" :refresh="false"></crop-select>
+                </template>
+                <template slot-scope="{ row,index}" slot="purchaserId">
+                    <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 1)">{{ row.purchaser }}
+                    </span>
+                </template>
+                <template slot-scope="{ row,index}" slot="corpId">
+                    <span>{{ row.corpName }}
+                    </span>
+                </template>
+            </avue-crud>
+        </basic-container>
+        <detail-page @goBack="goBack" :detailData="detailData" v-if="!show"></detail-page>
+    </div>
+</template>
+
+<script>
+import { getList, remove, getStoragetree } from "@/api/purchasingManagement/inStock";
+import option from "./config/mainList.json";
+import detailPage from "./detailsPage";
+import _ from "lodash";
+export default {
+    name: "instock",
+    data() {
+        return {
+            search: {},
+            form: {},
+            option: {},
+            dataList: [],
+            page: {
+                pageSize: 20,
+                currentPage: 1,
+                total: 0,
+                pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+            },
+            show: true,
+            detailData: {},
+            loading: false,
+            searchShow: true,
+            selectionList: [],
+        };
+    },
+    components: { detailPage },
+    async created() {
+        this.option = await this.getColumnData(this.getColumnName(190), option);
+        this.option.height = window.innerHeight - 210;
+        this.getWorkDicts("approval_status").then(res => {
+            this.findObject(this.option.column, "status").dicData =
+                res.data.data;
+        });
+        this.getWorkDicts("CMY_business_type").then(res => {
+            this.findObject(this.option.column, "businessType").dicData =
+                res.data.data;
+        });
+        getStoragetree().then(res => {
+            this.findObject(this.option.column, "storageId").dicData =
+                res.data.data;
+        })
+    },
+    activated() {
+        console.log(this.show)
+        setTimeout(() => {
+            if (this.$route.query.generateId && this.show) {
+                // this.detailData.id = this.$route.query.generateId
+                this.show = false;
+            }
+        }, 100);
+    },
+    methods: {
+        searchCriteriaSwitch(type) {
+            if (type) {
+                this.option.height = this.option.height - 191;
+            } else {
+                this.option.height = this.option.height + 191;
+            }
+            this.$refs.crud.getTableHeight();
+        },
+        cellStyle() {
+            return "padding:0;height:40px;";
+        },
+        rowDel(row, index, done) {
+            this.$confirm("确定删除数据?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                remove({ id: row.id }).then(res => {
+                    this.$message({
+                        type: "success",
+                        message: "删除成功!"
+                    });
+                })
+                    .finally(() => {
+                        this.onLoad(this.page, this.search);
+                    });
+
+            });
+        },
+        selectionChange(list) {
+            this.selectionList = list;
+        },
+        editOpen(row, status) {
+            this.detailData = {
+                id: row.id,
+                status: status
+            };
+            this.show = false;
+        },
+        //点击搜索按钮触发
+        searchChange(params, done) {
+            this.page.currentPage = 1;
+            this.onLoad(this.page, params);
+            done();
+        },
+        currentChange(val) {
+            this.page.currentPage = val;
+        },
+        sizeChange(val) {
+            this.page.currentPage = 1;
+            this.page.pageSize = val;
+        },
+        onLoad(page, params) {
+            let data = this.deepClone(Object.assign({}, params, this.search));
+            data.billType = "CK"
+            this.loading = true;
+            getList(page.currentPage, page.pageSize, data)
+                .then(res => {
+                    this.dataList = res.data.data.records ? res.data.data.records : [];
+                    this.page.total = res.data.data.total;
+                })
+                .finally(() => {
+                    this.loading = false;
+                });
+        },
+        refreshChange() {
+            this.onLoad(this.page, this.search);
+        },
+        newAdd() {
+            this.show = false;
+        },
+        goBack() {
+            if (this.$route.query.id) {
+                this.$router.$avueRouter.closeTag(this.$route.fullPath);
+                this.$router.push({
+                    path: "/purchasingManagement/inStock/index"
+                });
+            }
+            this.detailData = this.$options.data().detailData;
+            this.show = true;
+            this.onLoad(this.page, this.search);
+        },
+        async saveColumn() {
+            const inSave = await this.saveColumnData(
+                this.getColumnName(190),
+                this.option
+            );
+            if (inSave) {
+                this.$nextTick(() => {
+                    this.$refs.crud.doLayout();
+                });
+                this.$message.success("保存成功");
+                //关闭窗口
+                this.$refs.crud.$refs.dialogColumn.columnBox = false;
+            }
+        },
+        async resetColumn() {
+            this.option = option;
+            const inSave = await this.delColumnData(this.getColumnName(190), this.option);
+            if (inSave) {
+                this.$nextTick(() => {
+                    this.$refs.crud.doLayout();
+                });
+                this.$message.success("重置成功");
+                this.$refs.crud.$refs.dialogColumn.columnBox = false;
+            }
+        }
+    }
+};
+</script>
+
+<style scoped>
+::v-deep .select-component {
+    display: flex;
+}
+
+.page-crad ::v-deep .basic-container__card {
+    height: 94.2vh;
+}
+
+.itemTable ::v-deep .el-table {
+    width: 738px;
+}
+</style>

+ 16 - 0
src/views/purchase/contract/config/mainList.json

@@ -73,6 +73,22 @@
   ],
   "column":[
     {
+      "label": "合同类型",
+      "prop": "orderType",
+      "search": true,
+      "searchOrder": 1,
+      "index": 1,
+      "overHidden": true,
+      "type":"select",
+      "props": {
+        "label": "dictValue",
+        "value": "dictValue"
+      },
+      "dicData": [],
+      "value":"棉花",
+      "width":150
+    },
+    {
       "label": "合同号",
       "prop": "orderNo",
       "search": true,

+ 9 - 3
src/views/purchase/contract/index.vue

@@ -77,7 +77,7 @@ export default {
   data() {
     return {
       loading: false,
-      option: option,
+      option: {},
       detailData: {},
       dataList: [],
       selectionList: [],
@@ -88,7 +88,9 @@ export default {
       },
       form: {},
       show: true,
-      search: {},
+      search: {
+        orderType:'棉花'
+      },
       configuration: {
         multipleChoices: false,
         multiple: false,
@@ -110,7 +112,11 @@ export default {
     detailPage
   },
   async created() {
-    // this.option = await this.getColumnData(this.getColumnName(36), option);
+    this.option = await this.getColumnData(this.getColumnName(36), option);
+    this.getWorkDicts("contractType").then(res => {
+      this.findObject(this.option.column, "orderType").dicData =
+        res.data.data;
+    })
   },
   activated() {
     if (!this.show && !this.$store.getters.entranceCgStatus) {

+ 16 - 0
src/views/salesManagement/salesContract/config/mainList.json

@@ -68,6 +68,22 @@
   ],
   "column":[
     {
+      "label": "合同类型",
+      "prop": "orderType",
+      "search": true,
+      "searchOrder": 1,
+      "index": 1,
+      "overHidden": true,
+      "type":"select",
+      "props": {
+        "label": "dictValue",
+        "value": "dictValue"
+      },
+      "dicData": [],
+      "value":"棉花",
+      "width":150
+    },
+    {
       "label": "合同号",
       "prop": "orderNo",
       "overHidden": true,

+ 8 - 2
src/views/salesManagement/salesContract/index.vue

@@ -86,7 +86,9 @@ export default {
       },
       form: {},
       detailData: {},
-      search: {},
+      search: {
+        orderType:'棉花'
+      },
       viewDisabled: false,
       configuration: {
         multipleChoices: false,
@@ -113,6 +115,10 @@ export default {
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(38), option);
+    this.getWorkDicts("contractType").then(res => {
+      this.findObject(this.option.column, "orderType").dicData =
+        res.data.data;
+    })
   },
   activated() {
     if (!this.show && !this.$store.getters.entranceXsStatus) {
@@ -290,7 +296,7 @@ export default {
           contractEndDate: '',
         }
       }
-     
+
       if (params.advanceCollectionDate && params.advanceCollectionDate.length > 0) {
         params = {
           ...params,

+ 13 - 0
src/views/statisticAnalysis/profit/config/mainList.json

@@ -86,6 +86,19 @@
   ],
   "column": [
     {
+      "label": "合同类型",
+      "prop": "orderType",
+      "search": true,
+      "overHidden": true,
+      "type":"select",
+      "props": {
+        "label": "dictValue",
+        "value": "dictValue"
+      },
+      "dicData": [],
+      "value":"棉花"
+    },
+    {
       "label": "合同号",
       "prop": "orderNo",
       "search": true,

+ 179 - 191
src/views/statisticAnalysis/profit/index.vue

@@ -1,30 +1,12 @@
 <template>
   <basic-container>
-    <avue-crud :option="option"
-               :data="dataList"
-               ref="crud"
-               v-model="form"
-               :page.sync="page"
-               :search.sync="search"
-               :table-loading="loading"
-               :span-method="spanMethod"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @saveColumn="saveColumn"
-               :cell-style="cellStyle"
-               @resetColumn="resetColumn"
-               @on-load="onLoad">
+    <avue-crud :option="option" :data="dataList" ref="crud" v-model="form" :page.sync="page" :search.sync="search"
+      :table-loading="loading" :span-method="spanMethod" @search-change="searchChange" @search-reset="searchReset"
+      @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+      @refresh-change="refreshChange" @saveColumn="saveColumn" :cell-style="cellStyle" @resetColumn="resetColumn"
+      @on-load="onLoad">
       <template slot="menuLeft">
-        <el-button size="small"
-                   type="info"
-                   icon="el-icon-download"
-                   :loading="exportLoading"
-                   @click.stop="downFile"
-        >导出
+        <el-button size="small" type="info" icon="el-icon-download" :loading="exportLoading" @click.stop="downFile">导出
         </el-button>
       </template>
     </avue-crud>
@@ -32,183 +14,189 @@
 </template>
 
 <script>
-  import option from "./config/mainList.json";
-  import { getProfitList } from "@/api/statisticAnalysis/profit";
-  import { contrastList } from "@/util/contrastData";
+import option from "./config/mainList.json";
+import { getProfitList } from "@/api/statisticAnalysis/profit";
+import { contrastList } from "@/util/contrastData";
 
-  export default {
-    data() {
-      return {
-        loading : false,
-        exportLoading:false,
-        form: {},
-        search:{},
-        show:true,
-        detailData:{},
-        option: {},
-        spanArr:[],
-        position:0,
-        parentId:0,
-        dataList: [],
-        page: {
-          pageSize: 10,
-          pagerCount: 5,
-          total: 0,
-        },
-        query:{},
-        configuration:{
-          multipleChoices:false,
-          multiple:false,
-          disabled:false,
-          searchShow:true,
-          collapseTags:false,
-          clearable:true,
-          placeholder:'请点击右边按钮选择',
-          dicData:[]
-        },
-      }
-    },
-    async created() {
-      this.option = await this.getColumnData(this.getColumnName(66), option);
-    },
-    mounted() {
+export default {
+  data() {
+    return {
+      loading: false,
+      exportLoading: false,
+      form: {},
+      search: {
+        orderType:'棉花'
+      },
+      show: true,
+      detailData: {},
+      option: {},
+      spanArr: [],
+      position: 0,
+      parentId: 0,
+      dataList: [],
+      page: {
+        pageSize: 10,
+        pagerCount: 5,
+        total: 0,
+      },
+      query: {},
+      configuration: {
+        multipleChoices: false,
+        multiple: false,
+        disabled: false,
+        searchShow: true,
+        collapseTags: false,
+        clearable: true,
+        placeholder: '请点击右边按钮选择',
+        dicData: []
+      },
+    }
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(66), option);
+    this.getWorkDicts("contractType").then(res => {
+      this.findObject(this.option.column, "orderType").dicData =
+        res.data.data;
+    })
+  },
+  mounted() {
 
-    },
-    methods: {
-      //导出
-      downFile(){
-        this.exportLoading = true
-        let  searchParams = Object.assign({},this.search);
-        let param = this.paramsAdjustment(searchParams)
-        getProfitList(1, -1,param).then(res =>{
-          const fileData = this.deepClone(res.data.data.records)
+  },
+  methods: {
+    //导出
+    downFile() {
+      this.exportLoading = true
+      let searchParams = Object.assign({}, this.search);
+      let param = this.paramsAdjustment(searchParams)
+      getProfitList(1, -1, param).then(res => {
+        const fileData = this.deepClone(res.data.data.records)
 
-          option.column.shift();
-          option.column.shift();
+        option.column.shift();
+        option.column.shift();
 
-          this.$Export.excel({
-            title: "利润分析",
-            columns: option.column,
-            data: fileData,
-          });
-        }).finally(()=>{
-          this.exportLoading = false
-        })
-      },
-      addReceipt(){
-        console.log('1')
-      },
-      editOpen(){
-        console.log('1')
-      },
-      rowspan() {
-        //记录原始
-        let oldList = [this.dataList[0].corpName,this.dataList[0].orderNo,this.dataList[0].invoiceWeight,this.dataList[0].customDutyMoney,
-          this.dataList[0].gstMoney,this.dataList[0].quotaMoney,this.dataList[0].itemMoney,this.dataList[0].unitPrice]
-        this.dataList.forEach((item,index)=>{
-          let newList = [item.corpName,item.orderNo,item.invoiceWeight,item.customDutyMoney,item.gstMoney,item.quotaMoney,item.itemMoney,item.unitPrice]
-          if(index===0){
+        this.$Export.excel({
+          title: "利润分析",
+          columns: option.column,
+          data: fileData,
+        });
+      }).finally(() => {
+        this.exportLoading = false
+      })
+    },
+    addReceipt() {
+      console.log('1')
+    },
+    editOpen() {
+      console.log('1')
+    },
+    rowspan() {
+      //记录原始
+      let oldList = [this.dataList[0].corpName, this.dataList[0].orderNo, this.dataList[0].invoiceWeight, this.dataList[0].customDutyMoney,
+      this.dataList[0].gstMoney, this.dataList[0].quotaMoney, this.dataList[0].itemMoney, this.dataList[0].unitPrice]
+      this.dataList.forEach((item, index) => {
+        let newList = [item.corpName, item.orderNo, item.invoiceWeight, item.customDutyMoney, item.gstMoney, item.quotaMoney, item.itemMoney, item.unitPrice]
+        if (index === 0) {
+          this.spanArr.push(1)
+          this.position = 0;
+        } else {
+          //如果循环数据与原始数据相等  那么合并
+          if (!contrastList(oldList, newList)) {
+            this.spanArr[this.position] += 1;
+            this.spanArr.push(0)
+          } else {
+            //如果不等 更新原始数据  循环在比较
+            oldList = newList
             this.spanArr.push(1)
-            this.position=0;
-          }else{
-            //如果循环数据与原始数据相等  那么合并
-            if(!contrastList(oldList,newList)){
-              this.spanArr[this.position] +=1;
-              this.spanArr.push(0)
-            }else{
-              //如果不等 更新原始数据  循环在比较
-              oldList = newList
-              this.spanArr.push(1)
-              this.position = index
-            }
+            this.position = index
           }
-        })
-      },
-      spanMethod({ row, column, rowIndex, columnIndex }) {
-        if (column.property === "corpName" || column.property === "orderNo" || column.property === "invoiceWeight" || column.property === "customDutyMoney" ||
-        column.property === "gstMoney" || column.property === "quotaMoney" || column.property === "itemMoney" || column.property === "unitPrice") {
-          const _row=this.spanArr[rowIndex];
-          const _col=_row>0?1:0;
-          return {
-            rowspan:_row,
-            colspan:_col
-          }
-        }
-      },
-      //点击搜索按钮触发
-      searchChange(params, done) {
-        this.query = params;
-        this.page.currentPage = 1;
-        this.onLoad(this.page, params);
-        done()
-      },
-      searchReset() {
-        console.log('1')
-      },
-      selectionChange() {
-        console.log('1')
-      },
-      currentChange(val) {
-        this.page.currentPage = val
-      },
-      sizeChange() {
-        console.log('1')
-      },
-      refreshChange() {
-        this.onLoad(this.page);
-      },
-      paramsAdjustment(params) {
-        params = Object.assign({}, this.search);
-        if (params.createTime &&  params.createTime.length !==0 ) {  //发货
-          params.startTime = params.createTime[0]+ " " + "00:00:00";
-          params.endTime = params.createTime[1] + " " + "23:59:59";
-          this.$delete(params,'createTime')
         }
-        return params
-      },
-      onLoad(page, params) {
-        this.loading = true;
-        params = this.paramsAdjustment(params)
-        getProfitList(page.currentPage, page.pageSize,params).then(res=>{
-          this.dataList = res.data.data.records
-          this.page.total = res.data.data.total
-          if (this.page.total || this.page.total === 0) {
-            this.option.height = window.innerHeight - 230;
-          }
-          this.rowspan()
-        }).finally(()=>{
-          this.loading = false;
-        })
-      },
-      cellStyle() {
-        return "padding:0;height:40px;";
-      },
-      //列保存触发
-      async saveColumn() {
-        const inSave = await this.saveColumnData(
-          this.getColumnName(66),
-          this.option
-        );
-        if (inSave) {
-          this.$message.success("保存成功");
-          //关闭窗口
-          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      })
+    },
+    spanMethod({ row, column, rowIndex, columnIndex }) {
+      if (column.property === "corpName" || column.property === "orderNo" || column.property === "invoiceWeight" || column.property === "customDutyMoney" ||
+        column.property === "gstMoney" || column.property === "quotaMoney" || column.property === "itemMoney" || column.property === "unitPrice") {
+        const _row = this.spanArr[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
         }
-      },
-      async resetColumn() {
-        const inSave = await this.delColumnData(
-          this.getColumnName(66),
-          option
-        );
-        if (inSave) {
-          this.$message.success("重置成功");
-          this.option = option;
-          //关闭窗口
-          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done()
+    },
+    searchReset() {
+      console.log('1')
+    },
+    selectionChange() {
+      console.log('1')
+    },
+    currentChange(val) {
+      this.page.currentPage = val
+    },
+    sizeChange() {
+      console.log('1')
+    },
+    refreshChange() {
+      this.onLoad(this.page);
+    },
+    paramsAdjustment(params) {
+      params = Object.assign({}, this.search);
+      if (params.createTime && params.createTime.length !== 0) {  //发货
+        params.startTime = params.createTime[0] + " " + "00:00:00";
+        params.endTime = params.createTime[1] + " " + "23:59:59";
+        this.$delete(params, 'createTime')
+      }
+      return params
+    },
+    onLoad(page, params) {
+      this.loading = true;
+      params = this.paramsAdjustment(params)
+      getProfitList(page.currentPage, page.pageSize, params).then(res => {
+        this.dataList = res.data.data.records
+        this.page.total = res.data.data.total
+        if (this.page.total || this.page.total === 0) {
+          this.option.height = window.innerHeight - 230;
         }
-      },
-    }
+        this.rowspan()
+      }).finally(() => {
+        this.loading = false;
+      })
+    },
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(66),
+        this.option
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      const inSave = await this.delColumnData(
+        this.getColumnName(66),
+        option
+      );
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.option = option;
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
   }
+}
 </script>
 
 <style scoped>