Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

ZaiZai 7 mēneši atpakaļ
vecāks
revīzija
e61435ad58

+ 2 - 5
src/config/index.json

@@ -1,10 +1,7 @@
 {
     "version": "20230607160059",
-    "target1": "http://127.0.0.1:8090",
-    "target2": "http://192.168.0.125:8090",
-    "target": "http://39.108.216.210:8090",
-    "target4": "http://192.168.0.109:8090",
-    "target5": "http://192.168.0.102:8090",
+    "target": "http://127.0.0.1:8090",
+    "target1": "http://39.108.216.210:8090",
     "smsPhone": "",
     "vite": {
         "port": 5180,

+ 58 - 20
src/views/debit-pay/material/components/order/dataModal.vue

@@ -29,20 +29,27 @@
                                 </el-form-item>
                             </el-col>
                             <el-col :span="8">
-                                <el-form-item label="单价:">
-                                    <el-input v-model="baseForm.price" />
+                                <el-form-item label="单价:" prop="price">
+                                    <el-input v-model="baseForm.price" @blur="handleBlur"/>
                                 </el-form-item>
                             </el-col>
                             <el-col :span="8">
-                                <el-form-item label="数量:">
-                                    <el-input v-model="baseForm.meterAmount" />
+                                <el-form-item label="数量:"  prop="meterAmount" >
+                                    <el-input v-model="baseForm.meterAmount" @blur="handleBlur" ></el-input>
                                 </el-form-item>
                             </el-col>
                             <el-col :span="8">
                                 <el-form-item label="计量金额:">
-                                    <el-input v-model="baseForm.meterMoney" />
+                                    <el-input v-model="baseForm.meterMoney" disabled type='number'/>
                                 </el-form-item>
                             </el-col>
+
+                            <el-col :span="8">
+                                <el-form-item label="合同规定预付款金额:">
+                                    <el-input v-model="baseForm.contractStatedMoney" disabled/>
+                                </el-form-item>
+                            </el-col>
+
                             <el-col :span="8">
                                 <el-form-item label="业务日期:" prop="businessDate">
                                     <el-date-picker v-model="baseForm.businessDate" class="block" format="YYYY-MM-DD" type="date" value-format="YYYY-MM-DD" />
@@ -84,7 +91,7 @@
                                     <el-input v-model="baseForm.certificate" />
                                 </el-form-item>
                             </el-col>
-                            <el-col :span="16">
+                            <el-col :span="8">
                                 <el-form-item label="备注:">
                                     <el-input v-model="baseForm.remark" />
                                 </el-form-item>
@@ -230,10 +237,18 @@ const getTreeData = async ()=>{
 }
 const treeItem = ref({})
 const treeClick = ({ node, data, keys })=>{
+    console.log(data.value?.materialName)
+    console.log(!treeItem.value?.clPrepaymentRatio)
+    if (data.value?.materialName && !treeItem.value?.clPrepaymentRatio) {
+        window.$message.warning('请联系管理员设置材料预付款百分比!')
+        return
+    }
+
     treeItem.value = data
     baseForm.value.contractMaterialName = data.materialName
-    baseForm.value.price = data.price
-
+    handleBlur()
+    //由于业务需求改变,不需要回显示 单价
+   // baseForm.value.price = data.price
 }
 
 //基础表单
@@ -245,16 +260,14 @@ const baseFormRules = {
         trigger: 'blur',
         message: '请输入材料到场编号',
     },
-    meterAmount: {
-        required: true,
-        trigger: 'blur',
-        message: '请输入数量',
-    },
-    price: {
-        required: true,
-        trigger: 'blur',
-        message: '请输入单价',
-    },
+    meterAmount:[
+        { required:true , message:'请输入数量',trigger:'blur'},
+        { pattern: /^[0-9.]*$/,message:'数量需为数字',trigger:'blur'}
+    ],
+    price:[
+        { required:true , message:'请输入单价',trigger:'blur'},
+        { pattern: /^[0-9.]*$/,message:'单价需为数字',trigger:'blur'}
+    ],
     businessDate: {
         required: true,
         trigger: 'blur',
@@ -272,6 +285,26 @@ const baseFormRules = {
     },
 
 }
+
+// 计算金额
+const handleBlur = async () => {
+    console.log(treeItem.value?.clPrepaymentRatio)
+    if ( baseForm.value?.price && baseForm.value?.meterAmount ) {
+        baseForm.value.meterMoney = Math.round(baseForm.value.price * baseForm.value.meterAmount)
+
+        if ( treeItem.value?.clPrepaymentRatio ) {
+            baseForm.value.contractStatedMoney = Math.round(baseForm.value.meterMoney * treeItem.value?.clPrepaymentRatio / 100)
+        } else {
+            baseForm.value.contractStatedMoney = 0
+            window.$message.warning('请先选择左侧节点')
+            return
+        }
+    } else {
+        baseForm.value.meterMoney = 0
+        baseForm.value.contractStatedMoney = 0
+    }
+}
+
 const modalSaving = ref(false)
 const modalSave = async () => {
     if (!treeItem.value?.id && ids.value.length < 1) {
@@ -350,6 +383,11 @@ const modalClose = () => {
 }
 </script>
 
-<style scoped lang="scss">
-
+<style scoped>
+    .el-form-item__label {
+        line-height: 1 !important; /* 重置默认的行高 */
+    }
+    .el-input {
+    vertical-align: middle; /* 使input垂直居中对齐 */
+    }
 </style>

+ 10 - 8
src/views/debit-pay/material/order.vue

@@ -69,23 +69,25 @@
                         <tr>
                             <hc-info-table-td center is-title>计量金额:</hc-info-table-td>
                             <hc-info-table-td width="120px">{{ infoData?.meterMoney }}</hc-info-table-td>
-                            <hc-info-table-td center is-title>进料发票(单据)号:</hc-info-table-td>
-                            <hc-info-table-td width="120px">{{ infoData?.storagePlace }}</hc-info-table-td>
+                            <hc-info-table-td center is-title>合同规定预付款金额:</hc-info-table-td>
+                            <hc-info-table-td width="120px">{{ infoData?.contractStatedMoney }}</hc-info-table-td>
                         </tr>
                         <tr>
-                            <hc-info-table-td center is-title>质保书编号:</hc-info-table-td>
+                            <hc-info-table-td center is-title>备料堆放地点:</hc-info-table-td>
+                            <hc-info-table-td width="120px">{{ infoData?.storagePlace }}</hc-info-table-td>
+                            <hc-info-table-td center is-title>存储情况:</hc-info-table-td>
                             <hc-info-table-td width="120px">{{ infoData?.storageStatus }}</hc-info-table-td>
-                            <hc-info-table-td center is-title>材料来源:</hc-info-table-td>
-                            <hc-info-table-td width="120px">{{ infoData?.materialSource }}</hc-info-table-td>
                         </tr>
                         <tr>
+                            <hc-info-table-td center is-title>材料来源:</hc-info-table-td>
+                            <hc-info-table-td width="120px">{{ infoData?.materialSource }}</hc-info-table-td>
                             <hc-info-table-td center is-title>材料是否符合要求:</hc-info-table-td>
                             <hc-info-table-td width="120px">{{ infoData?.materialConformName }}</hc-info-table-td>
-                            <hc-info-table-td center is-title>存储方法是否符合要求:</hc-info-table-td>
-                            <hc-info-table-td width="120px">{{ infoData?.storageConformName }}</hc-info-table-td>
                         </tr>
                         <tr>
-                            <hc-info-table-td center is-title>抽检报告编号:</hc-info-table-td>
+                            <hc-info-table-td center is-title>存储方法是否符合要求:</hc-info-table-td>
+                            <hc-info-table-td width="120px">{{ infoData?.storageConformName }}</hc-info-table-td>
+                            <hc-info-table-td center is-title>合格证号:</hc-info-table-td>
                             <hc-info-table-td width="auto" colspan="3">{{ infoData?.certificate }}</hc-info-table-td>
                         </tr>
                         <tr>