Explorar el Código

合同计量单元修改

duy hace 1 año
padre
commit
7299ef1b2b
Se han modificado 1 ficheros con 17 adiciones y 1 borrados
  1. 17 1
      src/views/project/debit/contract/components/unit/row-data.vue

+ 17 - 1
src/views/project/debit/contract/components/unit/row-data.vue

@@ -92,7 +92,7 @@
                 <div style="height: 400px;">
                     <hc-table :column="tableColumn" :datas="tableData" is-new :index-style="{ width: 60 }" :row-style="tableRowStyle" :is-stripe="false">
                         <template #poseNum="{ row }">
-                            <hc-table-input v-model="row.poseNum" />
+                            <hc-table-input v-model="row.poseNum" @change="changePoseNum(row)" />
                         </template>
                         <template #action="{ row, index }">
                             <el-link type="danger" @click="delRow(row, index)">删除</el-link>
@@ -146,9 +146,19 @@ const tableData = ref([])
 //设置某一行的样式
 const tableRowStyle = ({ row, rowIndex }) => {
     if (row.poseNum > row.contractTotal) {
+        isCanSave.value = true
         return '--el-table-tr-bg-color: #fe0000;color:white '
     }
 }
+const isCanSave = ref(false)
+const changePoseNum = (row)=>{
+    row.residueNum = row.changeTotal - row.poseNum
+    if (row.poseNum > row.contractTotal) {
+        isCanSave.value = true
+    } else {
+        isCanSave.value = false
+    }
+}
 //获节点类型
 const nodeOptions = ref([])
 const getNodeType = async (id) => {
@@ -218,7 +228,13 @@ const tableColumn = ref([
 //     { key1: '101-1-a' },
 // ])
 const addNodeLoading = ref(false)
+
 const modalSave = async () => {
+  console.log(isCanSave.value, 'const isCanSave = ref(false)')
+  if (isCanSave.value) {
+    window.$message.warning('累计分解量 > 合同变更后量,不允许修改')
+    return
+  }
     addNodeLoading.value = true
     const { error, code, msg } = await unitApi.updateForm({
             ...formModel.value,