QuKatie 3 年之前
父節點
當前提交
efcdf542bf

+ 123 - 0
src/api/maintenance/priceLibrary.js

@@ -0,0 +1,123 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/blade-mocha-item/pricebank/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+export function detail(id) {
+  return request({
+    url: '/api/blade-mocha-item/pricebank/detail?id=' + id,
+    method: 'get'
+  })
+}
+//修改和新增
+export function submit(data) {
+  return request({
+    url: '/api/blade-mocha-item/pricebank/submit',
+    method: 'post',
+    data: data
+  })
+}
+//明细表删除
+export function delItem(data) {
+  return request({
+    url: '/api/blade-purchase-sales/orderitems/update',
+    method: 'post',
+    data: {
+      id: data
+    }
+  })
+}
+//主表删除
+export function remove(data) {
+  return request({
+    url: '/api/blade-mocha-item/pricebank/remove',
+    method: 'post',
+    params: {
+      ids: data
+    }
+  })
+}
+//获取商品
+export const getGoods = (current, size, goodsTypeId, params) => {
+  return request({
+    url: '/api/blade-client/goodsdesc/selectGoods',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+      goodsTypeId,
+    }
+  })
+}
+//树形
+export const getDeptLazyTree = (parentId) => {
+  return request({
+    url: '/api/blade-client/goodstype/lazy-tree',
+    method: 'get',
+    params: {
+      parentId
+    }
+  })
+}
+//生成采购询价单
+export function savePurchase(data) {
+  return request({
+    url: '/api/trade-purchase/purchase-enquiry/savePurchaseEnquiry',
+    method: 'post',
+    data: {
+      id: data
+    }
+  })
+}
+//生成船务询价单
+export function saveShipping(data) {
+  return request({
+    url: '/api/trade-purchase/shipping-enquiry/update',
+    method: 'post',
+    data: {
+      id: data
+    }
+  })
+}
+//港口资料
+export function getPorts() {
+  return request({
+    url: '/api/blade-client/port/listPort',
+    method: 'get',
+  })
+}
+//规格
+export function getSpecification(query) {
+  return request({
+    url: '/api/blade-client/client/get_Specification',
+    method: 'get',
+    params: query
+  })
+}
+//生成销售单
+export function saveSell(data) {
+  return request({
+    url: '/api/blade-purchase-sales/exportEnquiry/createMarket',
+    method: 'post',
+    data: {
+      id: data
+    }
+  })
+}
+//生成销售单
+export function gainUser(query) {
+  return request({
+    url: '/api/blade-user/client/gainUser',
+    method: 'get',
+    params: query
+  })
+}

+ 4 - 2
src/enums/column-name.js

@@ -140,9 +140,11 @@ const columnName = [{
 {
   code: 46,
   name: '申请费用列表'
+},
+{
+  code: 47,
+  name: '出口价格库列表'
 }
-
-
 ]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {

+ 1 - 1
src/views/exportTrade/customerInquiry/config/customerContact.json

@@ -29,7 +29,7 @@
       "label": "产品名称",
       "prop": "cname",
       "index": 3,
-      "width": 100,
+      "width": 200,
       "overHidden": true
     },
     {

+ 44 - 5
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -182,15 +182,38 @@
             <span v-else>{{ row.itemType }}</span>
           </template>
           <template slot="cname" slot-scope="{ row, index }">
-            <el-button
+            <!-- <el-button
               size="small"
               type="text"
               @click="rePick(row, index)"
               :disabled="disabled"
               style="padding:4px 10px;float:left"
               >选择</el-button
-            >
-            <span> {{ row.cname }}</span>
+            > -->
+            <span v-if="row.$cellEdit" style="display:flex">
+              <el-select
+                v-model="row.cname"
+                placeholder="请选择"
+                size="small"
+                style="width:60%"
+                @change="cnameChange(row, index)"
+              >
+                <el-option
+                  v-for="item in goodsoptions"
+                  :key="item.id"
+                  :label="item.cname"
+                  :value="item.cname"
+                >
+                </el-option>
+              </el-select>
+              <el-button
+                icon="el-icon-search"
+                size="small"
+                @click="rePick(row, index)"
+              ></el-button>
+            </span>
+
+            <span v-else> {{ row.cname }}</span>
           </template>
           <template slot="partsList" slot-scope="{ row, index }">
             <el-button
@@ -692,7 +715,8 @@ export default {
       showBut: true,
       partreData: null,
       partType: false,
-      partList: []
+      partList: [],
+      goodsoptions: []
     };
   },
   props: {
@@ -733,6 +757,9 @@ export default {
       this.findObject(this.option.column, "portOfDestination").dicData =
         res.data;
     });
+    getGoods().then(res => {
+      this.goodsoptions = res.data.data.records;
+    });
   },
   filters: {
     isDiscount(val) {
@@ -746,6 +773,18 @@ export default {
     }
   },
   methods: {
+    cnameChange(row) {
+      this.goodsoptions.forEach(e => {
+        if (e.cname == row.cname) {
+          row.itemId = e.id;
+          row.code = e.code;
+          row.priceCategory = e.goodsTypeName;
+          row.itemUrl = e.url;
+          row.itemDescription = e.cnameDescription;
+          row.unit = e.unit;
+        }
+      });
+    },
     partReData(row) {
       this.partreData = row;
       this.partOpen();
@@ -789,7 +828,7 @@ export default {
     },
     partClosed() {
       this.partList = [];
-      this.partreData=null;
+      this.partreData = null;
     },
     getcorpId(row) {
       this.data[row.index].corpId = row.id;

+ 1 - 1
src/views/exportTrade/salesContract/config/customerContact.json

@@ -31,7 +31,7 @@
       "label": "产品名称",
       "prop": "cname",
       "index": 3,
-      "width": 100,
+      "width": 200,
       "overHidden": true
     },
     {

+ 44 - 11
src/views/exportTrade/salesContract/detailsPage.vue

@@ -122,16 +122,29 @@
             :summary-method="summaryMethod"
           >
             <template slot="cname" slot-scope="{ row, index }">
-              <el-button
-                size="small"
-                type="text"
-                @click="rePick(row, index)"
-                :disabled="disabled"
-                class="picker"
-                style="padding:4px 10px;float:left"
-                >选择</el-button
-              >
-              <span> {{ row.cname }}</span>
+              <span v-if="row.$cellEdit" style="display:flex">
+                <el-select
+                  v-model="row.cname"
+                  placeholder="请选择"
+                  size="small"
+                  style="width:60%"
+                  @change="cnameChange(row, index)"
+                >
+                  <el-option
+                    v-for="item in goodsoptions"
+                    :key="item.id"
+                    :label="item.cname"
+                    :value="item.cname"
+                  >
+                  </el-option>
+                </el-select>
+                <el-button
+                  icon="el-icon-search"
+                  size="small"
+                  @click="rePick(row, index)"
+                ></el-button>
+              </span>
+              <span v-else> {{ row.cname }}</span>
             </template>
             <template slot="partsList" slot-scope="{ row, index }">
               <el-button
@@ -768,7 +781,8 @@ export default {
       showBut: true,
       partreData: null,
       partType: false,
-      partList: []
+      partList: [],
+      goodsoptions: []
     };
   },
   props: {
@@ -832,8 +846,23 @@ export default {
     this.getWorkDicts("unit").then(res => {
       this.findObject(this.tableOption.column, "unit").dicData = res.data.data;
     });
+    getGoods().then(res => {
+      this.goodsoptions = res.data.data.records;
+    });
   },
   methods: {
+    cnameChange(row) {
+      this.goodsoptions.forEach(e => {
+        if (e.cname == row.cname) {
+          row.itemId = e.id;
+          row.code = e.code;
+          row.priceCategory = e.goodsTypeName;
+          row.itemUrl = e.url;
+          row.itemDescription = e.cnameDescription;
+          row.unit = e.unit;
+        }
+      });
+    },
     partReData(row) {
       this.partreData = row;
       this.partOpen();
@@ -1040,6 +1069,8 @@ export default {
                 item.code = e.code;
                 item.cname = e.cname;
                 item.priceCategory = e.goodsTypeName;
+                item.partsList = this.reData.partsList;
+                item.partsPrice = this.reData.partsPrice;
                 item.itemUrl = e.url;
                 item.itemProp = this.reData.itemProp;
                 item.itemDescription = e.cnameDescription;
@@ -1069,6 +1100,8 @@ export default {
             itemUrl: e.url,
             itemProp: null,
             itemDescription: e.cnameDescription,
+            partsList: [],
+            partsPrice: 0,
             itemType: null,
             tradeTerms: null,
             price: 0,

+ 136 - 0
src/views/maintenance/priceLibrary/config/commodity.json

@@ -0,0 +1,136 @@
+
+{
+  "calcHeight": 80,
+  "tip": false,
+  "addBtn": false,
+  "searchShow": false,
+  "searchShowBtn": false,
+  "menu": false,
+  "searchMenuSpan": 6,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "viewBtn": true,
+  "dialogClickModal": false,
+  "column": [
+    {
+      "label": "商品编码",
+      "prop": "code",
+      "search": true,
+      "width": 100,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "商品名称",
+      "prop": "cname",
+      "slot": true,
+      "width": 100,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "商品类别",
+      "prop": "goodsTypeId",
+      "dicData": [],
+      "type": "tree",
+      "hide": true,
+      "addDisabled": false,
+      "multiple": true,
+      "width": 100,
+      "props": {
+        "label": "title"
+      },
+      "rules": [{
+        "required": true,
+        "message": " ",
+        "trigger": "click"
+      }]
+    },
+    {
+      "label": "规格编码",
+      "prop": "typeno",
+      "search": true,
+      "width": 100
+    },
+    {
+      "label": "品牌",
+      "prop": "brand",
+      "slot": true,
+      "width": 100
+    },
+    {
+      "label": "花纹",
+      "prop": "brandItem",
+      "slot": true,
+      "width": 100
+    },
+    {
+      "label": "规格尺寸",
+      "prop": "specs",
+      "slot": true,
+      "width": 100
+    },
+    {
+      "label": "产品类别",
+      "prop": "category",
+      "slot": true,
+      "width": 100
+    },
+    {
+      "label": "产品分类",
+      "prop": "categoryitem",
+      "slot": true,
+      "width": 100
+    },
+    {
+      "label": "供应商",
+      "prop": "providers",
+      "slot": true,
+      "width": 100
+    },
+    {
+      "label": "计量单位",
+      "prop": "unit",
+      "slot": true,
+      "width": 100
+    },
+    {
+      "label": "包装单位",
+      "prop": "packgeunit",
+      "slot": true,
+      "width": 100
+    },
+    {
+      "label": "商品图片",
+      "prop": "url",
+      "type": "upload",
+      "listType": "picture-img",
+      "dataType": "string",
+      "action": "/api/blade-resource/oss/endpoint/put-file",
+      "propsHttp": {
+        "res": "data",
+        "url": "link"
+      },
+      "hide": true,
+      "span": 24,
+      "width": 100
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "slot": true,
+      "width": 100
+    }
+  ]
+}

+ 178 - 0
src/views/maintenance/priceLibrary/config/customerContact.json

@@ -0,0 +1,178 @@
+{
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "addBtn": false,
+  "delBtn": false,
+  "align": "center",
+  "menuWidth": 150,
+  "refreshBtn": false,
+  "showSummary": true,
+  "column": [{
+      "label": "产品类别",
+      "prop": "priceCategory",
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "产品编号",
+      "prop": "code",
+      "index": 2,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "产品名称",
+      "prop": "cname",
+      "index": 3,
+      "width": 200,
+      "overHidden": true
+    },
+    {
+      "label": "产品属性",
+      "prop": "itemProp",
+      "index": 4,
+      "width": 100,
+      "overHidden": true,
+      "cell": true,
+      "type": "select",
+      "dicData": [],
+      "props": {
+        "label": "dictValue",
+        "value": "dictKey"
+      }
+    },
+    {
+      "label": "产品描述",
+      "prop": "itemDescription",
+      "index": 5,
+      "width": 100,
+      "overHidden": true,
+      "cell": true
+    },
+    {
+      "label": "产品型号",
+      "prop": "itemType",
+      "index": 6,
+      "width": 100
+    },
+    {
+      "label": "采购单价",
+      "prop": "purchaseAmount",
+      "index": 7,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "配件信息",
+      "prop": "partsList",
+      "index": 7,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "配件价格",
+      "prop": "partsPrice",
+      "index": 7,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "供应商",
+      "prop": "corpId",
+      "index": 8,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "重点推荐",
+      "prop": "priorityReferrer",
+      "index": 9,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "推荐理由",
+      "prop": "referrerReason",
+      "index": 10,
+      "width": 100,
+      "overHidden": true,
+      "cell": true
+    },
+    {
+      "label": "销售价",
+      "prop": "price",
+      "index": 11,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "计价单位",
+      "prop": "unit",
+      "index": 12,
+      "width": 100,
+      "overHidden": true,
+      "cell": true,
+      "type": "select",
+      "dicData": [],
+      "props": {
+        "label": "dictValue",
+        "value": "dictValue"
+      }
+    },
+    {
+      "label": "数量",
+      "prop": "orderQuantity",
+      "index": 13,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "保险",
+      "prop": "insurance",
+      "index": 14,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "运费",
+      "prop": "freight",
+      "index": 15,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "折扣",
+      "prop": "discount",
+      "index": 16,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "金额",
+      "prop": "amount",
+      "index": 17,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "税率",
+      "prop": "taxRate",
+      "index": 18,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "index": 19,
+      "width": 100,
+      "overHidden": true,
+      "cell": true
+    }
+  ]
+}

+ 141 - 0
src/views/maintenance/priceLibrary/config/mainList.json

@@ -0,0 +1,141 @@
+{
+  "searchShow": true,
+  "searchMenuSpan": 24,
+  "border": true,
+  "index": true,
+  "viewBtn": false,
+  "editBtn": false,
+  "delBtn": false,
+  "addBtn": false,
+  "align": "center",
+  "menuWidth": "180",
+  "showSummary": true,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "column": [{
+      "label": "商品名称",
+      "prop": "cname",
+      "search": true,
+      "index": 1,
+      "width": 100,
+      "overHidden": true,
+      "searchSpan": 8
+    },
+    {
+      "label": "规格",
+      "prop": "specs",
+      "search": true,
+      "searchSpan": 8,
+      "index": 2,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "产品属性",
+      "prop": "goodNature",
+      "index": 3,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "供应商",
+      "prop": "corpId",
+      "search": true,
+      "searchSpan": 8,
+      "index": 4,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "币别",
+      "prop": "currency",
+      "index": 5,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "FOB系数",
+      "prop": "coefficient",
+      "index": 6,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "最新价格",
+      "prop": "price",
+      "index": 7,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格1",
+      "prop": "priceOne",
+      "index": 8,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格1日期",
+      "prop": "priceOneTime",
+      "index": 9,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格2",
+      "prop": "priceTwo",
+      "index": 10,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格2日期",
+      "prop": "priceTwoTime",
+      "index": 11,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格3",
+      "prop": "priceThree",
+      "index": 12,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "历史价格3日期",
+      "prop": "priceThreeTime",
+      "index": 13,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "index": 14,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "有效期开始",
+      "prop": "startTime",
+      "index": 15,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "有效期结束",
+      "prop": "endTime",
+      "index": 16,
+      "width": 100,
+      "overHidden": true
+    },
+    {
+      "label": "业务员",
+      "prop": "person",
+      "index": 17,
+      "width": 100,
+      "overHidden": true
+    }
+  ]
+}

+ 424 - 0
src/views/maintenance/priceLibrary/detailsPage.vue

@@ -0,0 +1,424 @@
+<template>
+  <div class="borderless" v-loading="pageLoading">
+    <div class="customer-head">
+      <div class="customer-back">
+        <!--        <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
+        <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" v-if="showBut">
+        <el-button
+          type="primary"
+          :disabled="disabled"
+          @click="editCustomer"
+          :loading="subLoading"
+          v-if="detailData.status != 1"
+          >{{ form.id ? "确认修改" : "确认新增" }}
+        </el-button>
+      </div>
+    </div>
+    <div style="margin-top: 60px;margin-bottom:35px">
+      <containerTitle title="基础信息"></containerTitle>
+      <basic-container style="margin-bottom: 10px">
+        <avue-form ref="form" v-model="form" :option="option">
+          <template slot="corpId">
+            <select-component
+              v-model="form.corpId"
+              :configuration="configuration"
+              :disabled="detailData.status == 1"
+            ></select-component>
+          </template>
+          <template slot="cname">
+            <goods-select
+              v-model="form.cname"
+              :configuration="goodsConfiguration"
+              @getRow="getGoodsRow"
+              @returnRow="returnRow"
+              :disabled="detailData.status == 1"
+            />
+          </template>
+        </avue-form>
+      </basic-container>
+    </div>
+  </div>
+</template>
+
+<script>
+import { detail, submit } from "@/api/maintenance/priceLibrary";
+import { contrastObj } from "@/util/contrastData";
+import _ from "lodash";
+export default {
+  name: "detailsPageEdit",
+  data() {
+    return {
+      goodsConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: [],
+        clearable: true
+      },
+      configuration: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: []
+      },
+      form: {},
+      option: {
+        menuBtn: false,
+        labelWidth: 100,
+        column: [
+          {
+            label: "商品名称",
+            prop: "cname",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 8
+          },
+          {
+            label: "规格",
+            prop: "specs",
+            disabled: true,
+            span: 8
+          },
+          {
+            label: "产品属性",
+            prop: "goodNature",
+            span: 8
+          },
+          {
+            label: "供应商",
+            prop: "corpId",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 8
+          },
+          {
+            label: "币别",
+            prop: "currency",
+            type: "select",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+            props: {
+              label: "dictValue",
+              value: "dictValue"
+            },
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 8
+          },
+          {
+            label: "FOB系数",
+            prop: "coefficient",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 8
+          },
+          {
+            label: "价格类型",
+            prop: "billType",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            type: "select",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=billType",
+            props: {
+              label: "dictValue",
+              value: "dictKey"
+            },
+            span: 8
+          },
+
+          {
+            label: "最新价格",
+            prop: "price",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 8,
+            row: true
+          },
+          {
+            label: "有效期开始",
+            prop: "startTime",
+            type: "datetime",
+            format: "yyyy-MM-dd hh:mm:ss",
+            valueFormat: "yyyy-MM-dd hh:mm:ss",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 8
+          },
+          {
+            label: "有效期结束",
+            prop: "endTime",
+            type: "datetime",
+            format: "yyyy-MM-dd hh:mm:ss",
+            valueFormat: "yyyy-MM-dd hh:mm:ss",
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ],
+            span: 8
+          },
+          {
+            label: "业务员",
+            prop: "person",
+            span: 8,
+            row: true
+          },
+          {
+            label: "历史价格1",
+            prop: "priceOne",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "历史日期1",
+            prop: "priceOneTime",
+            type: "datetime",
+            format: "yyyy-MM-dd hh:mm:ss",
+            valueFormat: "yyyy-MM-dd hh:mm:ss",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "历史价格2",
+            prop: "priceTwo",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "历史日期2",
+            prop: "priceTwoTime",
+            type: "datetime",
+            format: "yyyy-MM-dd hh:mm:ss",
+            valueFormat: "yyyy-MM-dd hh:mm:ss",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "历史价格3",
+            prop: "priceThree",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "历史日期3",
+            prop: "priceThreeTime",
+            type: "datetime",
+            format: "yyyy-MM-dd hh:mm:ss",
+            valueFormat: "yyyy-MM-dd hh:mm:ss",
+            span: 8,
+            disabled: true
+          },
+          {
+            label: "备注",
+            prop: "remarks",
+            type: "textarea",
+            minRows: 2,
+            span: 24
+          }
+        ]
+      },
+      oldform: {},
+      loading: false,
+      subLoading: false,
+      pageLoading: false,
+      showBut: true
+    };
+  },
+  props: {
+    detailData: {
+      type: Object
+    }
+  },
+  created() {
+    if (this.detailData.id) {
+      this.getDetail(this.detailData.id);
+    }
+    if (this.detailData.status == 1) {
+      this.option.disabled = true;
+    }
+  },
+  filters: {},
+  methods: {
+    getDetail(id) {
+      this.loading = true;
+      this.showBut = false;
+      this.pageLoading = true;
+      detail(id)
+        .then(res => {
+          this.form = res.data.data;
+          this.oldform = res.data.data;
+        })
+        .finally(() => {
+          this.loading = false;
+          this.showBut = true;
+          this.pageLoading = false;
+        });
+    },
+    //修改提交触发
+    editCustomer(status) {
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          this.subLoading = true;
+          this.form.tradeType="CK"
+          this.configuration.dicData.forEach(e=>{
+            if(this.form.corpId==e.id){
+              this.form.corpName=e.cname
+            }
+          })
+          submit({
+            ...this.form
+          })
+            .then(res => {
+              if (res.data.code == 200) {
+                this.$message.success(this.form.id ? "修改成功" : "提交成功");
+                this.form = res.data.data;
+                this.oldform = res.data.data;
+                if (status == "goBack") {
+                  this.$emit("goBack");
+                }
+              }
+            })
+            .finally(() => {
+              this.subLoading = false;
+            });
+        } else {
+          return false;
+        }
+      });
+    },
+    //返回列表
+    backToList() {
+      if (contrastObj(this.form, this.oldform)) {
+        this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            this.editCustomer("goBack");
+          })
+          .catch(() => {
+            this.$emit("goBack");
+          });
+      } else {
+        this.$emit("goBack");
+      }
+    },
+    openReport() {
+      this.switchDialog = !this.switchDialog;
+    },
+    onClose(val) {
+      this.switchDialog = val;
+    },
+    getGoodsRow(row) {
+      this.form.itemId = row.id;
+      this.form.code = row.code;
+      this.form.specs = row.specs;
+    },
+    returnRow(rows) {
+      this.form.itemId = rows[0].id;
+      this.form.code = rows[0].code;
+      this.form.specs = rows[0].specs;
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.customer-head {
+  position: fixed;
+  top: 105px;
+  width: 100%;
+  margin-left: -10px;
+  height: 62px;
+  background: #ffffff;
+  box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
+  z-index: 999;
+}
+
+.customer-back {
+  cursor: pointer;
+  line-height: 62px;
+  font-size: 16px;
+  color: #323233;
+  font-weight: 400;
+}
+
+.back-icon {
+  line-height: 64px;
+  font-size: 20px;
+  margin-right: 8px;
+}
+.sell-customer-btn {
+  position: fixed;
+  right: 244px;
+  top: 115px;
+}
+.copy-customer-btn {
+  position: fixed;
+  right: 140px;
+  top: 115px;
+}
+
+.add-customer-btn {
+  position: fixed;
+  right: 36px;
+  top: 115px;
+}
+::v-deep .el-form-item {
+  margin-bottom: 8px;
+}
+::v-deep .el-form-item__error {
+  display: none;
+}
+::v-deep .select-component {
+  display: flex;
+}
+</style>

+ 295 - 0
src/views/maintenance/priceLibrary/index.vue

@@ -0,0 +1,295 @@
+<template>
+  <div>
+    <basic-container v-if="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"
+        :cell-style="cellStyle"
+        :summary-method="summaryMethod"
+      >
+        <template slot="menuLeft">
+          <el-button
+            type="primary"
+            icon="el-icon-plus"
+            size="small"
+            @click.stop="newAdd()"
+            >新单</el-button
+          >
+          <el-button type="info" size="small">报表</el-button>
+        </template>
+        <template slot="cnameSearch">
+          <goods-select 
+          v-model="search.cname"
+          :configuration="goodsConfiguration"
+          />
+        </template>
+        <template slot="corpIdSearch">
+          <select-component
+            v-model="search.corpId"
+            :configuration="configuration"
+          ></select-component>
+        </template>
+        <template slot-scope="scope" slot="corpId">
+          {{ scope.row.corpName }}
+        </template>
+        <template slot-scope="scope" slot="grossProfitRate">
+          {{ scope.row.grossProfitRate ? scope.row.grossProfitRate : 0 }}%
+        </template>
+        <template slot-scope="scope" slot="menu">
+          <el-button
+            type="text"
+            icon="el-icon-view"
+            size="small"
+            @click.stop="beforeOpenPage(scope.row, 1)"
+            >查看
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-edit"
+            size="small"
+            @click.stop="editOpen(scope.row, 2)"
+            >编辑
+          </el-button>
+          <el-button
+            type="text"
+            icon="el-icon-delete"
+            size="small"
+            @click.stop="rowDel(scope.row, scope.index)"
+            >删除
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detail-page @goBack="goBack" :detailData="detailData" v-else></detail-page>
+  </div>
+</template>
+
+<script>
+import option from "./config/mainList.json";
+import { getList, remove} from "@/api/maintenance/priceLibrary";
+import detailPage from "./detailsPage.vue";
+import { defaultDate } from "@/util/date";
+import { micrometerFormat } from "@/util/validate";
+import _ from "lodash";
+export default {
+  name: "customerInformation",
+  data() {
+    return {
+      goodsConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: [],
+        clearable: true
+      },
+      configuration: {
+        multipleChoices: false,
+        multiple: false,
+        collapseTags: false,
+        placeholder: "请点击右边按钮选择",
+        dicData: [],
+        clearable: true
+      },
+      search: {
+        businesDate: defaultDate()
+      },
+      form: {},
+      option: {},
+      parentId: 0,
+      dataList: [],
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      show: true,
+      detailData: {},
+      loading: false
+    };
+  },
+  components: { detailPage },
+  async created() {
+    /**
+     * 已定义全局方法,直接使用,getColumnData获取列数据,参数传值(表格名称,引入的本地JSON的数据定义的名称)
+     * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+     * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+     */
+    this.option = await this.getColumnData(this.getColumnName(47), option);
+    let _this = this;
+    this.option.column.forEach(e => {
+      if (e.prop == "exchangeRate") {
+        e.formatter = function(row) {
+          return _this.textFormat(
+            Number(row.exchangeRate ? row.exchangeRate : 0) / 100,
+            "0.00%"
+          );
+        };
+      }
+      if (e.prop == "creditAmount") {
+        e.formatter = function(row) {
+          return _this.textFormat(
+            Number(row.creditAmount ? row.creditAmount : 0),
+            "#,##0.00"
+          );
+        };
+      }
+    });
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    //删除列表后面的删除按钮触发触发(row, index, done)
+    rowDel(row, index, done) {
+      this.$confirm("确定删除数据?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        remove(row.id).then(res => {
+          if (res.data.code == 200) {
+            this.$message({
+              type: "success",
+              message: "删除成功!"
+            });
+            this.onLoad(this.page, this.search);
+          }
+        });
+      });
+    },
+    //查看跳转页面
+    beforeOpenPage(row, status) {
+      this.detailData = {
+        id: row.id,
+        status: status
+      };
+      this.show = false;
+    },
+    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) {
+      params={
+        ...params,
+        tradeType:"CK"
+      }
+      this.loading = true;
+      getList(page.currentPage, page.pageSize, params)
+        .then(res => {
+          this.dataList = res.data.data.records ? res.data.data.records : [];
+          this.page.total = res.data.data.total;
+          if (this.page.total) {
+            this.option.height = window.innerHeight - 450;
+          }
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    summaryMethod({ columns, data }) {
+      const sums = [];
+      if (columns.length > 0) {
+        columns.forEach((item, index) => {
+          sums[0] = "合计";
+          if (
+            item.property == "orderQuantity" ||
+            item.property == "amount" ||
+            item.property == "purchaseAmount"
+          ) {
+            let qtySum = 0;
+            let instoreSum = 0;
+            let totalSum = 0;
+            data.forEach(e => {
+              qtySum = _.add(qtySum, Number(e.orderQuantity));
+              instoreSum = _.add(instoreSum, Number(e.amount));
+              totalSum = _.add(totalSum, Number(e.purchaseAmount));
+            });
+            //数量总计
+            if (item.property == "orderQuantity") {
+              sums[index] = qtySum ? qtySum.toFixed(2) : "0.00";
+            }
+            //入库金额总计
+            if (item.property == "amount") {
+              sums[index] = micrometerFormat(instoreSum);
+            }
+            //金额总计
+            if (item.property == "purchaseAmount") {
+              sums[index] = micrometerFormat(totalSum);
+            }
+          }
+        });
+      }
+      return sums;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    newAdd() {
+      this.show = false;
+    },
+    goBack() {
+      this.detailData = this.$options.data().detailData;
+      this.show = true;
+    },
+    async saveColumn() {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(
+        this.getColumnName(47),
+        this.option
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    }
+  },
+  watch: {
+    option: function() {
+      this.search.businesDate = defaultDate();
+    }
+  }
+};
+</script>
+
+<style scoped>
+::v-deep .select-component {
+  display: flex;
+}
+.page-crad ::v-deep .basic-container__card {
+  height: 86.5vh;
+}
+</style>