فهرست منبع

收款条件设置

qymljy 1 سال پیش
والد
کامیت
3c4169393c

+ 10 - 26
src/HDrpManagement/collectionRule/components/add.vue

@@ -67,7 +67,11 @@ export default {
         "sa_receivableruleid":0,
         "remarks":"",
         "isdefault":1,
-        "accountingnodes": []
+        "accountingnodes": {
+          "ordercheck": [],
+          "logisticscheck": [],
+          "invoiceapplycheck": []
+        }
       },
       rules:{
         point:[
@@ -86,32 +90,10 @@ export default {
         remarks:[
           { required: false, message: '请输入描述', trigger: 'blur'}
         ],
-      },
-      isErrorOrder: false,
-      isErrorLogistics:false,
-      isErrorInvoiceapply:false
+      }
     }
   },
   methods:{
-    checkAmountrate(val,key){
-      if (val > 100 || val < 0){
-        if (key === '订单审核'){
-          this.isErrorOrder = true
-        }else if (key === '订单出货'){
-          this.isErrorLogistics = true
-        }else {
-          this.isErrorInvoiceapply = true
-        }
-      }else {
-        if (key === '订单审核'){
-          this.isErrorOrder = false
-        }else if (key === '订单出货'){
-          this.isErrorLogistics = false
-        }else {
-          this.isErrorInvoiceapply = false
-        }
-      }
-    },
     async onSubmit(){
       if (this.auditIsUsed == '1') {
         this.auditList = this.$refs.audit.list.map(item=>{
@@ -143,7 +125,7 @@ export default {
             "days":item.days,
             "amountrate":(item.amountrate/100).toFixed(4),
             "isused":"1",
-            "point":"订单出货"
+            "point":"订单开票"
           }
         })
       }else {
@@ -162,7 +144,9 @@ export default {
           offset:260
         });
       }else {
-        this.form.accountingnodes = newArr
+        this.form.accountingnodes.ordercheck = this.auditList
+        this.form.accountingnodes.logisticscheck = this.shipmentList
+        this.form.accountingnodes.invoiceapplycheck = this.invoiceList
         const res = await this.$api.requested({
           "id": "20230110095903",
           "content": this.form

+ 118 - 107
src/HDrpManagement/collectionRule/components/edit.vue

@@ -1,52 +1,23 @@
 <template>
   <div>
     <el-button size="mini" type="text" @click="editBtn">编 辑</el-button>
-    <el-dialog title="编辑收款条件" append-to-body :visible.sync="dialogFormVisible" width="40%" @close="dialogFormVisible = false;$refs.form.resetFields();$emit('onSuccess');isErrorInvoiceapply=false;isErrorLogistics=false;isErrorOrder=false">
+    <el-dialog title="编辑收款条件" append-to-body :visible.sync="dialogFormVisible" width="800px" @close="onClose">
       <el-row :gutter="20">
         <el-form :model="form" :rules="rules" ref="form" label-width="140px" label-position="right" size="mini">
           <el-col :span="24">
             <el-form-item label="立账节点" prop="accountingnodes">
-              <div>
-                <div style="float: left;margin-bottom: 10px">
-                  <el-checkbox v-model="form.accountingnodes.ordercheck.isused" true-label="1" false-label="0">订单审核</el-checkbox>
-                  <span style="margin-left: 50px">后置天数:</span>
-                  <el-input type="number" style="width: 100px" v-model="form.accountingnodes.ordercheck.days" placeholder="请输入" ></el-input>
-                  <span style="margin-left: 5px">天</span>
-                  <span style="margin-left: 50px">立账额度:</span>
+              <div style="max-height: 450px;overflow: auto">
+                <div>
+                  <el-checkbox v-model="auditIsUsed" true-label="1" false-label="0" @change="isUsedChange('审核')">订单审核</el-checkbox>
+                  <setInfo ref="audit" :isUsed="auditIsUsed"></setInfo>
                 </div>
-                <div style="float: left;margin-bottom: 10px">
-                  <el-input type="number" style="width: 100px" v-model="form.accountingnodes.ordercheck.amountrate" placeholder="请输入" :class="{ 'is-error': isErrorOrder }"  @change="checkAmountrate(form.accountingnodes.ordercheck.amountrate,'订单审核')"></el-input>
-                  <span style="margin-left: 5px">%</span>
-                  <p v-if="isErrorOrder" style="color: red;font-size: 12px">立账额度范围(0-100)</p>
+                <div>
+                  <el-checkbox v-model="shipmentIsUsed" true-label="1" false-label="0" @change="isUsedChange('出货')">订单出货</el-checkbox>
+                  <setInfo ref="shipment" :isUsed="shipmentIsUsed"></setInfo>
                 </div>
-              </div>
-              <div>
-                <div style="float: left;margin-bottom: 10px">
-                  <el-checkbox v-model="form.accountingnodes.logisticscheck.isused" true-label="1" false-label="0">订单出货</el-checkbox>
-                  <span style="margin-left: 50px">后置天数:</span>
-                  <el-input type="number" style="width: 100px" v-model="form.accountingnodes.logisticscheck.days" placeholder="请输入"></el-input>
-                  <span style="margin-left: 5px">天</span>
-                  <span style="margin-left: 50px">立账额度:</span>
-                </div>
-                <div style="float: left;margin-bottom: 10px">
-                  <el-input type="number" style="width: 100px" v-model="form.accountingnodes.logisticscheck.amountrate" placeholder="请输入" :class="{ 'is-error': isErrorLogistics }"  @change="checkAmountrate(form.accountingnodes.logisticscheck.amountrate,'订单出货')"></el-input>
-                  <span style="margin-left: 5px">%</span>
-                  <p v-if="isErrorLogistics" style="color: red;font-size: 12px">立账额度范围(0-100)</p>
-                </div>
-
-              </div>
-              <div>
-                <div style="float: left">
-                  <el-checkbox v-model="form.accountingnodes.invoiceapplycheck.isused" true-label="1" false-label="0">订单开票</el-checkbox>
-                  <span style="margin-left: 50px">后置天数:</span>
-                  <el-input type="number" style="width: 100px" v-model="form.accountingnodes.invoiceapplycheck.days" placeholder="请输入"></el-input>
-                  <span style="margin-left: 5px">天</span>
-                  <span style="margin-left: 50px">立账额度:</span>
-                </div>
-                <div style="float: left">
-                  <el-input type="number" style="width: 100px" v-model="form.accountingnodes.invoiceapplycheck.amountrate" placeholder="请输入" :class="{ 'is-error': isErrorInvoiceapply }"  @change="checkAmountrate(form.accountingnodes.invoiceapplycheck.amountrate,'订单开票')"></el-input>
-                  <span style="margin-left: 5px">%</span>
-                  <p v-if="isErrorInvoiceapply" style="color: red;font-size: 12px">立账额度范围(0-100)</p>
+                <div>
+                  <el-checkbox v-model="invoiceIsUsed" true-label="1" false-label="0" @change="isUsedChange('开票')">订单开票</el-checkbox>
+                  <setInfo ref="invoice" :isUsed="invoiceIsUsed"></setInfo>
                 </div>
               </div>
             </el-form-item>
@@ -64,17 +35,19 @@
         </el-form>
       </el-row>
       <div class="dialog-footer">
-        <el-button size="small" @click="dialogFormVisible = false;$refs.form.resetFields();$emit('onSuccess');isErrorInvoiceapply=false;isErrorLogistics=false;isErrorOrder=false" class="normal-btn-width">取 消</el-button>
-        <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
+        <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width" :disabled="auditIsUsed == '0' && shipmentIsUsed == '0' && invoiceIsUsed == '0' && form.remarks == ''">确 定</el-button>
       </div>
     </el-dialog>
   </div>
 </template>
 
 <script>
+import setInfo from "@/HDrpManagement/collectionRule/components/setInfo";
 export default {
   name: "edit",
   props:['data'],
+  components:{setInfo},
   data(){
     var NumberSize = (rule, value, callback) => {
       if (+value >= 0 && +value <= 100) {
@@ -85,30 +58,16 @@ export default {
     }
     return {
       dialogFormVisible:false,
+      auditIsUsed:0,
+      shipmentIsUsed:0,
+      invoiceIsUsed:0,
+      auditList:[],
+      shipmentList:[],
+      invoiceList:[],
       form:{
         "sa_receivableruleid":0,
-        "days":"10",
-        "amountrate":'',
-        "point":"",
         "remarks":"",
-        "isdefault":1,
-        "accountingnodes": {
-          "ordercheck": {//订单审核
-            "days": "",//后置天数
-            "amountrate": "",//立账额度
-            "isused": "0"//是否勾选
-          },
-          "logisticscheck": {//订单出货
-            "days": "",
-            "amountrate": "",
-            "isused": "0"
-          },
-          "invoiceapplycheck": {//订单开票
-            "days": "",
-            "amountrate": "",
-            "isused": "0"
-          }
-        }
+        "isdefault":1
       },
       rules:{
         point:[
@@ -128,25 +87,32 @@ export default {
           { required: false, message: '请输入描述', trigger: 'blur'}
         ],
       },
-      isErrorOrder: false,
-      isErrorLogistics:false,
-      isErrorInvoiceapply:false
     }
   },
   methods:{
     editBtn () {
       this.dialogFormVisible = true
       this.form = Object.assign({},this.form,this.data)
-      console.log(this.form,'form1')
-      if (this.form.accountingnodes){
-       /* this.form.accountingnodes.ordercheck.amountrate = Math.round((this.form.accountingnodes.ordercheck.amountrate*100)*100)/100
-        this.form.accountingnodes.logisticscheck.amountrate = Math.round((this.form.accountingnodes.logisticscheck.amountrate*100)*100)/100
-        this.form.accountingnodes.invoiceapplycheck.amountrate = Math.round((this.form.accountingnodes.invoiceapplycheck.amountrate*100)*100)/100*/
-      }else {
-        this.form.accountingnodes.ordercheck.amountrate = ''
-        this.form.accountingnodes.logisticscheck.amountrate = ''
-        this.form.accountingnodes.invoiceapplycheck.amountrate = ''
-      }
+      this.auditList = this.data.accountingnodes.ordercheck
+      this.shipmentList = this.data.accountingnodes.logisticscheck
+      this.invoiceList = this.data.accountingnodes.invoiceapplycheck
+      this.auditIsUsed = this.auditList?this.auditList.length>0?this.auditList[0].isused:'0':'0'
+      this.shipmentIsUsed = this.shipmentList?this.shipmentList.length>0?this.shipmentList[0].isused:'0':'0'
+      this.invoiceIsUsed = this.invoiceList?this.invoiceList.length>0?this.invoiceList[0].isused:'0':'0'
+      this.$nextTick(()=>{
+        this.auditList.forEach(item=>{
+          item.amountrate = Math.round((item.amountrate * 100)*100)/100
+        })
+        this.$refs.audit.list = this.auditList
+        this.shipmentList.forEach(item=>{
+          item.amountrate = Math.round((item.amountrate * 100)*100)/100
+        })
+        this.$refs.shipment.list = this.shipmentList
+        this.invoiceList.forEach(item=>{
+          item.amountrate = Math.round((item.amountrate * 100)*100)/100
+        })
+        this.$refs.invoice.list = this.invoiceList
+      })
 
     },
     checkAmountrate(val,key){
@@ -168,47 +134,92 @@ export default {
         }
       }
     },
-    onSubmit(){
-      console.log(this.form)
-      const order = this.form.accountingnodes.ordercheck.isused == '1'?this.form.accountingnodes.ordercheck.amountrate:0
-      const logistics = this.form.accountingnodes.logisticscheck.isused == '1'?this.form.accountingnodes.logisticscheck.amountrate:0
-      const invoiceapply = this.form.accountingnodes.invoiceapplycheck.isused == '1'?this.form.accountingnodes.invoiceapplycheck.amountrate:0
-      console.log(order + logistics + invoiceapply)
-      if (parseFloat(order) + parseFloat(logistics) + parseFloat(invoiceapply) !== 100 ){
-        this.$message.error('已选节点立账额度合计需等于100%');
+    async onSubmit(){
+      if (this.auditIsUsed == '1') {
+        this.auditList = this.$refs.audit.list.map(item=>{
+          return {
+            "days":item.days,
+            "amountrate":(item.amountrate/100).toFixed(4),
+            "isused":"1",
+            "point":"订单审核"
+          }
+        })
       }else {
-        this.$refs['form'].validate(async (valid) => {
-          if (!valid) return false
-          /*this.form.amountrate = (this.form.amountrate /100).toFixed(4)*/
-          this.form.accountingnodes.ordercheck.amountrate = (this.form.accountingnodes.ordercheck.amountrate/100).toFixed(4)
-          this.form.accountingnodes.logisticscheck.amountrate = (this.form.accountingnodes.logisticscheck.amountrate/100).toFixed(4)
-          this.form.accountingnodes.invoiceapplycheck.amountrate = (this.form.accountingnodes.invoiceapplycheck.amountrate/100).toFixed(4)
-          const res = await this.$api.requested({
-            "id": "20230110095903",
-            "content": this.form
-          })
-          this.tool.showMessage(res,()=>{
-            this.$emit('onSuccess')
-            this.$refs['form'].resetFields();
-            this.dialogFormVisible = false
-          })
+        this.auditList = []
+      }
+      if (this.shipmentIsUsed == '1') {
+        this.shipmentList = this.$refs.shipment.list.map(item=>{
+          return {
+            "days":item.days,
+            "amountrate":(item.amountrate/100).toFixed(4),
+            "isused":"1",
+            "point":"订单出货"
+          }
+        })
+      }else {
+        this.shipmentList = []
+      }
+      if (this.invoiceIsUsed == '1') {
+        this.invoiceList = this.$refs.invoice.list.map(item=>{
+          return {
+            "days":item.days,
+            "amountrate":(item.amountrate/100).toFixed(4),
+            "isused":"1",
+            "point":"订单开票"
+          }
         })
+      }else {
+        this.invoiceList = []
       }
-     /* console.log(this.form)
-      this.$refs['form'].validate(async (valid) => {
-        if (!valid) return false
-        this.form.amountrate = (this.form.amountrate /100).toFixed(4)
+      let newArr = this.auditList.concat(this.shipmentList.concat(this.invoiceList))
+      let allAmountrate = parseFloat(0)
+      newArr.forEach(item=>{
+        allAmountrate = parseFloat(allAmountrate) + parseFloat(item.amountrate)
+      })
+      if (allAmountrate !== 1){
+        this.$message({
+          message: '已选节点立账额度合计需等于100%',
+          center: true,
+          type: 'error',
+          offset:260
+        });
+      }else {
+        this.form.accountingnodes.ordercheck = this.auditList
+        this.form.accountingnodes.logisticscheck = this.shipmentList
+        this.form.accountingnodes.invoiceapplycheck = this.invoiceList
         const res = await this.$api.requested({
           "id": "20230110095903",
-          "version":1,
           "content": this.form
         })
         this.tool.showMessage(res,()=>{
-          this.$emit('onSuccess')
-          this.$refs['form'].resetFields();
+          this.onClose()
           this.dialogFormVisible = false
         })
-      })*/
+      }
+    },
+    isUsedChange(value){
+      if (value === '订单'){
+        if (this.auditIsUsed !== 1){
+          this.$refs.audit.list = [{
+            days:'',
+            amountrate:'',
+          }]
+        }
+      }else if (value === '出货'){
+        this.$refs.shipment.list = [{
+          days:'',
+          amountrate:'',
+        }]
+      }else if (value === '开票'){
+        this.$refs.invoice.list = [{
+          days:'',
+          amountrate:'',
+        }]
+      }
+    },
+    onClose(){
+      this.$emit('onSuccess')
+      this.dialogFormVisible = false
     }
   }
 }

+ 224 - 0
src/HDrpManagement/collectionRule/components/editCopy1.vue

@@ -0,0 +1,224 @@
+<template>
+  <div>
+    <el-button size="mini" type="text" @click="editBtn">编 辑</el-button>
+    <el-dialog title="编辑收款条件" append-to-body :visible.sync="dialogFormVisible" width="40%" @close="dialogFormVisible = false;$refs.form.resetFields();$emit('onSuccess');isErrorInvoiceapply=false;isErrorLogistics=false;isErrorOrder=false">
+      <el-row :gutter="20">
+        <el-form :model="form" :rules="rules" ref="form" label-width="140px" label-position="right" size="mini">
+          <el-col :span="24">
+            <el-form-item label="立账节点" prop="accountingnodes">
+              <div>
+                <div style="float: left;margin-bottom: 10px">
+                  <el-checkbox v-model="form.accountingnodes.ordercheck.isused" true-label="1" false-label="0">订单审核</el-checkbox>
+                  <span style="margin-left: 50px">后置天数:</span>
+                  <el-input type="number" style="width: 100px" v-model="form.accountingnodes.ordercheck.days" placeholder="请输入" ></el-input>
+                  <span style="margin-left: 5px">天</span>
+                  <span style="margin-left: 50px">立账额度:</span>
+                </div>
+                <div style="float: left;margin-bottom: 10px">
+                  <el-input type="number" style="width: 100px" v-model="form.accountingnodes.ordercheck.amountrate" placeholder="请输入" :class="{ 'is-error': isErrorOrder }"  @change="checkAmountrate(form.accountingnodes.ordercheck.amountrate,'订单审核')"></el-input>
+                  <span style="margin-left: 5px">%</span>
+                  <p v-if="isErrorOrder" style="color: red;font-size: 12px">立账额度范围(0-100)</p>
+                </div>
+              </div>
+              <div>
+                <div style="float: left;margin-bottom: 10px">
+                  <el-checkbox v-model="form.accountingnodes.logisticscheck.isused" true-label="1" false-label="0">订单出货</el-checkbox>
+                  <span style="margin-left: 50px">后置天数:</span>
+                  <el-input type="number" style="width: 100px" v-model="form.accountingnodes.logisticscheck.days" placeholder="请输入"></el-input>
+                  <span style="margin-left: 5px">天</span>
+                  <span style="margin-left: 50px">立账额度:</span>
+                </div>
+                <div style="float: left;margin-bottom: 10px">
+                  <el-input type="number" style="width: 100px" v-model="form.accountingnodes.logisticscheck.amountrate" placeholder="请输入" :class="{ 'is-error': isErrorLogistics }"  @change="checkAmountrate(form.accountingnodes.logisticscheck.amountrate,'订单出货')"></el-input>
+                  <span style="margin-left: 5px">%</span>
+                  <p v-if="isErrorLogistics" style="color: red;font-size: 12px">立账额度范围(0-100)</p>
+                </div>
+
+              </div>
+              <div>
+                <div style="float: left">
+                  <el-checkbox v-model="form.accountingnodes.invoiceapplycheck.isused" true-label="1" false-label="0">订单开票</el-checkbox>
+                  <span style="margin-left: 50px">后置天数:</span>
+                  <el-input type="number" style="width: 100px" v-model="form.accountingnodes.invoiceapplycheck.days" placeholder="请输入"></el-input>
+                  <span style="margin-left: 5px">天</span>
+                  <span style="margin-left: 50px">立账额度:</span>
+                </div>
+                <div style="float: left">
+                  <el-input type="number" style="width: 100px" v-model="form.accountingnodes.invoiceapplycheck.amountrate" placeholder="请输入" :class="{ 'is-error': isErrorInvoiceapply }"  @change="checkAmountrate(form.accountingnodes.invoiceapplycheck.amountrate,'订单开票')"></el-input>
+                  <span style="margin-left: 5px">%</span>
+                  <p v-if="isErrorInvoiceapply" style="color: red;font-size: 12px">立账额度范围(0-100)</p>
+                </div>
+              </div>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="描述" prop="remarks">
+              <el-input type="textarea" v-model="form.remarks" placeholder="请输入描述"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="是否默认条件" prop="isdefault">
+              <el-checkbox :true-label="1" :false-label="0" v-model="form.isdefault"></el-checkbox>
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </el-row>
+      <div class="dialog-footer">
+        <el-button size="small" @click="dialogFormVisible = false;$refs.form.resetFields();$emit('onSuccess');isErrorInvoiceapply=false;isErrorLogistics=false;isErrorOrder=false" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "edit",
+  props:['data'],
+  data(){
+    var NumberSize = (rule, value, callback) => {
+      if (+value >= 0 && +value <= 100) {
+        callback()
+      } else {
+        return callback(new Error('额度比率范围(0-100)'));
+      }
+    }
+    return {
+      dialogFormVisible:false,
+      form:{
+        "sa_receivableruleid":0,
+        "days":"10",
+        "amountrate":'',
+        "point":"",
+        "remarks":"",
+        "isdefault":1,
+        "accountingnodes": {
+          "ordercheck": {//订单审核
+            "days": "",//后置天数
+            "amountrate": "",//立账额度
+            "isused": "0"//是否勾选
+          },
+          "logisticscheck": {//订单出货
+            "days": "",
+            "amountrate": "",
+            "isused": "0"
+          },
+          "invoiceapplycheck": {//订单开票
+            "days": "",
+            "amountrate": "",
+            "isused": "0"
+          }
+        }
+      },
+      rules:{
+        point:[
+          { required: false, message: '请选择账期依据', trigger: 'change'},
+        ],
+        amountrate:[
+          { required: false, message: '请输入立账额度比率', trigger: 'blur'},
+          { validator: NumberSize , trigger:'blur'}
+        ],
+        days:[
+          { required: false, message: '请输入后置天数', trigger: 'blur'}
+        ],
+        isdefault:[
+          { required: false, message: '请选择是否默认条件', trigger: 'blur'}
+        ],
+        remarks:[
+          { required: false, message: '请输入描述', trigger: 'blur'}
+        ],
+      },
+      isErrorOrder: false,
+      isErrorLogistics:false,
+      isErrorInvoiceapply:false
+    }
+  },
+  methods:{
+    editBtn () {
+      this.dialogFormVisible = true
+      this.form = Object.assign({},this.form,this.data)
+      console.log(this.form,'form1')
+      if (this.form.accountingnodes){
+       /* this.form.accountingnodes.ordercheck.amountrate = Math.round((this.form.accountingnodes.ordercheck.amountrate*100)*100)/100
+        this.form.accountingnodes.logisticscheck.amountrate = Math.round((this.form.accountingnodes.logisticscheck.amountrate*100)*100)/100
+        this.form.accountingnodes.invoiceapplycheck.amountrate = Math.round((this.form.accountingnodes.invoiceapplycheck.amountrate*100)*100)/100*/
+      }else {
+        this.form.accountingnodes.ordercheck.amountrate = ''
+        this.form.accountingnodes.logisticscheck.amountrate = ''
+        this.form.accountingnodes.invoiceapplycheck.amountrate = ''
+      }
+
+    },
+    checkAmountrate(val,key){
+      if (val > 100 || val < 0){
+        if (key === '订单审核'){
+          this.isErrorOrder = true
+        }else if (key === '订单出货'){
+          this.isErrorLogistics = true
+        }else {
+          this.isErrorInvoiceapply = true
+        }
+      }else {
+        if (key === '订单审核'){
+          this.isErrorOrder = false
+        }else if (key === '订单出货'){
+          this.isErrorLogistics = false
+        }else {
+          this.isErrorInvoiceapply = false
+        }
+      }
+    },
+    onSubmit(){
+      console.log(this.form)
+      const order = this.form.accountingnodes.ordercheck.isused == '1'?this.form.accountingnodes.ordercheck.amountrate:0
+      const logistics = this.form.accountingnodes.logisticscheck.isused == '1'?this.form.accountingnodes.logisticscheck.amountrate:0
+      const invoiceapply = this.form.accountingnodes.invoiceapplycheck.isused == '1'?this.form.accountingnodes.invoiceapplycheck.amountrate:0
+      console.log(order + logistics + invoiceapply)
+      if (parseFloat(order) + parseFloat(logistics) + parseFloat(invoiceapply) !== 100 ){
+        this.$message.error('已选节点立账额度合计需等于100%');
+      }else {
+        this.$refs['form'].validate(async (valid) => {
+          if (!valid) return false
+          /*this.form.amountrate = (this.form.amountrate /100).toFixed(4)*/
+          this.form.accountingnodes.ordercheck.amountrate = (this.form.accountingnodes.ordercheck.amountrate/100).toFixed(4)
+          this.form.accountingnodes.logisticscheck.amountrate = (this.form.accountingnodes.logisticscheck.amountrate/100).toFixed(4)
+          this.form.accountingnodes.invoiceapplycheck.amountrate = (this.form.accountingnodes.invoiceapplycheck.amountrate/100).toFixed(4)
+          const res = await this.$api.requested({
+            "id": "20230110095903",
+            "content": this.form
+          })
+          this.tool.showMessage(res,()=>{
+            this.$emit('onSuccess')
+            this.$refs['form'].resetFields();
+            this.dialogFormVisible = false
+          })
+        })
+      }
+     /* console.log(this.form)
+      this.$refs['form'].validate(async (valid) => {
+        if (!valid) return false
+        this.form.amountrate = (this.form.amountrate /100).toFixed(4)
+        const res = await this.$api.requested({
+          "id": "20230110095903",
+          "version":1,
+          "content": this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+          this.$refs['form'].resetFields();
+          this.dialogFormVisible = false
+        })
+      })*/
+    }
+  }
+}
+</script>
+
+<style scoped>
+.dialog-footer {
+  margin-top: 0;
+}
+.el-select {
+  width: 100% !important;
+}
+</style>

+ 43 - 0
src/HDrpManagement/collectionRule/components/tableColumn.vue

@@ -0,0 +1,43 @@
+<template>
+  <div>
+    <div v-for="(item,index) in data" :key="index">
+      <div v-if="name === 'amountrate'">
+        <span>{{Math.round((item.amountrate * 100)*100)/100}}%</span>
+<!--        <el-divider v-if="index !== data.length -1"></el-divider>-->
+        <div class="remarks-style-line" v-if="index !== data.length -1"></div>
+      </div>
+      <div v-else-if="name === 'days'">
+        <span>{{item.days}}</span>
+        <div class="remarks-style-line" v-if="index !== data.length -1"></div>
+      </div>
+
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "tableColumn",
+  props:['data','name']
+}
+</script>
+
+<style scoped>
+.remarks-style-line{
+  border-bottom: 1px solid #ebeef5;
+  transform: scale(1.25,1);
+  width:100%;height: 5px;
+  line-height: 5px;
+  vertical-align: center;
+  margin-top: -5px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+/deep/ .el-divider--horizontal {
+  display: block;
+  height: 1px;
+  width: 100%;
+  margin: 0;
+}
+</style>

+ 108 - 36
src/HDrpManagement/collectionRule/modules/table.vue

@@ -1,14 +1,16 @@
 <!--  -->
 <template>
-  <div>
+  <div class="bs-table">
     <el-table
+        border stripe
         height="calc(100vh - 330px)"
+        :header-cell-style="{background:'#fafafafa',height:'40px','color':'#000000'}"
         :data="tableData"
-        style="width: 100%">
+        style="width: 100%;font-size: 12px">
       <el-table-column
         prop="ruleno"
         label="收款条件编号"
-        width="200">
+        width="140">
       </el-table-column>
       <el-table-column
           prop="remarks"
@@ -22,44 +24,61 @@
           <el-table-column
             prop="point"
             label="订单审核"
-            width="100">
+            width="70">
             <template slot-scope="scope">
               <div v-if="scope.row.accountingnodes">
-                <div v-if="scope.row.accountingnodes.ordercheck.isused == '1'" style="color: red">是</div>
-                <div v-else>--</div>
+                <div v-if="scope.row.accountingnodes.ordercheck.length > 0">
+                  <div style="color: red">是</div>
+                </div>
+                <div v-else>
+                  <div v-if="scope.row.accountingnodes.ordercheck.isused == '1'" style="color: red">是</div>
+                  <div v-else>--</div>
+                </div>
               </div>
               <div v-else>--</div>
 
 <!--              <div v-if="scope.row.point == '订单审核'" style="color: red">是</div>
-              <div v-else>&#45;&#45;</div>-->
+              <div v-else>--</div>-->
             </template>
           </el-table-column>
           <el-table-column
             prop="amountrate"
             label="立账额度"
-            width="100">
+            style="text-align: center"
+            width="70">
             <template slot-scope="scope">
               <div v-if="scope.row.accountingnodes">
-                <div v-if="scope.row.accountingnodes.ordercheck.amountrate">{{scope.row.accountingnodes.ordercheck.amountrate}}%</div>
-                <div v-else>--</div>
+                <div v-if="scope.row.accountingnodes.ordercheck.length > 0">
+                  <tableColumn :data="scope.row.accountingnodes.ordercheck" name="amountrate"></tableColumn>
+                </div>
+                <div v-else>
+                  <div v-if="scope.row.accountingnodes.ordercheck.amountrate">{{scope.row.accountingnodes.ordercheck.amountrate}}%</div>
+                  <div v-else>--</div>
+                </div>
+
               </div>
               <div v-else>--</div>
 <!--              <div v-if="scope.row.point == '订单审核'">{{scope.row.amountrate * 100}}%</div>
-              <div v-else>&#45;&#45;</div>-->
+              <div v-else>--</div>-->
             </template>
           </el-table-column>
           <el-table-column
             prop="days"
             label="后置天数"
-            width="100">
+            width="70">
             <template slot-scope="scope">
               <div v-if="scope.row.accountingnodes">
-                <div v-if="scope.row.accountingnodes.ordercheck.days">{{scope.row.accountingnodes.ordercheck.days}}</div>
-                <div v-else>--</div>
+                <div v-if="scope.row.accountingnodes.ordercheck.length > 0">
+                  <tableColumn :data="scope.row.accountingnodes.ordercheck" name="days"></tableColumn>
+                </div>
+                <div v-else>
+                  <div v-if="scope.row.accountingnodes.ordercheck.days">{{scope.row.accountingnodes.ordercheck.days}}</div>
+                  <div v-else>--</div>
+                </div>
               </div>
               <div v-else>--</div>
 <!--              <div v-if="scope.row.point == '订单审核'">{{scope.row.days}}</div>
-              <div v-else>&#45;&#45;</div>-->
+              <div v-else>--</div>-->
             </template>
           </el-table-column>
         </el-table-column>
@@ -69,11 +88,16 @@
           <el-table-column
             prop="point"
             label="销售出库审核"
-            width="120">
+            width="100">
             <template slot-scope="scope">
               <div v-if="scope.row.accountingnodes">
-                <div v-if="scope.row.accountingnodes.logisticscheck.isused == '1'" style="color: red">是</div>
-                <div v-else>--</div>
+                <div v-if="scope.row.accountingnodes.logisticscheck.length > 0">
+                  <div style="color: red">是</div>
+                </div>
+                <div v-else>
+                  <div v-if="scope.row.accountingnodes.logisticscheck.isused == '1'" style="color: red">是</div>
+                  <div v-else>--</div>
+                </div>
               </div>
               <div v-else>--</div>
             </template>
@@ -81,11 +105,16 @@
           <el-table-column
               prop="amountrate"
               label="立账额度"
-              width="100">
+              width="70">
             <template slot-scope="scope">
               <div v-if="scope.row.accountingnodes">
-                <div v-if="scope.row.accountingnodes.logisticscheck.amountrate">{{scope.row.accountingnodes.logisticscheck.amountrate}}%</div>
-                <div v-else>--</div>
+                <div v-if="scope.row.accountingnodes.logisticscheck.length > 0">
+                  <tableColumn :data="scope.row.accountingnodes.logisticscheck" name="amountrate"></tableColumn>
+                </div>
+                <div v-else>
+                  <div v-if="scope.row.accountingnodes.logisticscheck.amountrate">{{scope.row.accountingnodes.logisticscheck.amountrate}}%</div>
+                  <div v-else>--</div>
+                </div>
               </div>
               <div v-else>--</div>
             </template>
@@ -93,11 +122,16 @@
           <el-table-column
             prop="days"
             label="后置天数"
-            width="100">
+            width="70">
             <template slot-scope="scope">
               <div v-if="scope.row.accountingnodes">
-                <div v-if="scope.row.accountingnodes.logisticscheck.days">{{scope.row.accountingnodes.logisticscheck.days}}</div>
-                <div v-else>--</div>
+                <div v-if="scope.row.accountingnodes.logisticscheck.length > 0">
+                  <tableColumn :data="scope.row.accountingnodes.logisticscheck" name="days"></tableColumn>
+                </div>
+                <div v-else>
+                  <div v-if="scope.row.accountingnodes.logisticscheck.days">{{scope.row.accountingnodes.logisticscheck.days}}</div>
+                  <div v-else>--</div>
+                </div>
               </div>
               <div v-else>--</div>
             </template>
@@ -109,11 +143,16 @@
           <el-table-column
             prop="point"
             label="发票审核"
-            width="100">
+            width="70">
             <template slot-scope="scope">
               <div v-if="scope.row.accountingnodes">
-                <div v-if="scope.row.accountingnodes.invoiceapplycheck.isused == '1'" style="color: red">是</div>
-                <div v-else>--</div>
+                <div v-if="scope.row.accountingnodes.invoiceapplycheck.length > 0">
+                  <div style="color: red">是</div>
+                </div>
+                <div v-else>
+                  <div v-if="scope.row.accountingnodes.invoiceapplycheck.isused == '1'" style="color: red">是</div>
+                  <div v-else>--</div>
+                </div>
               </div>
               <div v-else>--</div>
             </template>
@@ -121,11 +160,17 @@
           <el-table-column
               prop="amountrate"
               label="立账额度"
-              width="100">
+              width="70">
             <template slot-scope="scope">
               <div v-if="scope.row.accountingnodes">
-                <div v-if="scope.row.accountingnodes.invoiceapplycheck.amountrate">{{scope.row.accountingnodes.invoiceapplycheck.amountrate}}%</div>
-                <div v-else>--</div>
+                <div v-if="scope.row.accountingnodes.invoiceapplycheck.length > 0">
+                  <tableColumn :data="scope.row.accountingnodes.invoiceapplycheck" name="amountrate"></tableColumn>
+                </div>
+                <div v-else>
+                  <div v-if="scope.row.accountingnodes.invoiceapplycheck.amountrate">{{scope.row.accountingnodes.invoiceapplycheck.amountrate}}%</div>
+                  <div v-else>--</div>
+                </div>
+
               </div>
               <div v-else>--</div>
             </template>
@@ -133,11 +178,17 @@
           <el-table-column
             prop="days"
             label="后置天数"
-            width="100">
+            width="70">
             <template slot-scope="scope">
               <div v-if="scope.row.accountingnodes">
-                <div v-if="scope.row.accountingnodes.invoiceapplycheck.days">{{scope.row.accountingnodes.invoiceapplycheck.days}}</div>
-                <div v-else>--</div>
+                <div v-if="scope.row.accountingnodes.invoiceapplycheck.length > 0">
+                  <tableColumn :data="scope.row.accountingnodes.invoiceapplycheck" name="days"></tableColumn>
+                </div>
+                <div v-else>
+                  <div v-if="scope.row.accountingnodes.invoiceapplycheck.days">{{scope.row.accountingnodes.invoiceapplycheck.days}}</div>
+                  <div v-else>--</div>
+                </div>
+
               </div>
               <div v-else>--</div>
             </template>
@@ -147,7 +198,7 @@
       <el-table-column
         prop="isdefault"
         label="是否默认条件"
-        width="120">
+        width="50">
         <template slot-scope="scope">
           <span v-if="scope.row.isdefault" style="color: red">是</span>
           <span v-else>否</span>
@@ -156,7 +207,7 @@
       <el-table-column
        prop="a"
        label="操作"
-       width="150px">
+       width="100px">
        <template slot-scope="scope">
 <!--         <el-button type="text" size="mini" @click="goDetail(scope.row)">详 情</el-button>-->
          <edit :data="scope.row" class="inline-16" @onSuccess="onSuccess"></edit>
@@ -169,13 +220,14 @@
 
 <script>
 import edit from '../components/edit'
+import tableColumn from "@/HDrpManagement/collectionRule/components/tableColumn";
 export default {
   props:['tableData'],
   data () {
     return {
     }
   },
-  components:{edit},
+  components:{edit,tableColumn},
   methods: {
     goDetail (data) {
       let query = {id:data.sa_receivableruleid,rowindex:data.rowindex}
@@ -213,5 +265,25 @@ export default {
 </script>
 
 <style  scoped>
+.search-icon:hover{
+  font-weight: bold;
+  background: #f1f2f3;
+  cursor: pointer;
+}
+
+/deep/.ellipsis {
+  display:-webkit-box;
+  text-overflow:ellipsis;
+  overflow:hidden;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient:vertical;
+}
+
+/deep/.el-table--mini .el-table__cell {
+  padding: 0 !important;
+}
+/deep/.el-table .el-table__cell {
+  padding: 0 !important;
+}
 
 </style>