From e2c3d91242be8953c5d73ddddc04839b22a9f1e1 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 14 十一月 2023 14:56:45 +0800
Subject: [PATCH] 	new file:   src/const/crud/customerOrder/customerOrderForm.js 	modified:   src/views/common/ztt-table.vue 	modified:   src/views/plan/customerorder/index.vue 	modified:   src/views/plan/customerorder/sample-customerorder-form.vue

---
 src/views/plan/customerorder/sample-customerorder-form.vue |  254 ++++++++++----------------------------------------
 1 files changed, 52 insertions(+), 202 deletions(-)

diff --git a/src/views/plan/customerorder/sample-customerorder-form.vue b/src/views/plan/customerorder/sample-customerorder-form.vue
index 46fd83d..85f9d64 100644
--- a/src/views/plan/customerorder/sample-customerorder-form.vue
+++ b/src/views/plan/customerorder/sample-customerorder-form.vue
@@ -125,208 +125,33 @@
       </el-form>
     </div>
 
-    <el-divider
-      ><span style="font-weight:bold;font-size:16px;">璁㈠崟琛�</span></el-divider
-    >
+    <el-divider>
+      <span style="font-weight:bold;font-size:16px;">璁㈠崟琛�</span>
+    </el-divider>
     <div class="l-mes normal-form">
-      <el-row :gutter="20">
-        <el-col :span="2">
-          <span>闆朵欢鍙�</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.partNo"
-            placeholder=""
-            readonly
-          >
-            <el-button
-              slot="append"
-              icon="el-icon-search"
-              @click="openPartDialog()"
-            ></el-button>
-          </el-input>
-        </el-col>
-        <el-col :span="2">
-          <span>鍗曚綅</span>
-        </el-col>
-        <el-col :span="6">
-          <el-select
-            v-model="dataForm.customerOrder.unit"
-            placeholder=""
-            style="width: 100%"
-          >
-            <el-option
-              v-for="item in units"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            />
-          </el-select>
-        </el-col>
-        <el-col :span="2">
-          <span>鏁伴噺</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.buyQtyDue"
-            placeholder=""
-          ></el-input>
-        </el-col>
-      </el-row>
-      <el-row :gutter="20">
-        <el-col :span="2">
-          <span>鐢靛帇绛夌骇</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.voltAgeClass"
-            placeholder=""
-          ></el-input>
-        </el-col>
-        <el-col :span="2">
-          <span>浜у搧鍚嶇О</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.productName"
-            placeholder=""
-          ></el-input>
-        </el-col>
-        <el-col :span="2">
-          <span>鍒堕�犲睘鎬�</span>
-        </el-col>
-        <el-col :span="6">
-          <el-select
-            v-model="dataForm.customerOrder.manufactureAttr"
-            placeholder=""
-            style="width: 100%"
-            disabled
-          >
-            <el-option
-              v-for="item in manufactureAttrs"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            />
-          </el-select>
-        </el-col>
-      </el-row>
-      <el-row :gutter="20">
-        <el-col :span="2">
-          <span>澶栨姢棰滆壊</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.outerColor"
-            placeholder=""
-          ></el-input>
-        </el-col>
-        <el-col :span="2">
-          <span>闆朵欢瑙勬牸</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.customerPartSpec"
-            placeholder=""
-          ></el-input>
-        </el-col>
-        <el-col :span="2">
-          <span>鍗板瓧绫诲瀷</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.printType"
-            placeholder=""
-          ></el-input>
-        </el-col>
-      </el-row>
-      <el-row :gutter="20">
-        <el-col :span="2">
-          <span>鍗板瓧瑕佹眰</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.printingRequirements"
-            placeholder=""
-          ></el-input>
-        </el-col>
-        <el-col :span="2">
-          <span>鍖呰瑕佹眰</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.packageRequire"
-            placeholder=""
-          ></el-input>
-        </el-col>
-        <el-col :span="2">
-          <span>璐ㄩ噺瑕佹眰</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.qualityRequire"
-            placeholder=""
-          ></el-input>
-        </el-col>
-      </el-row>
-      <el-row :gutter="20">
-        <el-col :span="2">
-          <span>鐢熶骇闇�姹傝鏄�</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.otherProductRequire"
-            placeholder=""
-          ></el-input>
-        </el-col>
-        <el-col :span="2">
-          <span>绯荤粺</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.divisionSystem"
-            placeholder=""
-          ></el-input>
-        </el-col>
-        <el-col :span="2">
-          <span>鏀惰揣鍦板潃</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.shippingAddress"
-            placeholder=""
-          ></el-input>
-        </el-col>
-      </el-row>
-      <el-row :gutter="20">
-        <el-col :span="2">
-          <span>涓氬姟鍛�</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.salesmanName"
-            placeholder=""
-          ></el-input>
-        </el-col>
-        <el-col :span="2">
-          <span>鐩橀暱瑕佹眰</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.lengthRequirement"
-            placeholder=""
-          ></el-input>
-        </el-col>
-        <el-col :span="2">
-          <span>澶囨敞</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.remark"
-            placeholder=""
-          ></el-input>
-        </el-col>
-      </el-row>
+      <avue-crud ref="crud"
+        show-hide="false"
+        :option="option"
+        :data="tableData">
+          <template slot="partNo" slot-scope="scope">
+            <el-input v-model="scope.row.partNo" placeholder="鏌ヨ闆朵欢鍙�" readonly>
+                <el-button slot="append" icon="el-icon-search" @click="openPartDialog(scope.row.$index)"></el-button>
+            </el-input>
+          </template>
+          <template slot="otcUnit" slot-scope="scope">
+            <el-select v-model="scope.row.otcUnit" placeholder="璇烽�夋嫨鍗曚綅" style="width: 100%">
+              <el-option
+                v-for="item in units"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value" />
+            </el-select>
+          </template>
+          <template slot="menu" slot-scope="scope">
+            <el-button :disabled="tableData.length<2" @click="delRow(scope.row,scope.$index)" 
+            icon="el-icon-circle-close" type="text" size="small">鍙栨秷</el-button>
+          </template>
+      </avue-crud>
     </div>
 
     <span slot="footer" class="dialog-footer">
@@ -370,6 +195,7 @@
 import { remote } from '@/api/admin/dict'
 import PartDialog from '@/views/common/part.vue'
 import { validateSixDecimal } from '@/util/validate'
+import { tableOption } from '@/const/crud/customerOrder/customerOrderForm'
 
 export default {
   components: {
@@ -377,6 +203,22 @@
   },
   data() {
     return {
+      currentSelectRow: null,
+      option: tableOption,
+      tableData: [{
+          "$cellEdit": true,
+          "$index": 0,
+          "partNo": "",
+          "customerPartSpec": "",
+          "manufactureAttr": "",
+          "productName": "",
+          "productType": "",
+          "otcUnit": "",
+          "buyQtyDue": "",
+          "shippingAddress": "",
+          "remark": "",
+          "isTrusted": true
+      }],
       title: '',
       isFullScreen: false,
       visible: false,
@@ -427,6 +269,9 @@
     this.getManufactureAttrs('manufacture_attr_type')
   },
   methods: {
+    delRow(row,index) {
+      this.tableData.splice(index,1)
+    },
     init(id) {
       this.initDataForm()
       this.visible = true
@@ -488,12 +333,17 @@
       })
     },
     // 闆朵欢閫夋嫨
-    openPartDialog() {
+    openPartDialog(index) {
+      this.currentSelectRow = index
       this.showPart = true
     },
     selectPart(part) {
       if (part) {
         this.dataForm.customerOrder.partNo = part.partNo
+        const index = this.currentSelectRow
+          this.tableData[index].partNo = part.partNo
+          this.tableData[index].customerPartSpec = part.specs
+          this.tableData[index].productName = part.partName
       }
     },
     // 鍏ㄥ睆

--
Gitblit v1.9.3