Forráskód Böngészése

客户管理,修改

zxz 3 éve
szülő
commit
e6682510f1

+ 99 - 60
src/views/customer/customerList.vue

@@ -55,35 +55,12 @@
             <el-button @click="outerVisibleDefaultEdit = false"
               >取 消</el-button
             >
-            <el-button type="primary" @click="editDepositRatio()"
+            <el-button type="primary" @click="editDefaultDepositRatio()"
               >确 定</el-button
             >
           </div>
         </el-dialog>
 
-        <!--修改定金比例-->
-        <el-dialog
-          width="25%"
-          title="修改定金比例"
-          :visible.sync="outerVisibleEdit"
-          :append-to-body="true"
-        >
-          <div style="width: 50%" class="xiugai">
-            <el-input
-              type="textarea"
-              :rows="2"
-              maxlength="30"
-              placeholder="请输入定金比例"
-              v-model="depositRatio"
-            >
-            </el-input>
-          </div>
-          <div slot="footer" class="dialog-footer">
-            <el-button @click="outerVisibleEdit = false">取 消</el-button>
-            <el-button type="primary" @click="editPrice(0)">确 定</el-button>
-          </div>
-        </el-dialog>
-
         <!--增加定金-->
         <el-dialog
           width="30%"
@@ -116,37 +93,6 @@
         </el-dialog>
 
         <!--退回定金-->
-        <!-- <WinseaContentModal
-          v-model="outerVisibleReturn"
-          title="退回定金"
-          @on-cancel="handleClose"
-        >
-          <div class="returnprice">
-            可退定金
-            <div class="ketuidingjin">
-              <template>
-                {{ this.totalDeposit - this.freezingDeposit }} 元
-              </template>
-            </div>
-          </div>
-          <div class="returnpricejine">退回金额</div>
-          <div style="width: 90%" class="tuihui">
-            <el-input
-              type="textarea"
-              :rows="2"
-              maxlength="30"
-              placeholder="请输入本次退回定金金额"
-              v-model="money"
-            >
-            </el-input>
-            <div class="yuan">元</div>
-          </div>
-          <div class="dialog-footer">
-            <el-button @click="outerVisibleReturn = false">取 消</el-button>
-            <el-button type="primary" @click="editPrice(2)">确定</el-button>
-          </div>
-        </WinseaContentModal> -->
-
         <el-dialog
           width="30%"
           title="退回定金"
@@ -231,19 +177,41 @@
         </el-table-column>
         <el-table-column prop="freezingDeposit" label="冻结定金(元)">
         </el-table-column>
-        <el-table-column prop="depositRatio" label="定金比例(元/吨)">
+        <el-table-column
+          class="table_td"
+          prop="depositRatio"
+          label="定金比例(元/吨)"
+        >
           <template slot-scope="scope">
-            {{ scope.row.depositRatio }}
+            <div class="inputChenge">
+              <!-- readonly -->
+              <el-input
+                v-model="scope.row.depositRatio"
+                v-if="scope.row.identification == 'true'"
+              ></el-input>
+              <div v-if="scope.row.identification == 'false'" class="inputs">
+                {{ scope.row.depositRatio }}
+              </div>
+            </div>
             <img
               width="17"
               height="18"
               style="vertical-align: text-top; position: relative; top: -1px"
               src="../../../public/img/edit.png"
-              @click="editClick(0, scope.row)"
+              @click="whether(scope.row)"
+              v-if="scope.row.identification == 'false'"
               alt=""
             />
+            <i
+              class="el-icon-check"
+              style="line-height: 29px; margin-left: 10px"
+              v-if="scope.row.identification == 'true'"
+              @click="varietyClick(scope.row)"
+            ></i>
+            <!-- <div>—</div> -->
           </template>
         </el-table-column>
+
         <el-table-column prop="updateDate" label="更新时间"> </el-table-column>
         <el-table-column prop="seller" label="操作" width="280">
           <template slot-scope="scope">
@@ -387,6 +355,7 @@ export default {
       }
       return fmt
     },
+
     handleClose() {
       this.accessoryTFs = false
     },
@@ -404,6 +373,66 @@ export default {
       this.searchType = state
       this.getList()
     },
+    //修改定金比例
+    varietyClick(row) {
+      //  if (
+      //   this.depositRatio < 0 ||
+      //   this.depositRatio > 100000 ||
+      //   (String(this.depositRatio).indexOf('.') != -1 &&
+      //     String(this.depositRatio).length -
+      //       (String(this.depositRatio).indexOf('.') + 1) >
+      //       2)
+      // ) {
+      //   this.$message({
+      //     message: '定金比例输入错误',
+      //     type: 'warning',
+      //   })
+      //   return
+      // }
+      // if (this.depositRatio) {
+      //   if (isNaN(this.depositRatio)) {
+      //     this.$message({
+      //       message: '定金比例非数字!',
+      //       type: 'warning',
+      //     })
+      //     return
+      //   }
+      // }
+      // if (!this.depositRatio) {
+      //   this.$message({
+      //     message: '定金比例不能为空!',
+      //     type: 'warning',
+      //   })
+      //   return
+      // }
+      this.$confirm(`确定要修改定金比例?`, {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          editCustomerInfo({
+            flag: 0,
+            depositRatio: row.depositRatio,
+            id: row.id,
+          })
+            .toPromise()
+            .then((response) => {
+              this.$notify.success({
+                title: '成功',
+                message: '状态修改成功',
+              })
+              this.getList()
+            })
+            .catch((response) => {})
+        })
+        .catch(() => {
+          return false
+        })
+    },
+    whether(row) {
+      row.identification = 'true'
+    },
     //列表查询
     getList() {
       getList({
@@ -415,17 +444,20 @@ export default {
       })
         .toPromise()
         .then((response) => {
+          for (var i = 0; i < response.records.length; i++) {
+            response.records[i].identification = 'false'
+          }
+          this.customerList = response
           this.deptCircularPage.currentPage = response.current
           this.deptCircularPage.pageSize = response.size
           this.deptBudgetTotal = response.total
-          this.customerList = response
         })
     },
     //设置默认定金比例
     installRatio() {
       this.outerVisibleDefaultEdit = true
     },
-    editDepositRatio() {
+    editDefaultDepositRatio() {
       if (
         this.depositRatio < 1 ||
         this.depositRatio > 100000 ||
@@ -862,6 +894,13 @@ export default {
   width: 70px;
   margin-top: -19px;
 }
+.inputChenge {
+  width: 50%;
+  display: inline-flex;
+}
+.inputs {
+  margin: 0 auto;
+}
 /deep/.ketuidingjin {
   margin-left: 135px;
   width: 70px;

+ 6 - 9
src/views/purchasingManagement/procurementPlanList.vue

@@ -1,7 +1,6 @@
 //采购计划
 <template>
   <div class="container">
-
     <BaseHeaderLayout :leftSpan="10">
       <template slot="left">
         <ws-button type="primary" @click="handleAdd()">添加</ws-button>
@@ -267,7 +266,6 @@ export default {
       deptCircularPage: {},
       warehouseList: [],
       deptBudgetList: {},
-      pcFlag: 1,
       historyList: [],
       pickerBeginDateBefore: {
         disabledDate: (time) => {
@@ -837,14 +835,13 @@ export default {
 }
 
 .base_header_layout .grid-content.right .find.el-button--primary {
-    width: 30px;
-    margin-left: 0;
-    border-top-left-radius: 0px;
-    border-bottom-left-radius: 0px;
-    margin-top: -1px;
-    margin-left: -6px;
+  width: 30px;
+  margin-left: 0;
+  border-top-left-radius: 0px;
+  border-bottom-left-radius: 0px;
+  margin-top: -1px;
+  margin-left: -6px;
 }
 // .inputChenge>>>.el-input__inner{
 // border: none;
-
 </style>