Browse Source

修改bug

lichao 3 years ago
parent
commit
c106b0c8f5

+ 54 - 0
src/api/standAlone/saleLeads.js

@@ -0,0 +1,54 @@
+import request from '@/router/axios';
+
+// 列表查询
+export function getList(params) {
+  return request({
+    url: '/api/trade-purchase/leads/list',
+    method: 'get',
+    params
+  })
+}
+// 列表删除
+export function deleteList(data) {
+  return request({
+    url: '/api/trade-purchase/leads/remove',
+    method: 'post',
+    params: {
+      ids:data
+    }
+  })
+}
+// 详情
+export function dataDetail(data) {
+  return request({
+    url: '/api/trade-purchase/leads/detail',
+    method: 'get',
+    params: data
+  })
+}
+// 保存&&修改
+export function typeSave(data) {
+  return request({
+    url: '/api/trade-purchase/leads/save',
+    method: 'post',
+    data
+  })
+}
+// 明细删除
+export function removeGoods(data) {
+  return request({
+    url: '/api/trade-purchase/office-order-item/remove',
+    method: 'post',
+    params: {
+      ids: data
+    }
+  })
+}
+// 请核
+export function pleaseCheck(data) {
+  return request({
+    url: '/api/trade-purchase/office-order/check-order',
+    method: 'post',
+    data: data
+  })
+}

+ 5 - 3
src/components/fee-info/main.vue

@@ -150,14 +150,16 @@
           <span>{{ row.amount | micrometerFormat }}</span>
         </template>
         <template slot="exchangeRate" slot-scope="{ row }">
-          <el-input
+          <el-input-number
             v-if="row.$cellEdit"
             v-model="row.exchangeRate"
             size="small"
-            oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+            :controls="false"
+            :precision="6"
             @change="rateChange(row)"
+            style="width: 100%"
             placeholder="请输入"
-          ></el-input>
+          ></el-input-number>
           <span v-else>{{ row.exchangeRate }}</span>
         </template>
         <template slot="currency" slot-scope="{ row }">

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

@@ -392,6 +392,14 @@ const columnName = [{
     code: 105,
     name: '办公用品库存列表'
   },
+  {
+    code: 106,
+    name: '报销列表'
+  },
+  {
+    code: 107,
+    name: '报销明细'
+  },
 ]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {

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

@@ -369,6 +369,12 @@ export default {
         if (tag.label == "领用") {
           this.$store.commit('OFFICELY_OUT_DETAIL');
         }
+        if (tag.label == "交接单") {
+          this.$store.commit('JJD_OUT_DETAIL');
+        }
+        if (tag.label == "报销") {
+          this.$store.commit('BX_OUT_DETAIL');
+        }
         this.$store.commit("DEL_TAG", tag);
         if (tag.value === this.tag.value) {
           tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个

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

@@ -1274,4 +1274,19 @@ export default [{
       component: () => import( /* webpackChunkName: "views" */ '@/views/workManagement/stock/index')
     }]
   },
+  //报销
+  {
+    path: '/reimbursement/index',
+    component: Layout,
+    hidden: true,
+    children: [{
+      path: '/reimbursement/index',
+      name: '报销',
+      meta: {
+        i18n: '/reimbursement/index',
+        keepAlive: true,
+      },
+      component: () => import( /* webpackChunkName: "views" */ '@/views/reimbursement/index')
+    }]
+  },
 ]

+ 2 - 0
src/store/getters.js

@@ -48,5 +48,7 @@ const getters = {
   bjStatus: state => state.ifdetail.bjStatus,
   officePurchaseStatus: state => state.ifdetail.officePurchaseStatus,
   officeLyStatus: state => state.ifdetail.officeLyStatus,
+  handOverStatus: state => state.ifdetail.handOverStatus,
+  reimbursementStatus: state => state.ifdetail.reimbursementStatus,
 }
 export default getters

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

@@ -22,6 +22,8 @@ const ifdetail = {
     bjStatus: false, //出口报价
     officePurchaseStatus: false, // 办公采购
     officeLyStatus: false, //办公领用
+    handOverStatus: false, // 交接单
+    reimbursementStatus: false, // 报销
   },
   actions: {},
   mutations: {
@@ -196,6 +198,20 @@ const ifdetail = {
     OFFICELY_OUT_DETAIL(state) {
       state.officeLyStatus = false;
     },
+    // 交接单
+    JJD_IN_DETAIL(state) {
+      state.handOverStatus = true;
+    },
+    JJD_OUT_DETAIL(state) {
+      state.handOverStatus = false;
+    },
+    // 报销
+    BX_IN_DETAIL(state) {
+      state.reimbursementStatus = true;
+    },
+    BX_OUT_DETAIL(state) {
+      state.reimbursementStatus = false;
+    },
     //关闭所有
     DEL_ALL_DETAIL(state) {
       for (let item in state) {

+ 1 - 1
src/util/date.js

@@ -79,6 +79,6 @@ export function getCurrentDate(type = 'dateTime') {
   if (type == 'date') {
     return dateFormat(currentDate, 'yyyy-MM-dd')
   } else if (type == 'dateTime') {
-    return dateFormat(currentDate, 'yyyy-MM-dd') + ' 00:00:00'
+    return dateFormat(date, 'yyyy-MM-dd hh:mm:ss')
   }
 }

+ 7 - 3
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -2206,8 +2206,8 @@ export default {
       })
       this.arrivalOptions = [];
       this.arrivalOptions = await this.corpAddr(data.id)
-      this.$set(this.form, 'paymentType', data.paymentType)
-      this.$set(this.form, 'packageRemarks', data.packageRemarks)
+      this.$set(this.form, 'paymentType', data.paymentType? data.paymentType: '预付')
+      this.$set(this.form, 'packageRemarks', data.packageRemarks? data.packageRemarks: '无包装')
       if (this.arrivalOptions.length > 0) {
         this.$set(this.form, 'arrivalAddress', this.arrivalOptions[0].label)
       } else {
@@ -2720,6 +2720,10 @@ export default {
     //
     goodsSearch(params, done) {
       this.treeDeptId = ''
+      params = {
+        ...params,
+        artsVision: this.form.belongToCorpId
+      }
       this.onLoad(this.page, params);
       done()
     },
@@ -2801,7 +2805,7 @@ export default {
           }
           this.form.orderFeesList = this.$refs.feeInfo.submitData()
           let packFee;
-          if (this.form.packageRemarks && this.form.packageRemarks !== '无包装') {
+          if (this.form.packageRemarks && this.form.packageRemarks !== '无包装' && this.form.packageRemarks !== '不包装') {
             let arr = this.form.orderFeesList.filter(item => item.feesType == 1)
             packFee = arr.findIndex(item => item.feeName == '包装费')
           }

+ 54 - 0
src/views/reimbursement/config/customerContact.json

@@ -0,0 +1,54 @@
+{
+  "stripe": true,
+  "searchShow": true,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "addBtn": false,
+  "delBtn": false,
+  "align": "center",
+  "menuWidth": 120,
+  "refreshBtn": false,
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [
+  ],
+  "column": [
+    {
+      "label": "日期",
+      "prop": "date",
+      "index": 1,
+      "width": 200,
+      "overHidden": true
+    },
+    {
+      "label": "费用项目",
+      "prop": "feeName",
+      "index": 2,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "摘要说明",
+      "prop": "content",
+      "index": 3,
+      "width": 200,
+      "overHidden": true
+    },
+    {
+      "label": "单据张数",
+      "prop": "num",
+      "index": 4,
+      "width": 120,
+      "overHidden": true
+    },
+    {
+      "label": "金额",
+      "prop": "amount",
+      "index": 5,
+      "width": 140,
+      "overHidden": true
+    }
+  ]
+}

+ 70 - 0
src/views/reimbursement/config/mainList.json

@@ -0,0 +1,70 @@
+{
+  "stripe": true,
+  "height": "auto",
+  "searchShow": true,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "align": "center",
+  "menuWidth": "70",
+  "searchIcon": true,
+  "searchIndex": 2,
+  "selection": true,
+  "tip": false,
+  "searchSpan": 8,
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [],
+  "column": [
+    {
+      "label": "日期",
+      "prop": "b",
+      "type": "date",
+      "overHidden": true,
+      "minWidth": 200,
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "unlinkPanels": true,
+      "searchRange": true,
+      "search": true
+    },
+    {
+      "label": "创建人",
+      "prop": "createUser",
+      "overHidden": true,
+      "minWidth": 120,
+      "search": true
+    },
+    {
+      "label": "No.",
+      "prop": "sysNo",
+      "overHidden": true,
+      "minWidth": 120,
+      "search": true
+    },
+    {
+      "label": "所属部门",
+      "prop": "dept",
+      "overHidden": true,
+      "minWidth": 120,
+      "search": false
+    },
+    {
+      "label": "岗位",
+      "prop": "postName",
+      "overHidden": true,
+      "minWidth": 120,
+      "search": false
+    },
+    {
+      "label": "审核人",
+      "prop": "sysNo",
+      "overHidden": true,
+      "minWidth": 120,
+      "search": false
+    }
+  ]
+}

+ 478 - 0
src/views/reimbursement/detail.vue

@@ -0,0 +1,478 @@
+<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"
+          :loading="btnLoading"
+        >返回列表</el-button>
+      </div>
+      <div class="add-customer-btn">
+        <el-button
+          type="primary"
+          size="small"
+          class="el-button--small-yh"
+          @click.stop="openEdit"
+        >编 辑</el-button>
+        <el-button
+          type="success"
+          :disabled="!form.id"
+          size="small"
+          @click="copyDoc"
+          :loading="btnLoading"
+        >复制单据</el-button>
+        <el-button
+          type="primary"
+          @click="editCustomer"
+          size="small"
+          :loading="btnLoading"
+        >保存数据</el-button>
+      </div>
+    </div>
+    <div class="customer-main">
+      <containerTitle title="基础信息"/>
+      <basic-container :showBtn="true">
+        <avue-form
+          ref="form"
+          class="trading-form"
+          v-model="form"
+          :option="option"
+        >
+          <template slot="createUser">
+            <el-select
+              v-model="form.createUser"
+              filterable
+              clearable
+              size="small"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="(item,index) in userList"
+                :key="index"
+                :label="item.realName"
+                :value="item.realName"
+              ></el-option>
+            </el-select>
+          </template>
+          <template slot="dept">
+            <avue-input-tree
+              leaf-only
+              style="width: 100%;"
+              size="small"
+              :props="{ label: 'title' }"
+              v-model="form.dept"
+              placeholder=" "
+              type="tree"
+              :dic="dic"
+            ></avue-input-tree>
+          </template>
+          <template slot="postId">
+            <el-select
+              v-model="form.postId"
+              clearable
+              filterable
+              multiple
+              collapse-tags
+              placeholder="请选择 岗位"
+            >
+              <el-option
+                v-for="(item, index) in postDic"
+                :label="item.postName"
+                :value="item.id"
+                :key="index"
+              />
+            </el-select>
+          </template>
+        </avue-form>
+      </basic-container>
+      <containerTitle title="报销明细"/>
+      <basic-container>
+        <avue-crud
+          ref="crud"
+          :data="dataList"
+          :option="tableOption"
+          :cell-style="cellStyle"
+          @saveColumn="saveColumn"
+          @resetColumn="resetColumn"
+        >
+          <template slot="menuLeft">
+            <el-button
+              type="primary"
+              icon="el-icon-plus"
+              size="small"
+              @click.stop="newDetails"
+            >录入明细</el-button>
+            <el-button
+              type="info"
+              icon="el-icon-printer"
+              size="small"
+            >报表打印</el-button>
+          </template>
+          <template slot="menu" slot-scope="{ row, index }">
+            <el-button
+              size="small"
+              icon="el-icon-edit"
+              type="text"
+              @click="rowCell(row, index)"
+            >{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
+            <el-button
+              size="small"
+              icon="el-icon-delete"
+              type="text"
+              @click="rowDel(row, index)"
+            >删除</el-button>
+          </template>
+          <template slot="date" slot-scope="{ row, index }">
+            <el-date-picker
+              v-if="row.$cellEdit"
+              v-model="row.date"
+              type="date"
+              placeholder="选择日期"
+              size="small"
+              style="width: 100%"
+            ></el-date-picker>
+            <span v-else>{{row.date}}</span>
+          </template>
+          <template slot="feeName" slot-scope="{ row }">
+            <breakdown-select
+              v-if="row.$cellEdit"
+              v-model="row.itemId"
+              @selectValue="value => selectValue(value, row)"
+              :configuration="breakConfiguration"
+            >
+            </breakdown-select>
+            <span v-else>{{ row.feeName }}</span>
+          </template>
+          <template slot="content" slot-scope="{ row, index }">
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.content"
+              size="small"
+              placeholder="输入内容"
+            />
+            <span v-else>{{row.content}}</span>
+          </template>
+          <template slot="num" slot-scope="{ row, index }">
+            <el-input-number
+              v-if="row.$cellEdit"
+              v-model="row.num"
+              size="small"
+              :controls="false"
+              :precision="0"
+              style="width: 100%"
+              placeholder="单据张数"
+            ></el-input-number>
+            <span v-else>{{ row.num }}</span>
+          </template>
+          <template slot="amount" slot-scope="{ row, index }">
+            <el-input-number
+              v-if="row.$cellEdit"
+              v-model="row.amount"
+              size="small"
+              :controls="false"
+              :precision="2"
+              style="width: 100%"
+              placeholder="金额"
+            ></el-input-number>
+            <span v-else>{{ row.amount }}</span>
+          </template>
+        </avue-crud>
+      </basic-container>
+    </div>
+  </div>
+</template>
+
+<script>
+import tableOption from "./config/customerContact.json";
+import {
+  isDiscount,
+  isPercentage,
+  micrometerFormat,
+  IntegerFormat
+} from "@/util/validate";
+import { gainUser } from "@/api/basicData/customerInquiry";
+import {getUserInfo} from "@/api/system/user";
+import {getDeptTree} from "@/api/system/dept";
+import { getCurrentDate } from "@/util/date";
+import {getList as getPostList} from "@/api/system/post";
+
+export default {
+  name: "detail",
+  data() {
+    return {
+      pageLoading: false,
+      btnLoading: false,
+      form: {},
+      option: {
+        menuBtn: false,
+        labelWidth: 100,
+        column: [
+          {
+            label: "日期",
+            prop: "b",
+            span: 8,
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd 00:00:00",
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur"
+              }
+            ]
+          },
+          {
+            label: "创建人",
+            prop: "createUser",
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "change"
+              }
+            ],
+            span: 8,
+            slot: true,
+          },
+          {
+            label: "所属部门",
+            prop: "dept",
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur"
+              }
+            ],
+            span: 8,
+            slot: true,
+          },
+          {
+            label: "岗位",
+            prop: "postId",
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur"
+              }
+            ],
+            span: 8,
+            slot: true,
+          },
+          {
+            label: "职位",
+            prop: "bb",
+            rules: [
+              {
+                required: true,
+                message: " ",
+                trigger: "blur"
+              }
+            ],
+            span: 8,
+            slot: true,
+          },
+          {
+            label: "No.",
+            prop: "sysNo",
+            span: 8,
+            slot: true,
+          },
+          {
+            label: "备注",
+            prop: "orderRemark",
+            type: "textarea",
+            minRows: 2,
+            span: 24,
+          },
+        ],
+      },
+      dataList: [],
+      tableOption: {},
+      goodsoptions: [],
+      unitOption: [],
+      selectionList: [],
+      search: {},
+      treeStyle: "height:" + (window.innerHeight - 315) + "px",
+      goodsOption: {},
+      loading: false,
+      switchDialog: false, // 报表弹窗控制
+      userList: [],
+      dic: [], // 部门
+      postDic: [], // 岗位
+      loginUser: '', // 登录人
+      breakConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        disabled: false,
+        searchShow: true,
+        collapseTags: false,
+        clearable: true,
+        placeholder: "请点击右边按钮选择",
+        dicData: []
+      },
+    }
+  },
+  async created() {
+    this.$set(this.form, 'b', getCurrentDate()); // 默认当前日期
+    this.tableOption = await this.getColumnData(
+      this.getColumnName(107),
+      tableOption
+    );
+    gainUser().then(res => {
+      this.userList = res.data.data;
+    });
+    getUserInfo().then(res => {
+      this.$set(this.form, 'createUser', res.data.data.realName);
+      this.$set(this.form, 'dept', res.data.data.deptId);
+      this.$set(this.form, 'postId', res.data.data.postId.split(','));
+      this.loginUser = res.data.data.realName;
+    })
+    getDeptTree().then(res => {
+      this.dic = res.data.data
+    })
+    getPostList(1, 10).then(res => {
+      if (res.data.data.total > 0) {
+        this.postDic = res.data.data.records;
+        if (Math.ceil(res.data.data.total / 10) > 1) {
+          for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
+            getPostList(i, 10).then(e => {
+              this.postDic = this.postDic.concat(e.data.data.records);
+            });
+          }
+        }
+      }
+    });
+    this.getWorkDicts('unit').then(res => {
+      this.unitOption = res.data.data;
+    })
+  },
+  filters: {
+    IntegerFormat(num) {
+      return IntegerFormat(num);
+    },
+    decimalFormat(num) {
+      return num ? Number(num).toFixed(2) : "0.00";
+    }
+  },
+  methods: {
+    //返回列表
+    backToList() {
+      this.$emit("goBack");
+    },
+    // 编辑按钮触发
+    openEdit() {},
+    // 复制
+    copyDoc() {
+      this.$emit("copyOrder", this.form.id);
+    },
+    //修改提交触发
+    editCustomer(status) {
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          // this.btnLoading = true;
+          // typeSave(this.form).then(res => {
+          //   this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
+          //   this.queryData(res.data.data.id);
+          // }).finally(() => {
+          //   this.btnLoading = false;
+          // })
+        } else {
+          return false
+        }
+      })
+    },
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(107),
+        this.tableOption
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+      }
+    },
+    async resetColumn() {
+      this.tableOption = tableOption;
+      const inSave = await this.delColumnData(
+        this.getColumnName(107),
+        tableOption
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+        this.$message.success("重置成功");
+        //关闭窗口
+        setTimeout(() => {
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }, 1000);
+      }
+    },
+    //录入明细
+    newDetails() {
+      this.$refs["form"].validate((valid, done) => {
+        done()
+        if (valid) {
+          this.dataList.push({
+            $cellEdit: true,
+          })
+        }
+      })
+    },
+    rowCell(row, index) {
+      if (row.$cellEdit == true) {
+        this.$set(row, "$cellEdit", false);
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
+    },
+    rowDel(row, index) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        if (row.id) {
+          // removeGoods(row.id).then(res => {
+          //   this.$message({
+          //     type: 'success',
+          //     message: '删除成功!'
+          //   })
+          //   this.dataList.splice(row.$index, 1);
+          // })
+        } else {
+          this.$message({
+            type: "success",
+            message: "删除成功!"
+          });
+          this.dataList.splice(row.$index, 1);
+        }
+      });
+    },
+    getKHData(row) {},
+    //选择费用
+    selectValue(value, row) {
+      this.$set(row, "feeName", value.cname);
+      this.$set(row, "ename", value.ename);
+    },
+  },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 263 - 0
src/views/reimbursement/index.vue

@@ -0,0 +1,263 @@
+<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"
+        :table-loading="loading"
+        :cell-style="cellStyle"
+        @selection-change="selectionChange"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        @search-criteria-switch="searchCriteriaSwitch"
+        @saveColumn="saveColumn"
+        @resetColumn="resetColumn"
+      >
+        <template slot="menuLeft">
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="small"
+            @click.stop="newAdd()"
+          >创建单据</el-button>
+          <el-button
+            type="success"
+            size="small"
+            icon="el-icon-plus"
+            @click.stop="copyDoc()"
+            :disabled="selection.length != 1"
+          >复制单据</el-button>
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
+            type="text"
+            icon="el-icon-delete"
+            size="small"
+            @click.stop="rowDel(scope.row, scope.index)"
+            :disabled="scope.row.status == 3"
+          >删除
+          </el-button>
+        </template>
+        <template slot="corpNameSearch">
+          <crop-select
+            v-model="search.corpId"
+            corpType="KH"
+          ></crop-select>
+        </template>
+        <template slot="createUserSearch">
+          <el-select
+            v-model="search.createUser"
+            filterable
+            clearable
+            placeholder="请选择 承揽人"
+          >
+            <el-option
+              v-for="(item, index) in userOption"
+              :key="index"
+              :value="item.id"
+              :label="item.realName"
+            ></el-option>
+          </el-select>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detail-page
+      @goBack="goBack"
+      @copyOrder="copyOrder"
+      :detailData="detailData"
+      v-if="!show"
+    />
+  </div>
+</template>
+
+<script>
+import option from "./config/mainList.json";
+import detailPage from "./detail";
+import { gainUser } from "@/api/basicData/customerInquiry";
+
+export default {
+  name: "index",
+  components: {
+    detailPage,
+  },
+  data() {
+    return {
+      option: {},
+      dataList: [],
+      form: {},
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 50, 100, 200, 300, 400, 500]
+      },
+      search: {},
+      show: true,
+      loading: false,
+      selection: [],
+      detailData: {},
+      userOption: [],
+    }
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(106), option);
+    gainUser().then(res => {
+      this.userOption = res.data.data;
+    })
+  },
+  activated() {
+    if (this.$route.query.check) {
+      this.show = true
+      this.detailData = {
+        id: this.$route.query.check.billId,
+        check: this.$route.query.check,
+        auditId: this.$route.query.check.id,
+      };
+      this.show = false;
+      this.$store.commit("BX_IN_DETAIL");
+    }
+  },
+  methods: {
+    searchCriteriaSwitch(type) {
+      // if (type){
+      //   this.option.height =  this.option.height - 90
+      // }else {
+      //   this.option.height =  this.option.height + 90
+      // }
+      // this.$refs.crud.getTableHeight()
+    },
+    newAdd() {
+      this.show = false;
+      this.$store.commit("BX_IN_DETAIL");
+    },
+    onLoad(page, params) {
+      // 重置掉展开
+      this.dataList.forEach(item => {
+        this.$refs.crud.toggleRowExpansion(item, false)
+      })
+      let queryParams = Object.assign({}, params, {
+        size: page.pageSize,
+        current: page.currentPage,
+      })
+      // this.loading = true;
+      // getSalesList(queryParams).then(res => {
+      //   this.dataList = res.data.data.records;
+      //   this.page.total = res.data.data.total;
+      //   this.option.height = window.innerHeight - 240;
+      //   this.$nextTick(() => {
+      //     this.$refs.crud.doLayout()
+      //   })
+      // }).finally(() => {
+      //   this.loading = false;
+      // })
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(106),
+        this.option
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+      }
+    },
+    async resetColumn() {
+      this.option = option;
+      const inSave = await this.delColumnData(this.getColumnName(106), option);
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = 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.onLoad(this.page, this.search);
+    },
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    copyDoc() {},
+    selectionChange(list) {
+      this.selection = list;
+    },
+    goBack() {
+      if (this.$route.query) {
+        this.$router.$avueRouter.closeTag(this.$route.fullPath);
+        this.$router.push({
+          path: "/reimbursement/index"
+        });
+      }
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
+      this.onLoad(this.page, this.search);
+    },
+    copyOrder(id) {
+      this.show = true;
+      this.detailData = {
+        id: id,
+        status: "copy"
+      };
+      this.$nextTick(() => {
+        this.show = false;
+        this.$store.commit("BX_IN_DETAIL");
+      });
+    },
+    // 详情打开
+    beforeOpenPage(row, index) {
+      this.show = false;
+      this.detailData = {
+        id: row.id,
+        query: true, // 表示只是查询
+      };
+      this.$store.commit("BX_IN_DETAIL");
+    },
+    //删除列表后面的删除按钮触发触发(row, index, done)
+    rowDel(row, index, done) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(res => {
+        // return deleteList(row.id)
+      }).then(() => {
+        this.dataList.splice(row.$index, 1)
+        this.$message({
+          type: "success",
+          message: "删除成功!"
+        });
+        this.page.currentPage = 1;
+        this.onLoad(this.page)
+      })
+    },
+  },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 9 - 9
src/views/saleLeads/config/customerContact.json

@@ -17,49 +17,49 @@
   "column": [
     {
       "label": "日期",
-      "prop": "date",
+      "prop": "bizDate",
       "index": 1,
       "width": 200,
       "overHidden": true
     },
     {
       "label": "内容",
-      "prop": "content",
+      "prop": "bizContent",
       "index": 2,
       "width": 200,
       "overHidden": true
     },
     {
       "label": "客户联系人",
-      "prop": "attn",
+      "prop": "contacts",
       "index": 3,
       "width": 120,
       "overHidden": true
     },
     {
       "label": "联系方式",
-      "prop": "contact",
+      "prop": "tel",
       "index": 4,
-      "width": 120,
+      "width": 140,
       "overHidden": true
     },
     {
       "label": "是否满足客户需求",
-      "prop": "satisfy",
+      "prop": "approval",
       "index": 5,
       "width": 140,
       "overHidden": true
     },
     {
       "label": "人员",
-      "prop": "createUser",
+      "prop": "bizUserName",
       "index": 6,
       "width": 100,
       "overHidden": true
     },
     {
-      "label": "创建时间",
-      "prop": "createTime",
+      "label": "时间",
+      "prop": "bizTime",
       "index": 6,
       "width": 200,
       "overHidden": true

+ 4 - 4
src/views/saleLeads/config/mainList.json

@@ -29,7 +29,7 @@
     },
     {
       "label": "业务日期",
-      "prop": "b",
+      "prop": "bizDate",
       "type": "date",
       "overHidden": true,
       "minWidth": 200,
@@ -41,7 +41,7 @@
     },
     {
       "label": "状态",
-      "prop": "state",
+      "prop": "status",
       "overHidden": true,
       "minWidth": 120,
       "search": true,
@@ -54,7 +54,7 @@
     },
     {
       "label": "承揽人",
-      "prop": "createUser",
+      "prop": "fromUserName",
       "search": true,
       "index": 1,
       "minWidth": 80,
@@ -62,7 +62,7 @@
     },
     {
       "label": "对接人",
-      "prop": "oppositePerson",
+      "prop": "toUserName",
       "search": true,
       "index": 1,
       "minWidth": 80,

+ 100 - 44
src/views/saleLeads/detail.vue

@@ -16,6 +16,7 @@
           size="small"
           class="el-button--small-yh"
           @click.stop="openEdit"
+          v-if="disabled"
         >编 辑</el-button>
         <el-button
           type="success"
@@ -48,33 +49,35 @@
               corpType="KH"
             />
           </template>
-          <template slot="createUser">
+          <template slot="fromUser">
             <el-select
-              v-model="form.createUser"
+              v-model="form.fromUser"
               filterable
               clearable
               size="small"
+              :disabled="disabled"
             >
               <el-option
                 v-for="(item,index) in userList"
                 :key="index"
                 :label="item.realName"
-                :value="item.realName"
+                :value="item.id"
               ></el-option>
             </el-select>
           </template>
-          <template slot="oppositePerson">
+          <template slot="toUser">
             <el-select
-              v-model="form.oppositePerson"
+              v-model="form.toUser"
               filterable
               clearable
               size="small"
+              :disabled="disabled"
             >
               <el-option
                 v-for="(item,index) in userList"
                 :key="index"
                 :label="item.realName"
-                :value="item.realName"
+                :value="item.id"
               ></el-option>
             </el-select>
           </template>
@@ -117,47 +120,49 @@
               @click="rowDel(row, index)"
             >删除</el-button>
           </template>
-          <template slot="date" slot-scope="{ row, index }">
+          <template slot="bizDate" slot-scope="{ row, index }">
             <el-date-picker
               v-if="row.$cellEdit"
-              v-model="row.date"
+              v-model="row.bizDate"
               type="date"
               placeholder="选择日期"
               size="small"
               style="width: 100%"
+              format="yyyy-MM-dd"
+              valueFormat="yyyy-MM-dd"
             ></el-date-picker>
-            <span v-else>{{row.date}}</span>
+            <span v-else>{{row.bizDate}}</span>
           </template>
-          <template slot="content" slot-scope="{ row, index }">
+          <template slot="bizContent" slot-scope="{ row, index }">
             <el-input
               v-if="row.$cellEdit"
-              v-model="row.content"
+              v-model="row.bizContent"
               size="small"
               placeholder="输入内容"
             />
-            <span v-else>{{row.content}}</span>
+            <span v-else>{{row.bizContent}}</span>
           </template>
-          <template slot="attn" slot-scope="{ row, index }">
+          <template slot="contacts" slot-scope="{ row, index }">
             <el-input
               v-if="row.$cellEdit"
-              v-model="row.attn"
+              v-model="row.contacts"
               size="small"
               placeholder="输入客户联系人"
             />
-            <span v-else>{{row.attn}}</span>
+            <span v-else>{{row.contacts}}</span>
           </template>
-          <template slot="contact" slot-scope="{ row, index }">
+          <template slot="tel" slot-scope="{ row, index }">
             <el-input
               v-if="row.$cellEdit"
-              v-model="row.contact"
+              v-model="row.tel"
               size="small"
               placeholder="输入联系方式"
             />
-            <span v-else>{{row.contact}}</span>
+            <span v-else>{{row.tel}}</span>
           </template>
-          <template slot="satisfy" slot-scope="{ row, index }">
+          <template slot="approval" slot-scope="{ row, index }">
             <el-switch
-              v-model="row.satisfy"
+              v-model="row.approval"
               :disabled="!row.$cellEdit"
               :inactive-value="0"
               :active-value="1"
@@ -181,18 +186,26 @@ import { gainUser } from "@/api/basicData/customerInquiry";
 import {getUserInfo} from "@/api/system/user";
 import {getDeptTree} from "@/api/system/dept";
 import { getCurrentDate } from "@/util/date";
+import {dataDetail, typeSave, removeGoods, pleaseCheck} from "@/api/standAlone/saleLeads";
 
 export default {
   name: "detail",
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
   data() {
     const validateRemark = (rule, value, callback) => {
-      if (this.form.state == 2 && !this.form.orderRemark) {
+      if (this.form.status == 2 && !this.form.remarks) {
         callback(new Error('备注不能为空'))
       } else {
         callback()
       }
     }
     return {
+      disabled: false,
+      checkDisabled: false,
       pageLoading: false,
       btnLoading: false,
       form: {},
@@ -202,12 +215,12 @@ export default {
         column: [
           {
             label: "客户名称",
-            prop: "corpId",
+            prop: "corpName",
             rules: [
               {
                 required: true,
                 message: " ",
-                trigger: "change"
+                trigger: "blur"
               }
             ],
             span: 8,
@@ -215,7 +228,7 @@ export default {
           },
           {
             label: "客户联系人",
-            prop: "corpr",
+            prop: "contacts",
             rules: [
               {
                 required: true,
@@ -228,7 +241,7 @@ export default {
           },
           {
             label: "客户电话",
-            prop: "corpTel",
+            prop: "tel",
             rules: [
               {
                 required: true,
@@ -247,7 +260,7 @@ export default {
           },
           {
             label: "业务内容",
-            prop: "businessContent",
+            prop: "bizContent",
             rules: [
               {
                 required: true,
@@ -260,7 +273,7 @@ export default {
           },
           {
             label: "业务日期",
-            prop: "b",
+            prop: "bizDate",
             span: 8,
             type: "date",
             format: "yyyy-MM-dd",
@@ -275,7 +288,7 @@ export default {
           },
           {
             label: "承揽人",
-            prop: "createUser",
+            prop: "fromUser",
             rules: [
               {
                 required: true,
@@ -288,7 +301,7 @@ export default {
           },
           {
             label: "对接人",
-            prop: "oppositePerson",
+            prop: "toUser",
             rules: [
               {
                 required: true,
@@ -301,7 +314,7 @@ export default {
           },
           {
             label: "状态",
-            prop: "state",
+            prop: "status",
             span: 8,
             type: 'select',
             dicData: [
@@ -319,7 +332,7 @@ export default {
           },
           {
             label: "备注",
-            prop: "orderRemark",
+            prop: "remarks",
             type: "textarea",
             minRows: 2,
             span: 24,
@@ -342,10 +355,11 @@ export default {
       userList: [],
       dic: [],
       loginUser: '', // 登录人
+      loginUserId: null,
     }
   },
   async created() {
-    this.$set(this.form, 'b', getCurrentDate()); // 默认当前日期
+    this.$set(this.form, 'bizDate', getCurrentDate()); // 默认当前日期
     this.tableOption = await this.getColumnData(
       this.getColumnName(102),
       tableOption
@@ -354,9 +368,10 @@ export default {
       this.userList = res.data.data;
     });
     getUserInfo().then(res => {
-      this.$set(this.form, 'createUser', res.data.data.realName);
-      this.$set(this.form, 'oppositePerson', res.data.data.realName);
+      this.$set(this.form, 'fromUser', res.data.data.id);
+      this.$set(this.form, 'toUser', res.data.data.id);
       this.loginUser = res.data.data.realName;
+      this.loginUserId = res.data.data.id;
     })
     getDeptTree().then(res => {
       this.dic = res.data.data
@@ -364,6 +379,17 @@ export default {
     this.getWorkDicts('unit').then(res => {
       this.unitOption = res.data.data;
     })
+    if (this.detailData.query) {
+      this.disabled = true;
+      this.option.column.map(e => {
+        this.$set(e, 'disabled', true)
+      })
+      this.queryData(this.detailData.id);
+    } else if (this.detailData.auditId) {
+      this.checker = true;
+      this.batchNo = this.detailData.check.batchNo
+      this.queryData(this.detailData.id);
+    }
   },
   filters: {
     IntegerFormat(num) {
@@ -374,12 +400,40 @@ export default {
     }
   },
   methods: {
+    // 查询
+    queryData(id) {
+      this.pageLoading = true;
+      dataDetail({id: id}).then(res => {
+        this.form = res.data.data;
+        this.dataList = this.form.itemList? this.form.itemList: [];
+        this.oldForm = {...this.form};
+        this.oldDataList = [...this.dataList];
+        delete this.form.itemList;
+        this.checkDisabled = this.form.status > 0? true: false;
+        if (this.form.status > 0) {
+          this.option.column.map(e => {
+            this.$set(e, 'disabled', true)
+          })
+        }
+      }).finally(() => {
+        this.pageLoading = false;
+      })
+    },
     //返回列表
     backToList() {
       this.$emit("goBack");
     },
     // 编辑按钮触发
-    openEdit() {},
+    openEdit() {
+      this.disabled = false;
+      this.option.column.map(e => {
+        if (this.checkDisabled) {
+          this.$set(e, 'disabled', true)
+        } else {
+          this.$set(e, 'disabled', false)
+        }
+      })
+    },
     // 复制
     copyDoc() {
       this.$emit("copyOrder", this.form.id);
@@ -389,13 +443,14 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
-          // this.btnLoading = true;
-          // typeSave(this.form).then(res => {
-          //   this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
-          //   this.queryData(res.data.data.id);
-          // }).finally(() => {
-          //   this.btnLoading = false;
-          // })
+          this.btnLoading = true;
+          this.$set(this.form, 'itemList', this.dataList)
+          typeSave(this.form).then(res => {
+            this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
+            this.queryData(res.data.data);
+          }).finally(() => {
+            this.btnLoading = false;
+          })
         } else {
           return false
         }
@@ -441,8 +496,9 @@ export default {
         done()
         if (valid) {
           this.dataList.push({
-            createTime: getCurrentDate('date'),
-            createUser: this.loginUser,
+            bizTime: getCurrentDate(),
+            bizUserName: this.loginUser,
+            bizUser: this.loginUserId,
             $cellEdit: true,
           })
         }

+ 51 - 21
src/views/saleLeads/index.vue

@@ -45,15 +45,15 @@
           >删除
           </el-button>
         </template>
-        <template slot="corpNameSearch">
-          <crop-select
-            v-model="search.corpId"
-            corpType="KH"
-          ></crop-select>
-        </template>
-        <template slot="createUserSearch">
+<!--        <template slot="corpNameSearch">-->
+<!--          <crop-select-->
+<!--            v-model="search.corpId"-->
+<!--            corpType="KH"-->
+<!--          ></crop-select>-->
+<!--        </template>-->
+        <template slot="fromUserNameSearch">
           <el-select
-            v-model="search.createUser"
+            v-model="search.fromUser"
             filterable
             clearable
             placeholder="请选择 承揽人"
@@ -66,9 +66,9 @@
             ></el-option>
           </el-select>
         </template>
-        <template slot="oppositePersonSearch">
+        <template slot="toUserNameSearch">
           <el-select
-            v-model="search.oppositePerson"
+            v-model="search.toUser"
             filterable
             clearable
             placeholder="请选择 承揽人"
@@ -81,6 +81,9 @@
             ></el-option>
           </el-select>
         </template>
+        <template slot="corpName" slot-scope="scope">
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.corpName }}</span>
+        </template>
       </avue-crud>
     </basic-container>
     <detail-page
@@ -96,6 +99,7 @@
 import option from "./config/mainList.json";
 import detailPage from "./detail";
 import { gainUser } from "@/api/basicData/customerInquiry";
+import {getList, deleteList} from "@/api/standAlone/saleLeads";
 
 export default {
   name: "index",
@@ -150,17 +154,17 @@ export default {
         size: page.pageSize,
         current: page.currentPage,
       })
-      // this.loading = true;
-      // getSalesList(queryParams).then(res => {
-      //   this.dataList = res.data.data.records;
-      //   this.page.total = res.data.data.total;
-      //   this.option.height = window.innerHeight - 240;
-      //   this.$nextTick(() => {
-      //     this.$refs.crud.doLayout()
-      //   })
-      // }).finally(() => {
-      //   this.loading = false;
-      // })
+      this.loading = true;
+      getList(queryParams).then(res => {
+        this.dataList = res.data.data.records;
+        this.page.total = res.data.data.total;
+        this.option.height = window.innerHeight - 240;
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+        })
+      }).finally(() => {
+        this.loading = false;
+      })
     },
     async saveColumn() {
       const inSave = await this.saveColumnData(
@@ -240,6 +244,32 @@ export default {
         this.oppositePerson = res.data.data;
       })
     },
+    // 详情打开
+    beforeOpenPage(row, index) {
+      this.show = false;
+      this.detailData = {
+        id: row.id,
+        query: true, // 表示只是查询
+      };
+    },
+    //删除列表后面的删除按钮触发触发(row, index, done)
+    rowDel(row, index, done) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(res => {
+        return deleteList(row.id)
+      }).then(() => {
+        this.dataList.splice(row.$index, 1)
+        this.$message({
+          type: "success",
+          message: "删除成功!"
+        });
+        this.page.currentPage = 1;
+        this.onLoad(this.page)
+      })
+    },
   },
 }
 </script>

+ 10 - 0
src/views/workManagement/handoverSheet/detail.vue

@@ -182,6 +182,16 @@ export default {
             span: 8,
           },
           {
+            label: "交接人",
+            prop: "handoverPerson",
+            span: 8,
+          },
+          {
+            label: "联系人",
+            prop: "contacts",
+            span: 8,
+          },
+          {
             label: "交接备注",
             prop: "orderRemark",
             type: "textarea",

+ 43 - 29
src/views/workManagement/handoverSheet/index.vue

@@ -59,22 +59,7 @@
             placeholder="请选择 承揽人"
           >
             <el-option
-              v-for="(item, index) in contractorOption"
-              :key="index"
-              :value="item.realName"
-              :label="item.realName"
-            ></el-option>
-          </el-select>
-        </template>
-        <template slot="oppositePersonSearch">
-          <el-select
-            v-model="search.oppositePerson"
-            filterable
-            clearable
-            placeholder="请选择 承揽人"
-          >
-            <el-option
-              v-for="(item, index) in oppositePersonOption"
+              v-for="(item, index) in userOption"
               :key="index"
               :value="item.realName"
               :label="item.realName"
@@ -118,17 +103,27 @@ export default {
       loading: false,
       selection: [],
       detailData: {},
-      contractorOption: [],
-      oppositePersonOption: [],
+      userOption: [],
     }
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(103), option);
     gainUser().then(res => {
-      this.contractorOption = res.data.data;
-      this.oppositePersonOption = res.data.data;
+      this.userOption = res.data.data;
     })
   },
+  activated() {
+    if (this.$route.query.check) {
+      this.show = true
+      this.detailData = {
+        id: this.$route.query.check.billId,
+        check: this.$route.query.check,
+        auditId: this.$route.query.check.id,
+      };
+      this.show = false;
+      this.$store.commit("JJD_IN_DETAIL");
+    }
+  },
   methods: {
     searchCriteriaSwitch(type) {
       // if (type){
@@ -140,6 +135,7 @@ export default {
     },
     newAdd() {
       this.show = false;
+      this.$store.commit("JJD_IN_DETAIL");
     },
     onLoad(page, params) {
       // 重置掉展开
@@ -210,10 +206,10 @@ export default {
       this.selection = list;
     },
     goBack() {
-      if (this.$route.query.id) {
+      if (this.$route.query) {
         this.$router.$avueRouter.closeTag(this.$route.fullPath);
         this.$router.push({
-          path: "/dealer/sales/index"
+          path: "/workManagement/handoverSheet/index"
         });
       }
       this.detailData = this.$options.data().detailData;
@@ -228,16 +224,34 @@ export default {
       };
       this.$nextTick(() => {
         this.show = false;
+        this.$store.commit("JJD_IN_DETAIL");
       });
     },
-    contractorRemoteMethod(name) {
-      gainUser({realName: name}).then(res => {
-        this.contractorOption = res.data.data;
-      })
+    // 详情打开
+    beforeOpenPage(row, index) {
+      this.show = false;
+      this.detailData = {
+        id: row.id,
+        query: true, // 表示只是查询
+      };
+      this.$store.commit("JJD_IN_DETAIL");
     },
-    oppositePersonRemoteMethod(name) {
-      gainUser({realName: name}).then(res => {
-        this.oppositePerson = res.data.data;
+    //删除列表后面的删除按钮触发触发(row, index, done)
+    rowDel(row, index, done) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(res => {
+        // return deleteList(row.id)
+      }).then(() => {
+        this.dataList.splice(row.$index, 1)
+        this.$message({
+          type: "success",
+          message: "删除成功!"
+        });
+        this.page.currentPage = 1;
+        this.onLoad(this.page)
       })
     },
   },

+ 11 - 6
src/views/workManagement/requisition/detail.vue

@@ -175,7 +175,7 @@
                   v-for="item in goodsoptions"
                   :key="item.id"
                   :label="item.cname"
-                  :value="item.id"
+                  :value="item.goodsId"
                 >
                 </el-option>
               </el-select>
@@ -548,7 +548,12 @@ export default {
       this.getColumnName(93),
       goodsOption
     );
-    getGoods(1, 10).then(res => {
+    //getStockList
+
+    getStockList({
+      size: 10,
+      current: 1,
+      tradeType: 'BGYP'}).then(res => {
       if (res.data.data.total > 0) {
         this.goodsoptions = res.data.data.records;
         if (Math.ceil(res.data.data.total / 10) > 1) {
@@ -731,28 +736,28 @@ export default {
     codeChange(row) {
       this.goodsoptions.forEach(async e => {
         if (e.code == row.code) {
-          row.itemId = e.id;
+          row.itemId = e.goodsId;
           row.cname = e.cname;
           row.code = e.code;
           row.corpId = e.corpId;
           row.corpName = e.corpName;
           row.unit = e.unit;
           row.priceCategory = e.goodsTypeName;
-          row.price = e.price;
+          row.price = e.unitPrice;
         }
       });
     },
     cnameChange(row) {
       let form = {};
       this.goodsoptions.forEach(async e => {
-        if (e.id == row.itemId) {
+        if (e.goodsId == row.itemId) {
           row.cname = e.cname;
           row.code = e.code;
           row.corpId = e.corpId;
           row.corpName = e.corpName;
           row.unit = e.unit;
           row.priceCategory = e.goodsTypeName;
-          row.price = e.price;
+          row.price = e.unitPrice;
         }
       });
     },