ソースを参照

Merge remote-tracking branch 'origin/master'

ZaiZai 1 年間 前
コミット
dfa0055d80

+ 10 - 4
src/components/hc-tasks-user/index.vue

@@ -13,7 +13,7 @@
         <!-- 选择任务人 -->
         <el-dialog v-model="showModal" title="选择任务人" width="62rem" class="hc-modal-border hc-modal-nop" draggable destroy-on-close append-to-body>
             <div class="hc-tasks-user-modal-content-box">
-                <div class="tasks-name-box">
+                <div v-if="UserDataList.length > 0 || isShowTaskName" class="tasks-name-box">
                     <p class="mb-2">创建任务人流程</p>
                     <div class="flex pt-2">
                         <el-input v-model="taskNameinput" placeholder="请输入" size="default" class="mr-4" />  
@@ -21,7 +21,7 @@
                     </div>
                     <div class="task-list-box">
                         <div v-for="(item, index) in taskNameList" class="task-list-box-item">
-                            <el-tooltip :content="item.type === 1 ? '平行审批' : '任务审批'" placement="right">
+                            <el-tooltip :content="item.type === 2 ? '流程审批' : '平行审批'" placement="right">
                                 <el-button size="default">
                                     {{ item.title }}
                                     <HcIcon v-if="item.type === 1" name="links" class="ml-2" @click="item.type = 2" />
@@ -146,10 +146,14 @@ const props = defineProps({
         type: [String, Number],
         default: '',
     },
+    isShowTaskName:{
+        type:Boolean,
+        default:false,
+    },
 })
-
 //事件
 const emit = defineEmits(['change'])
+const isShowTaskName = ref(props.isShowTaskName)
 //变量
 const showModal = ref(false)
 const sequenceModal = ref(false)
@@ -172,10 +176,12 @@ watch(() => [
     props.users,
     props.projectId,
     props.contractId,
-], ([users, pid, cid]) => {
+    props.isShowTaskName,
+], ([users, pid, cid, ishow]) => {
     projectId.value = pid
     contractId.value = cid
     setUserDataList(users)
+    isShowTaskName.value = ishow
 })
 
 //渲染完成

+ 54 - 49
src/views/debit-pay/admin/components/middlepay/addModal.vue

@@ -89,7 +89,7 @@
                                 <span>添加清单</span>
                             </el-button>
                         </template>
-                        <hc-table is-new :index-style="{ width: 60 }" :is-stripe="false" :column="addTableColumn" :datas="addTableData" :row-style="addTableRowStyle">
+                        <hc-table :key="tableKey" is-new :index-style="{ width: 60 }" :is-stripe="false" :column="addTableColumn" :datas="addTableData" :row-style="addTableRowStyle">
                             <template #currentPrice="{ row }">
                                 <hc-table-input v-model="row.currentPrice" disabled />
                             </template>
@@ -153,7 +153,7 @@ import { nextTick, ref, watch } from 'vue'
 import { isNumberReg } from '~uti/tools'
 import HcBillBaseModal from './addBillBaseModal.vue'
 import qualityRleation from './qualityRleation.vue'
-import { arrDelKey, arrToId, arrToKey, deepClone, getArrValue, getObjValue, getRandom, isArrIndex, isNullES } from 'js-fast-way'
+import { arrDelKey, arrToId, arrToKey, deepClone, getArrValue, getObjValue, getRandom, getUUID, isArrIndex, isNullES } from 'js-fast-way'
 import BigNumber from 'bignumber.js'
 import { getHeader } from 'hc-vue3-ui'
 
@@ -273,9 +273,11 @@ const baseFormRules = {
     },
 }
 const isRelationData = ref(false)//是否管理质检资料
+const tableKey = ref(getUUID())
 //监听
 watch(() => baseForm.value.fileList, (list) => {
     console.log(list, 'list')
+    tableKey.value = getUUID()
     // 验证数组中的对象是否包含名为 'selectId' 的字段
 const fieldName = 'selectId'
 
@@ -289,9 +291,16 @@ if (containsField) {
 } else {
   isRelationData.value = false
   addTableData.value.forEach((ele)=>{
-    ele.upPayRatio = ele.oldupPayRatio
+    ele.upPayRatio = ele.oldupPayRatio || '0.00'
   })
 }
+nextTick(()=>{
+    console.log(isComparedRaVal.value, 'isComparedRaVal.value ')
+    if (isComparedRaVal.value === 1 ) {
+        window.$message.warning('累计计量金额超出支付比列,如需计量100%,请完成关联对应的质保资料')
+    }
+})
+
 }, { deep: true })
 //获取数据详情
 const selectId = ref('')
@@ -448,7 +457,7 @@ const addTableColumn = ref([
     { key: 'payRatio', name: '支付比例(%)', width: '140' },
     { key: 'containChangeTotal', name: '含变更数量', width: '100' },
     { key: 'currentMeterMoney', name: '本期计量金额', width: '120' },
-    { key: 'allMeterTotal', name: '累计计量', width: '100' },
+    { key: 'allMeterTotal', name: '累计计量', width: '100' },
     { key: 'otherMeterTotal', name: '基数', width: '80' },
     { key: 'action', name: '操作', fixed: 'right', width: 80, align: 'center' },
 ])
@@ -464,7 +473,6 @@ const currentMeterTotalBlur = (row) => {
     }
     //计算本期计量金额
     nextTick(() => {
-     
         row.currentMeterTotal = currentMeterTotal
         row.currentMeterMoney = (BigNumber(currentMeterTotal).multipliedBy(row.currentPrice)).toString()
         row.allMeterTotal = (BigNumber(currentMeterTotal).plus(row.otherMeterTotal)).toString()
@@ -477,34 +485,7 @@ const currentMeterTotalBlur = (row) => {
         //计算本期支付比例
         //本期支 付比例=本期计量数量/变更后数量
         row.payRatio = BigNumber(currentMeterTotal).dividedBy(row.changeTotal).toString() * 100
-
-        // 每次填写完 本期计量数量或者支付比例后
-        // 就去对比:本期支付比例+其他期支付比例
-        //             是否大于最大支付比例
-        // 如果大于,则提示
-
-           let payRatio = new BigNumber(row.payRatio )//本期支付比例
-           let upPayRatio = new BigNumber(row.upPayRatio )//最大支付比例
-           let otherPayRatio = new BigNumber(row.otherPayRatio )//其他期支付比例
-           let result = BigNumber(payRatio).plus(otherPayRatio)//本期支付比例+其他期支付比例
-           const isComparedRa = result.comparedTo(upPayRatio)
-           console.log(isComparedRa, 'isCompared3333333')
-           isComparedRaVal.value = isComparedRa
-               // //a 大于 b = 1,a 等于 b = 0,a 小于 b = -1, a 或 b 的值异常时 = null
-        if (isComparedRa === 1 || isComparedRa === null) {
-            isCanSave.value = true
-          
-           window.$message.warning('累计计量金额超出支付比列,如需计量100%,请完成关联对应的质保资料')
-            // return '--el-table-tr-bg-color: #fe0000; --el-table-row-hover-bg-color: #fe0000; color: white;'
-            
-        
-        } else {
-            isCanSave.value = false
-           
-        }
-
-
-     
+        compareRowUnpayRatio(row, 1)
 
     })
 }
@@ -520,12 +501,11 @@ const containChangeTotalBlur = (row) => {
         row.containChangeTotal = val
     })
 }
-const unPayRatioBlur = (row)=>{
-    nextTick(()=>{
-        console.log(row, 'row')
-        
-        // 计算方式:
+const compareRowUnpayRatio = (row, type)=>{
+          // 计算方式:
         //本期支 付比例=本期计量数量/变更后数量
+        //本期支付比例=本期计量数量/变更后数量
+        //本期计量数量=本期支付比例*变更后数量
         // 会返回最大支付比例   upPayRatio
         //     和其他期支付比例 otherPayRatio
 
@@ -533,28 +513,45 @@ const unPayRatioBlur = (row)=>{
         // 就去对比:本期支付比例+其他期支付比例
         //             是否大于最大支付比例
         // 如果大于,则提示
-           let changeTotal = new BigNumber(row.changeTotal )//变更后数量
            let payRatio = new BigNumber(row.payRatio )//本期支付比例
            let upPayRatio = new BigNumber(row.upPayRatio )//最大支付比例
            let otherPayRatio = new BigNumber(row.otherPayRatio )//其他期支付比例
            let result = BigNumber(payRatio).plus(otherPayRatio)//本期支付比例+其他期支付比例
-             // 本期计量数量=本期支付比例*变更后数量
-            row.currentMeterTotal = (payRatio.dividedBy(100).multipliedBy(changeTotal)).toString()
            const isComparedRa = result.comparedTo(upPayRatio)
            isComparedRaVal.value = isComparedRa
-           console.log(isComparedRa, 'isComparedRa')
-               // //a 大于 b = 1,a 等于 b = 0,a 小于 b = -1, a 或 b 的值异常时 = null
-        if (isComparedRa === 1 || isComparedRa === null) {
-            isCanSave.value = true
           
-           window.$message.warning('累计计量金额超出支付比列,如需计量100%,请完成关联对应的质保资料')
-            // return '--el-table-tr-bg-color: #fe0000; --el-table-row-hover-bg-color: #fe0000; color: white;'
-            
+            if (isComparedRa === 1 ) {
+                isCanSave.value = true
+                if (type === 1) {
+                    window.$message.warning('累计计量金额超出支付比列,如需计量100%,请完成关联对应的质保资料')
+                } else if (type === 2) {
+                    return isComparedRa
+                }
         
         } else {
             isCanSave.value = false
            
         }
+}
+const unPayRatioBlur = (row)=>{
+    nextTick(()=>{
+        console.log(row, 'rowzhifubili')
+        let payRatio = new BigNumber(row.payRatio )//本期支付比例
+        let changeTotal = new BigNumber(row.changeTotal )//变更后数量
+        // 本期计量数量=本期支付比例*变更后数量
+        row.currentMeterTotal = (payRatio.dividedBy(100).multipliedBy(changeTotal)).toString()
+        row.currentMeterMoney = (BigNumber(row.currentMeterTotal).multipliedBy(row.currentPrice)).toString()//本期计量金额额
+        row.allMeterTotal = (BigNumber(row.currentMeterTotal).plus(row.otherMeterTotal)).toString()
+         // 就去对比:本期支付比例+其他期支付比例
+        //   是否大于最大支付比例
+        compareRowUnpayRatio(row, 1)
+         
+        //计算总计量金额
+        let meterMoney = 0, table = addTableData.value
+        for (let i = 0; i < table.length; i++) {
+            meterMoney = (BigNumber(meterMoney).plus(table[i].currentMeterMoney)).toString()
+        }
+        baseForm.value.meterMoney = meterMoney
 
            
     })
@@ -564,9 +561,11 @@ const unPayRatioBlur = (row)=>{
 const isCanSave = ref(false)
 
 const addTableRowStyle = ({ row }) => {
+    console.log(row, 'xuan')
     //本期支付比例+其他期支付比例
      //  是否大于最大支付比例
-    if ( isComparedRaVal.value === 1 || isComparedRaVal.value === null) {
+      const isComparedRa = compareRowUnpayRatio(row, 2)
+        if (isComparedRa === 1 ) {
             isCanSave.value = true
           
             return '--el-table-tr-bg-color: #fe0000; --el-table-row-hover-bg-color: #fe0000; color: white;'
@@ -748,6 +747,7 @@ const addModalClose = () => {
     baseForm.value = { fileList: [], pictureUrl: '' }
     addTableData.value = []
     selectId.value = ''
+    isComparedRaVal.value = null
     setStoreValue('checkRows', [])
     emit('close')
 }
@@ -770,10 +770,15 @@ const closeQual = ()=>{
     qualityMoadal.value = false
 }
 const finishModal = (rows, cancelcheck)=>{
+    console.log(rows, 'rows')
     let fileList = []
     rows.forEach(ele => {
         const isPush = isArrIndex( baseForm.value.fileList, 'selectId', ele.selectId)
         if (!isPush) {
+            if (!ele.evisaPdfUrl && !ele.pdfUrl) {
+                window.$message.warning('该节点没有资料信息')
+                return
+            }
             fileList.push({
                 fileName:ele.dataName,
                 filePdfUrl:ele.evisaPdfUrl ? ele.evisaPdfUrl : ele.pdfUrl,	

+ 1 - 1
src/views/tasks/flow.vue

@@ -22,7 +22,7 @@
                     <el-input v-model="flowFormData.fixedFlowName" placeholder="请输入流程名称" />
                 </el-form-item>
                 <el-form-item label="任务人" prop="linkUserJoinString">
-                    <hc-tasks-user :contract-id="contractId" :project-id="projectId" :users="flowFormData.linkUserJoinString" ui="w-full" @change="tasksUserChange" />
+                    <hc-tasks-user :contract-id="contractId" :project-id="projectId" :users="flowFormData.linkUserJoinString" ui="w-full" :is-show-task-name="true" @change="tasksUserChange" />
                 </el-form-item>
             </el-form>
             <template #footer>