Browse Source

修改bug

qukaidi 3 years ago
parent
commit
26473c6a8f

+ 2 - 4
src/views/exportTrade/customerInquiry/config/customerContact.json

@@ -38,8 +38,7 @@
       "prop": "ename",
       "index": 4,
       "width": 200,
-      "overHidden": true,
-      "cell": true
+      "overHidden": true
     },
     {
       "label": "产品属性",
@@ -53,8 +52,7 @@
       "prop": "itemDescription",
       "index": 6,
       "width": 100,
-      "overHidden": true,
-      "cell": true
+      "overHidden": true
     },
     {
       "label": "产品型号",

+ 145 - 32
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -109,21 +109,45 @@
       </trade-card>
       <trade-card title="商品信息">
         <avue-crud ref="crud" :data="data" :option="tableOption" @row-del="rowDel" :summary-method="summaryMethod"
-          @saveColumn="saveColumn" @resetColumn="resetColumn" :cell-style="cellStyle">
+          @saveColumn="saveColumn" @resetColumn="resetColumn" :cell-style="cellStyle" @row-dblclick="handleRowDBLClick">
           <template slot="headerSerial">
             <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
               :disabled="detailData.status == 1" circle></el-button>
           </template>
           <template slot="menuLeft">
-            <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newDetails"
-              :disabled="detailData.status == 1">批量录入</el-button>
-            <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addLibrary"
-              :disabled="detailData.status == 1">出口价格库</el-button>
-            <el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印</el-button>
-            <el-button type="info" size="small" @click.stop="savePurchase" :disabled="detailData.status == 1">采购询价
-            </el-button>
-            <el-button type="info" size="small" @click.stop="saveShipping" :disabled="detailData.status == 1">船务询价
-            </el-button>
+            <el-row>
+              <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newDetails"
+                :disabled="detailData.status == 1">批量录入</el-button>
+              <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addLibrary"
+                :disabled="detailData.status == 1">出口价格库</el-button>
+              <el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印</el-button>
+              <el-button type="info" size="small" @click.stop="savePurchase" :disabled="detailData.status == 1">采购询价
+              </el-button>
+              <el-button type="info" size="small" @click.stop="saveShipping" :disabled="detailData.status == 1">船务询价
+              </el-button>
+              <el-button v-if="goodsEditShow" size="small" type="primary" @click="handleSave">保存明细</el-button>
+              <el-button v-if="goodsEditShow" size="small" @click="handleClose">关闭明细</el-button>
+            </el-row>
+            <el-row>
+              <avue-form v-if="goodsEditShow" class="trading-form" v-model="goodsEditForm" :option="goodsEditOption">
+                <template slot="ename">
+                  <el-input type="textarea" size="small" v-model="goodsEditForm.ename" placeholder="请输入"
+                    @change="formEditChange(goodsEditForm)" />
+                </template>
+                <template slot="itemProp">
+                  <el-input type="textarea" size="small" v-model="goodsEditForm.itemProp" placeholder="请输入"
+                    @change="formEditChange(goodsEditForm)" />
+                </template>
+                <template slot="itemDescription">
+                  <el-input type="textarea" size="small" v-model="goodsEditForm.itemDescription" placeholder="请输入"
+                    @change="formEditChange(goodsEditForm)" />
+                </template>
+                <template slot="partsDescribe">
+                  <el-input type="textarea" size="small" v-model="goodsEditForm.partsDescribe" placeholder="请输入"
+                    @change="formEditChange(goodsEditForm)" />
+                </template>
+              </avue-form>
+            </el-row>
           </template>
           <template slot="menu" slot-scope="{ row, index }">
             <div style="display:flex;justify-content: center;">
@@ -131,7 +155,8 @@
                 :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 style="display:flex;flex-direction: column;justify-content: center;margin-left: 10px;">
+              <div v-if="!goodsEditShow"
+                style="display:flex;flex-direction: column;justify-content: center;margin-left: 10px;">
                 <el-tooltip effect="dark" content="向上移动" placement="top">
                   <i v-if="index != 0" :disabled="detailData.status == 1" class="el-icon-arrow-up"
                     @click="moveUp(row, index)" style="color:#409EFF;"></i>
@@ -150,13 +175,25 @@
             </el-select>
             <span v-else>{{ row.itemType }}</span>
           </template>
+          <template slot="ename" slot-scope="{ row, index }">
+            <el-input v-if="row.$cellEdit" v-model="row.ename" size="small" placeholder="请点击右边按钮"
+              @change="editChange(row)"></el-input>
+            <span v-else>{{ row.ename }}</span>
+          </template>
           <template slot="itemProp" slot-scope="{ row, index }">
             <span v-if="row.$cellEdit" style="display:flex">
-              <el-input v-model="row.itemProp" size="small" placeholder="请点击右边按钮"></el-input>
+              <el-input v-model="row.itemProp" size="small" placeholder="请点击右边按钮" @change="editChange(row)"></el-input>
               <el-button icon="el-icon-edit" size="mini" @click="openProperty(row, index)"></el-button>
             </span>
             <span v-else>{{ row.itemProp }}</span>
           </template>
+          <template slot="itemDescription" slot-scope="{ row, index }">
+            <span v-if="row.$cellEdit" style="display:flex">
+              <el-input v-model="row.itemDescription" size="small" placeholder="请输入" @change="editChange(row)">
+              </el-input>
+            </span>
+            <span v-else>{{ row.itemDescription }}</span>
+          </template>
           <template slot="cname" slot-scope="{ row, index }">
             <span v-if="row.$cellEdit" style="display:flex">
               <el-select v-model="row.itemId" placeholder="请选择" size="small" style="width:60%"
@@ -166,12 +203,12 @@
               </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="partsDescribe" slot-scope="{ row, index }">
             <span v-if="row.$cellEdit" style="display:flex">
-              <el-input v-model="row.partsDescribe" size="small" placeholder="请点击右边按钮"></el-input>
+              <el-input v-model="row.partsDescribe" size="small" placeholder="请点击右边按钮" @change="editChange(row)">
+              </el-input>
               <el-button icon="el-icon-edit" size="mini" @click="partrePick(row, index)"></el-button>
             </span>
             <span v-else>{{ row.partsDescribe }}</span>
@@ -333,6 +370,7 @@ export default {
   name: "detailsPageEdit",
   data() {
     return {
+      goodsEditForm: {},
       show: true,
       oldExchange: null,
       treeStyle: "height:" + (window.innerHeight - 315) + "px",
@@ -628,6 +666,49 @@ export default {
           }
         ]
       },
+      goodsEditShow: false,
+      goodsEditOption: {
+        emptyBtn: false,
+        submitBtn: false,
+        labelWidth: 100,
+        column: [
+          {
+            label: "英文名称",
+            prop: "ename",
+            type: "textarea",
+            minRows: 2,
+            span: 12,
+          },
+          {
+            label: "产品属性",
+            prop: "itemProp",
+            type: "textarea",
+            minRows: 2,
+            span: 12,
+          },
+          {
+            label: "产品描述",
+            prop: "itemDescription",
+            type: "textarea",
+            minRows: 2,
+            span: 12,
+          },
+          {
+            label: "配件信息",
+            prop: "partsDescribe",
+            type: "textarea",
+            minRows: 2,
+            span: 12,
+          },
+          {
+            label: "商品信息",
+            prop: "productRemark",
+            type: "textarea",
+            minRows: 2,
+            span: 24,
+          }
+        ]
+      },
       treeOption: {
         nodeKey: "id",
         lazy: true,
@@ -904,6 +985,24 @@ export default {
       }
       this.$refs.library.init(false);
     },
+    handleRowDBLClick(row) {
+      if (row.$cellEdit) {
+        return this.$message.error("请保存此行内容再操作");
+      }
+      if (this.detailData.status != 1 && !row.$cellEdit) {
+        this.goodsEditShow = true
+        this.goodsEditForm = row
+      }
+    },
+    handleSave() {
+      this.$set(this.data, this.goodsEditForm.$index, this.goodsEditForm)
+      this.goodsEditShow = false
+      this.goodsEditForm = this.$options.data().goodsEditForm
+    },
+    handleClose() {
+      this.goodsEditShow = false
+      this.goodsEditForm = this.$options.data().goodsEditForm
+    },
     cnameChange(row) {
       this.goodsoptions.forEach(e => {
         if (e.id == row.itemId) {
@@ -1063,6 +1162,7 @@ export default {
       this.data[index].partsDescribe = names.join(",");
       this.data[index].partsPriceDescribe = namePrices.join(";");
       this.data[index].partsCost = costsSum;
+      this.data[index].productRemark = this.getproductRemark(this.data[index])
       this.priceChange(this.data[index]);
     },
     importProperty(row, index) {
@@ -1078,11 +1178,15 @@ export default {
       this.data[index].customThree = row.customThree;
       this.data[index].customFour = row.customFour;
       this.data[index].customFive = row.customFive;
+      this.data[index].productRemark = this.getproductRemark(this.data[index])
     },
     partClosed() {
       this.partList = [];
     },
     rowCell(row, index) {
+      if (this.goodsEditShow) {
+        return this.$message.error('请关闭表格上面的编辑')
+      }
       if (row.$cellEdit == true) {
         this.$set(row, "$cellEdit", false);
       } else {
@@ -1307,7 +1411,8 @@ export default {
                 item.unit = e.unit;
                 item.remarks = this.reData.remarks;
                 item.exchangeRate = this.reData.exchangeRate;
-                item.$cellEdit = true;
+                item.productRemark = e.ename + "\n" + (this.reData.itemProp ? this.reData.itemProp : '') + " " + (this.reData.itemDescription ? this.reData.itemDescription : '') + " " + (this.reData.partsDescribe ? (", " + this.reData.partsDescribe) : ''),
+                  item.$cellEdit = true;
               }
             });
           });
@@ -1348,6 +1453,7 @@ export default {
             remarks: null,
             exchangeRate: this.form.exchangeRate,
             partsDescribe: null,
+            productRemark: e.ename,
             $cellEdit: true
           });
         });
@@ -1443,6 +1549,7 @@ export default {
           partsDescribe: null,
           remarks: null,
           exchangeRate: this.form.exchangeRate,
+          productRemark: e.ename,
           $cellEdit: true
         });
       });
@@ -1531,6 +1638,29 @@ export default {
           this.pageLoading = false;
         });
     },
+    getproductRemark(row) {
+      const ename = row.ename ? row.ename : "";
+      const itemDescription = row.itemDescription
+        ? row.itemDescription
+        : "";
+      const itemProp = row.itemProp ? row.itemProp : "";
+      const partsDescribe = row.partsDescribe ? (', ' + row.partsDescribe) : "";
+      const productRemark =
+        ename +
+        "\n" +
+        itemProp +
+        " " +
+        itemDescription +
+        " " +
+        partsDescribe;
+      return productRemark
+    },
+    formEditChange(row) {
+      row.productRemark = this.getproductRemark(row)
+    },
+    editChange(row) {
+      row.productRemark = this.getproductRemark(row)
+    },
     //修改提交触发
     editCustomer(status) {
       this.$refs["form"].validate((valid, done) => {
@@ -1564,23 +1694,6 @@ export default {
                 )
               );
             }
-            this.data.forEach((e, index) => {
-              const ename = e.ename ? e.ename : "";
-              const itemDescription = e.itemDescription
-                ? e.itemDescription
-                : "";
-              const itemProp = e.itemProp ? e.itemProp : "";
-              const partsDescribe = e.partsDescribe ? e.partsDescribe : "";
-              e.productRemark =
-                ename +
-                "\n" +
-                itemDescription +
-                " " +
-                itemProp +
-                " " +
-                partsDescribe;
-              e.sort = index + 1
-            });
           }
           for (let i = 0; i < orderFeesList.length; i++) {
             // if (orderFeesList[i].corpId == null) {

+ 2 - 4
src/views/exportTrade/salesContract/config/customerContact.json

@@ -40,8 +40,7 @@
       "prop": "ename",
       "index": 4,
       "width": 200,
-      "overHidden": true,
-      "cell": true
+      "overHidden": true
     },
     {
       "label": "产品属性",
@@ -55,8 +54,7 @@
       "prop": "itemDescription",
       "index": 6,
       "width": 100,
-      "overHidden": true,
-      "cell": true
+      "overHidden": true
     },
     {
       "label": "产品型号",

File diff suppressed because it is too large
+ 511 - 436
src/views/exportTrade/salesContract/detailsPage.vue


Some files were not shown because too many files changed in this diff