Explorar o código

增值服务配置 选了延保,默认带出使用年限不能修改
增值服务配置 网点分账金额字段,小数点建议精确到小数点后2位
增值服务配置 详情:进入详情类型显示1
增值服务配置 进入详情,点添加提示服务内容重复

linwenxin hai 1 ano
pai
achega
de88a80689

+ 1 - 1
src/views/setting/account/index.vue

@@ -105,12 +105,12 @@
           </el-select>
         </el-form-item>
         <el-form-item label="网点" prop="adminWebsitId">
+          <!-- filterable -->
           <el-cascader
             style="width: 100%"
             :options="departmentList"
             :props="{ checkStrictly: true, value: 'websitId', label: 'name' }"
             v-model="addForm.adminWebsitId"
-            filterable
             clearable
           >
           </el-cascader>

+ 24 - 14
src/views/valueAddedService/valueAddedConfig/index.vue

@@ -213,7 +213,7 @@ export default {
             prop: 'websitAmount'
           },
           render: (h, { row, column, index }) => {
-            row[column.columnAttributes.prop] = Number(row["amount"]) - Number(row["workerAmount"])
+            row[column.columnAttributes.prop] = (Number(row["amount"]) - Number(row["workerAmount"])).toFixed(2)
             return <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
           }
         },
@@ -254,7 +254,7 @@ export default {
                 this.formData.pgIncreItems.splice(index, 1)
               }}>删除</el-button>
               {this.isEditIndex == index && <el-button type="text" onClick={() => {
-                if (this.panduancp(row, index)) {
+                if (this.panduancp()) {
                   this.$refs.formRef.validateField(this.getVfyKey(index), (valid, invalidFields, errLabels) => {
                     if (valid) {
                       this.isEditIndex = -1
@@ -290,7 +290,7 @@ export default {
         {
           name: 'el-select',
           md: 8,
-          options: [{ label: "延保", value: "1" }, { label: "清洗", value: "2" }],
+          options: [{ label: "延保", value: 1 }, { label: "清洗", value: 2 }],
           attributes: {
             placeholder: '请选择',
             clearable: true,
@@ -300,6 +300,13 @@ export default {
             label: '服务类型',
             prop: 'type',
             rules: [...required]
+          },
+          events: {
+            change: (val) => {
+              if (val == 1) {
+                this.formData.usedType = "YEAR"
+              }
+            }
           }
         },
         {
@@ -315,7 +322,8 @@ export default {
           attributes: {
             placeholder: '请选择',
             clearable: true,
-            filterable: true
+            filterable: true,
+            disabled: this.formData.type == 1
           },
           formItemAttributes: {
             label: '使用类型',
@@ -355,7 +363,7 @@ export default {
               <div>
                 <div style="margin-bottom:8px">
                   <el-button onClick={() => {
-                    if (this.panduancp(this.formData.pgIncreItems[this.isEditIndex], this.isEditIndex)) {
+                    if (this.panduancp()) {
                       if (this.formData.pgIncreItems.length == 0) {
                         this.formData.pgIncreItems.push({
                           "amount": "",
@@ -462,15 +470,17 @@ export default {
         </div>
       )
     },
-    panduancp(row, index) {
+    panduancp() {
       try {
-        this.formData.pgIncreItems.map((item, index_) => {
-          if (
-            `${row.brandId}_${row.mainId}_${row.content}` == `${item.brandId}_${item.mainId}_${item.content}` &&
-            index_ != index
-          ) {
-            throw new Error('');
-          }
+        this.formData.pgIncreItems.map((row, index) => {
+          this.formData.pgIncreItems.map((item, index_) => {
+            if (
+              `${row.brandId}_${row.mainId}_${row.content}` == `${item.brandId}_${item.mainId}_${item.content}` &&
+              index_ != index
+            ) {
+              throw new Error('');
+            }
+          })
         })
       } catch (error) {
         this.$message.warning('服务内容重复')
@@ -545,7 +555,7 @@ export default {
       this.formDialog = false
     },
     formConfirm() {
-      if (this.isEditIndex == -1) {
+      if (this.panduancp()) {
         this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
           if (valid) {
             ([increConfigAdd, increConfigUpdate][this.formData.id ? 1 : 0])({