From 43b705c29b0e089bdc1cf1cc9076b83f500b1ff5 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 14 十二月 2023 11:31:47 +0800
Subject: [PATCH] 	modified:   src/const/crud/customerOrder/customerOrderForm.js 	modified:   src/views/plan/customerorder/sample-customerorder-form.vue 	modified:   src/views/technology/structure/single-structure-form.vue

---
 src/views/technology/structure/single-structure-form.vue   |  166 ++++++++++++-----------
 src/const/crud/customerOrder/customerOrderForm.js          |    6 
 src/views/plan/customerorder/sample-customerorder-form.vue |  223 +++----------------------------
 3 files changed, 117 insertions(+), 278 deletions(-)

diff --git a/src/const/crud/customerOrder/customerOrderForm.js b/src/const/crud/customerOrder/customerOrderForm.js
index f23b3cf..979cc63 100644
--- a/src/const/crud/customerOrder/customerOrderForm.js
+++ b/src/const/crud/customerOrder/customerOrderForm.js
@@ -97,9 +97,11 @@
     label: '鏀惰揣鍦板潃',
     prop: 'shippingAddress',
     cell: true,
-    type: 'input',
+    type: 'textarea',
     minWidth: 200,
-    span: 24
+    span: 24,
+    minRows: 1,
+    maxRows: 3
   }, {
     label: '浜у搧澶囨敞',
     prop: 'remark',
diff --git a/src/views/plan/customerorder/sample-customerorder-form.vue b/src/views/plan/customerorder/sample-customerorder-form.vue
index 94aaeb1..8b895f7 100644
--- a/src/views/plan/customerorder/sample-customerorder-form.vue
+++ b/src/views/plan/customerorder/sample-customerorder-form.vue
@@ -51,14 +51,6 @@
               <el-input v-model="dataForm.entityName" placeholder=""></el-input>
             </el-form-item>
           </el-col>
-          <!-- <el-col :span="6">
-            <el-form-item label="浜嬩笟閮�" prop="salesDepartment">
-              <el-input
-                v-model="dataForm.salesDepartment"
-                placeholder=""
-              ></el-input>
-            </el-form-item>
-          </el-col> -->
           <el-col :span="6">
             <el-form-item label="鐪佷唤" prop="province">
               <el-input v-model="dataForm.province" placeholder=""></el-input>
@@ -156,6 +148,7 @@
     </el-divider>
     <div>
       <avue-crud ref="crud"
+        class="l-mes"
         show-hide="false"
         :option="option"
         :data="tableData">
@@ -175,196 +168,6 @@
           </template>
       </avue-crud>
     </div>
-    <!-- <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.packageRequire"
-            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.qualityRequire"
-            placeholder=""
-          ></el-input>
-        </el-col>
-        <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-row>
-      <el-row :gutter="20">
-        <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-col :span="2">
-          <span>涓氬姟鍛�</span>
-        </el-col>
-        <el-col :span="6">
-          <el-select v-model="dataForm.customerOrder.salesmanName" style="width:100%">
-                <el-option v-for="(item,index) in staffOptions" :key="index" :value="item.staff_no" :label="item.staffName"/>
-          </el-select>
-        </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-row>
-      <el-row :gutter="20">
-        <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-col :span="2">
-          <span>浜у搧绫诲瀷</span>
-        </el-col>
-        <el-col :span="6">
-          <el-input
-            v-model="dataForm.customerOrder.productType"
-            placeholder=""
-          ></el-input>
-        </el-col>
-      </el-row>
-    </div> -->
 
     <span slot="footer" class="dialog-footer">
       <el-button @click="visible = false">鍙栨秷</el-button>
@@ -401,6 +204,30 @@
   color: #c0c4cc;
   margin: -1px 0;
 }
+.l-mes .el-input-group__append,
+.l-mes .el-input-group__prepend {
+  padding: 0;
+  border-top: none;
+  border-right: none;
+  border-left: none;
+  border-radius: 0;
+  background-color: transparent;
+}
+
+.l-mes .el-input-group__append .el-button,
+.l-mes .el-input-group__prepend .el-button {
+  padding: 0;
+  width: 25px;
+  border: none !important;
+  line-height: 28px;
+  color: #c0c4cc;
+  margin: -1px 0;
+}
+
+.l-mes .el-input-group__append .el-button i,
+.l-mes .el-input-group__prepend .el-button i {
+  vertical-align: middle;
+}
 </style>
 <script>
 import { addObj } from '@/api/plan/customer'
diff --git a/src/views/technology/structure/single-structure-form.vue b/src/views/technology/structure/single-structure-form.vue
index b3ad774..813347d 100644
--- a/src/views/technology/structure/single-structure-form.vue
+++ b/src/views/technology/structure/single-structure-form.vue
@@ -2,11 +2,11 @@
   <div style="height: 100%">
     <div class="page-header">
       <div class="header-left">
-        <a @click="$router.go(-1)"><i class="icon-btn-back"></i></a>
+        <a @click="goBack"><i class="icon-btn-back"></i></a>
         <h2>缂栬緫-浜у搧缁撴瀯</h2>
       </div>
       <div class="btn-group header-right">
-        <el-button title="淇濆瓨" :disabled="isSubmit" v-thinclick="`save`"
+        <el-button title="淇濆瓨" type="primary" :disabled="isSubmit" v-thinclick="`save`"
           >淇濆瓨</el-button
         >
       </div>
@@ -47,34 +47,6 @@
                 >
                 </el-input>
               </el-form-item>
-              <!-- <el-form-item label="缁撴瀯绫诲瀷" prop="bomTypeDb">
-                <el-select
-                  v-model="dataForm.bomTypeDb"
-                  placeholder="璇烽�夋嫨缁撴瀯绫诲瀷"
-                  style="width:100%"
-                >
-                  <el-option
-                    v-for="(item, index) in bomTypeDbOptions"
-                    :label="item.label"
-                    :value="item.value"
-                    :key="index"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item> -->
-              <!-- <el-form-item label="鏇夸唬" prop="alternativeNo">
-                <el-input v-model="dataForm.alternativeNo"></el-input>
-              </el-form-item>
-              <el-form-item label="鏇夸唬鎻忚堪" prop="alternativeDesc">
-                <el-input
-                  type="textarea"
-                  :autosize="{ minRows: 1, maxRows: 3 }"
-                  v-model="dataForm.alternativeDesc"
-                ></el-input>
-              </el-form-item> -->
-              <!-- <el-form-item label="鐗堟湰鍙�" prop="version">
-                <el-input v-model="dataForm.version" disabled></el-input>
-              </el-form-item> -->
               <el-form-item label="澶囨敞" prop="remark">
                 <el-input
                   type="textarea"
@@ -82,15 +54,6 @@
                   v-model="dataForm.remark"
                 ></el-input>
               </el-form-item>
-              <!-- <el-form-item label="宸插悓姝ヨ嚦IFS" prop="ifsSync">
-                <span
-                  style="width: 146px;display: inline-block;font-size:12px;font-weight:bold;"
-                  >{{ dataForm.ifsSync ? '鏄�' : '鍚�' }}</span
-                >
-              </el-form-item> -->
-              <!-- <el-form-item label="榛樿缁撴瀯" prop="master">
-                <el-checkbox v-model="dataForm.master"></el-checkbox>
-              </el-form-item> -->
             </el-col>
           </el-row>
         </el-form>
@@ -110,7 +73,7 @@
                 size="medium"
                 class="blue-but"
                 @click="addNode()"
-                >娣诲姞
+                >娣诲姞琛�
               </el-button>
             </div>
           </div>
@@ -120,12 +83,14 @@
             :data="nodeList"
             :default-sort="{ prop: 'lineItemNo' }"
             height="650"
-            :header-cell-style="{ color: '#999' }"
+            border
+            :header-cell-style="{ color: '#000' }"
             :row-class-name="structureComponentRowClass"
+            class="l-mes"
           >
             <el-table-column
               prop="lineItemNo"
-              label="琛岄」鍙�"
+              label="搴忓彿"
               align="center"
               width="70"
             >
@@ -135,11 +100,13 @@
               prop="operationName"
               align="center"
             >
-              <template scope="scope">
+              <template scope="scope" >
                 <el-input
-                  v-model="scope.row.operationName"
-                  placeholder="璇烽�夋嫨娑堣�楀伐搴�"
-                  v-if="scope.row.isUpdate"
+                style="width:90%"
+                v-model="scope.row.operationName"
+                placeholder="璇烽�夋嫨娑堣�楀伐搴�"
+                readonly
+                v-if="scope.row.isUpdate"
                 >
                   <el-button
                     slot="append"
@@ -155,6 +122,7 @@
             <el-table-column label="闆朵欢鍙�" prop="partNo" align="center">
               <template scope="scope">
                 <el-input
+                  style="width:90%"
                   :class="customClass[scope.$index]"
                   v-model="scope.row.partNo"
                   placeholder="璇烽�夋嫨闆朵欢"
@@ -184,6 +152,8 @@
             <el-table-column label="鏁伴噺" prop="qpa" align="center">
               <template slot-scope="scope">
                 <el-input
+                  style="width:90%"
+                  clearable
                   size="small"
                   v-model="scope.row.qpa"
                   placeholder="璇峰~鍐欐暟閲�"
@@ -193,31 +163,15 @@
                 <span v-show="!scope.row.isUpdate">{{ scope.row.qpa }}</span>
               </template>
             </el-table-column>
-
             <el-table-column label="鍗曚綅" prop="unit" align="center">
             </el-table-column>
-            <!-- <el-table-column label="鐩樻暟(鐩�)" prop="discNum" align="center">
-              <template slot-scope="scope">
-                <el-input
-                  size="small"
-                  v-model="scope.row.discNum"
-                  placeholder="璇峰~鍐欑洏鏁�"
-                  v-show="scope.row.isUpdate"
-                ></el-input>
-                <span v-show="!scope.row.isUpdate">{{
-                  scope.row.discNum
-                }}</span>
-              </template>
-            </el-table-column> -->
-            <!-- <el-table-column label="鍥惧彿" prop="drawingNumber" align="center">
-            </el-table-column> -->
             <el-table-column align="center" label="鎿嶄綔" width="85px">
               <template slot-scope="scope">
                 <el-button
                   type="text"
                   size="small"
                   class="blue-but"
-                  v-if="!scope.row.isUpdate"
+                  v-if="!scope.row.isUpdate && scope.row.id!=null"
                   @click="editNode(scope.$index, scope.row)"
                   >缂栬緫</el-button
                 >
@@ -225,7 +179,7 @@
                   type="text"
                   size="small"
                   class="blue-but"
-                  v-if="scope.row.isUpdate"
+                  v-if="scope.row.isUpdate && scope.row.id!=null"
                   :loading="nodeSaveLoading"
                   @click="addOrUpdateNode(scope.$index, scope.row)"
                   >淇濆瓨</el-button
@@ -346,6 +300,26 @@
     this.getBomTypeDbOptions()
   },
   methods: {
+    goBack(){
+      let isUnSave = false
+      const _than = this
+      _than.nodeList.forEach(e=>{
+        if(e.isUpdate || e.id==null){
+          isUnSave = true
+        }
+      })
+      if(isUnSave){
+        _than.$confirm('鎮ㄨ繕鏈夋湭淇濆瓨鐨勫瓙鑺傜偣锛岀‘璁ょ寮�鍚�?', '鎻愮ず', {
+          confirmButtonText: '浠嶈绂诲紑',
+          cancelButtonText: '鍙栨秷',
+          type: 'warning'
+        }).then(() => {
+          _than.$router.go(-1)
+        }).catch(() => {});
+      }else{
+        _than.$router.go(-1)
+      }
+    },
     // 鏌ヨ缁撴瀯绫诲瀷瀛楀吀
     getBomTypeDbOptions() {
       remote('bom_type_db').then((response) => {
@@ -424,41 +398,49 @@
       this.currRow = null
     },
     save() {
+      const _than = this
       this.isSubmit = true
-      this.$refs.dataForm.validate((valid) => {
+       _than.nodeList.forEach(e=>{
+        e.version = _than.dataForm.version
+      })
+      _than.dataForm.components = _than.nodeList
+      _than.$refs.dataForm.validate((valid) => {
         if (valid) {
-          if (this.dataForm.id) {
-            putObj(this.dataForm)
+          if (_than.dataForm.id) {
+            putObj(_than.dataForm)
               .then((response) => {
                 var data = response.data
                 if (data.code === 0) {
-                  this.$message.success('淇濆瓨鎴愬姛')
+                  _than.$message.success('淇濆瓨鎴愬姛')
+                  _than.$nextTick(()=>{
+                    _than.init(_than.dataForm.id)
+                  })
                 } else {
-                  this.$message.error('淇濆瓨澶辫触')
+                  _than.$message.error('淇濆瓨澶辫触')
                 }
-                this.isSubmit = false
+                _than.isSubmit = false
               })
               .catch(() => {
-                this.isSubmit = false
+                _than.isSubmit = false
               })
           } else {
-            addObj(this.dataForm)
+            addObj(_than.dataForm)
               .then((response) => {
                 var data = response.data
                 if (data.code === 0) {
-                  this.dataForm.id = data.data
-                  this.$message.success('淇濆瓨鎴愬姛')
+                  _than.dataForm.id = data.data
+                  _than.$message.success('淇濆瓨鎴愬姛')
                 } else {
-                  this.$message.error('淇濆瓨澶辫触')
+                  _than.$message.error('淇濆瓨澶辫触')
                 }
-                this.isSubmit = false
+                _than.isSubmit = false
               })
               .catch(() => {
-                this.isSubmit = false
+                _than.isSubmit = false
               })
           }
         } else {
-          this.isSubmit = false
+          _than.isSubmit = false
         }
       })
     },
@@ -635,6 +617,10 @@
       }
     },
     delNode(index, row) {
+      if(row.id==null){
+        this.nodeList.splice(index,1)
+        return
+      }
       this.$confirm('鏄惁纭鍒犻櫎闆朵欢鍙蜂负' + row.partNo, '鎻愮ず', {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',
@@ -826,4 +812,28 @@
 .el-input__red {
   border: 1px solid red;
 }
+.l-mes .el-input-group__append,
+.l-mes .el-input-group__prepend {
+  padding: 0;
+  border-top: none;
+  border-right: none;
+  border-left: none;
+  border-radius: 0;
+  background-color: transparent;
+}
+
+.l-mes .el-input-group__append .el-button,
+.l-mes .el-input-group__prepend .el-button {
+  padding: 0;
+  width: 25px;
+  border: none !important;
+  line-height: 28px;
+  color: #c0c4cc;
+  margin: -1px 0;
+}
+
+.l-mes .el-input-group__append .el-button i,
+.l-mes .el-input-group__prepend .el-button i {
+  vertical-align: middle;
+}
 </style>

--
Gitblit v1.9.3