huangfuli 3 лет назад
Родитель
Сommit
217e9a6322

+ 68 - 40
src/views/contractManagement/purchaseContractAdd.vue

@@ -76,6 +76,12 @@
         <ws-form-item label="交货方式" span="1" prop="seller" class="readonly">
           <el-radio v-model="deptBudgetList.deliverType" label="1">我方自提</el-radio>
           <el-radio v-model="deptBudgetList.deliverType" label="2">对方送货</el-radio>
+          <!-- <el-radio v-model="deptBudgetList.deliverType" v-if="deptBudgetList.priceType == '随行就市'" disabled label="1">
+              我方自提</el-radio>
+            <el-radio v-model="deptBudgetList.deliverType" v-else label="1">我方自提</el-radio>
+            <el-radio v-model="deptBudgetList.deliverType" v-if="deptBudgetList.priceType == '随行就市'" disabled label="2">
+              对方送货</el-radio>
+            <el-radio v-model="deptBudgetList.deliverType" v-else label="2">对方送货</el-radio> -->
         </ws-form-item>
          <!--卖方-->
         <ws-form-item label="卖方" span="1" prop="seller" class="readonly">
@@ -175,14 +181,20 @@
           <ws-date-picker v-model="deptBudgetList.deliveryDateEnd" type="date" placeholder="请选择交货日期(止)"
             value-format="yyyy-MM-dd" />
         </ws-form-item>
+        <!--价格类型-->
+          <ws-form-item label="价格类型" span="1" prop="priceType">
+            <ws-select v-model="deptBudgetList.priceType" placeholder="请选择价格类型" @change="selectpriceType">
+              <ws-option v-for="item in priceTypeList" :key="item" :label="item" :value="item" />
+            </ws-select>
+          </ws-form-item>
         <!--合同单价(元/吨)-->
-        <ws-form-item class="readonly" label="合同单价(元/吨)" span="1" prop="unitContractPrice">
+        <ws-form-item class="readonly" label="合同单价(元/吨)" span="1" prop="unitContractPrice" v-if="deptBudgetList.priceType == '定价销售'">
           <ws-input @input="pricechange" v-model="deptBudgetList.unitContractPrice" placeholder="请输入合同单价"
             maxlength="100" size="small" />
         </ws-form-item>
 
         <!--合同总价-->
-        <ws-form-item label="合同总价" span="1" prop="totalContractPrice">
+        <ws-form-item label="合同总价" span="1" prop="totalContractPrice" v-if="deptBudgetList.priceType == '定价销售'">
           <ws-input v-model="deptBudgetList.totalContractPrice" placeholder="请输入合同总价" maxlength="100" size="small" />
         </ws-form-item>
 
@@ -465,6 +477,7 @@
           },
         ],
         contractNoList: [],
+        priceTypeList: ['定价销售', '随行就市'],
         goodnameList: [],
         value1: '袋装',
         value2: '未回收',
@@ -546,6 +559,11 @@
       if (!this.restaurants4) this.restaurants4 = [];
     },
     methods: {
+      selectpriceType(e) {
+        if (e == '随行就市') {
+          this.deptBudgetList.deliverType = '1'
+        }
+      },
       feedbackLeaderChange(e){
         this.deptBudgetList.feedbackLeader = this.feedbackLeaders[e].staffName
         this.deptBudgetList.feedbackLeaderPhone = this.feedbackLeaders[e].staffMobilePhone
@@ -1006,49 +1024,59 @@
           })
           return
         }
-        if (!this.deptBudgetList.unitContractPrice) {
-          this.$message({
-            message: '请输入合同单价!',
-            type: 'warning',
-          })
-          return
-        }
-        if (
-          isNaN(this.deptBudgetList.unitContractPrice) ||
-          (String(this.deptBudgetList.unitContractPrice).indexOf('.') != -1 &&
-            String(this.deptBudgetList.unitContractPrice).length -
-            (String(this.deptBudgetList.unitContractPrice).indexOf('.') + 1) >
-            2) ||
-          this.deptBudgetList.unitContractPrice <= 0 ||
-          this.deptBudgetList.unitContractPrice > 10000
-        ) {
-          this.$message({
-            message: '合同单价输入有误!',
-            type: 'warning',
-          })
-          return
-        }
-        if (!this.deptBudgetList.totalContractPrice) {
+        if (!this.deptBudgetList.priceType) {
           this.$message({
-            message: '请输入合同总价!',
+            message: '请选择价格类型',
             type: 'warning',
           })
           return
         }
-        if (
-          isNaN(this.deptBudgetList.totalContractPrice) ||
-          (String(this.deptBudgetList.totalContractPrice).indexOf('.') != -1 &&
-            String(this.deptBudgetList.totalContractPrice).length -
-            (String(this.deptBudgetList.totalContractPrice).indexOf('.') + 1) >
-            2) ||
-          this.deptBudgetList.totalContractPrice <= 0 ||
-          this.deptBudgetList.totalContractPrice > 1000000000
-        ) {
-          this.$message({
-            message: '合同总价输入有误!',
-            type: 'warning',
-          })
-          return
+        if (this.deptBudgetList.priceType == '定价销售') {
+          if (!this.deptBudgetList.unitContractPrice) {
+            this.$message({
+              message: '请输入合同单价!',
+              type: 'warning',
+            })
+            return
+          }
+          if (
+            isNaN(this.deptBudgetList.unitContractPrice) ||
+            (String(this.deptBudgetList.unitContractPrice).indexOf('.') != -1 &&
+              String(this.deptBudgetList.unitContractPrice).length -
+              (String(this.deptBudgetList.unitContractPrice).indexOf('.') + 1) >
+              2) ||
+            this.deptBudgetList.unitContractPrice <= 0 ||
+            this.deptBudgetList.unitContractPrice > 10000
+          ) {
+            this.$message({
+              message: '合同单价输入有误!',
+              type: 'warning',
+            })
+            return
+          }
+          if (!this.deptBudgetList.totalContractPrice) {
+            this.$message({
+              message: '请输入合同总价!',
+              type: 'warning',
+            })
+            return
+          }
+          if (
+            isNaN(this.deptBudgetList.totalContractPrice) ||
+            (String(this.deptBudgetList.totalContractPrice).indexOf('.') != -1 &&
+              String(this.deptBudgetList.totalContractPrice).length -
+              (String(this.deptBudgetList.totalContractPrice).indexOf('.') +
+                1) >
+              2) ||
+            this.deptBudgetList.totalContractPrice <= 0 ||
+            this.deptBudgetList.totalContractPrice > 1000000000
+          ) {
+            this.$message({
+              message: '合同总价输入有误!',
+              type: 'warning',
+            })
+            return
+          }
         }
         if (!this.newSelectedOptions) {
           this.$message({

+ 6 - 2
src/views/contractManagement/purchaseContractEdit.vue

@@ -131,14 +131,18 @@
           <ws-date-picker v-model="deptBudgetList.deliveryDateEnd" type="date" placeholder="请选择交货日期(止)"
             value-format="yyyy-MM-dd" />
         </ws-form-item>
+        <!--价格类型-->
+          <ws-form-item label="价格类型" span="1" prop="priceType">          
+              {{ deptBudgetList.priceType }}
+          </ws-form-item>
         <!-- 合同单价(元/吨) -->
-        <ws-form-item class="readonly" label="合同单价(元/吨)" span="1" prop="unitContractPrice">
+        <ws-form-item class="readonly" label="合同单价(元/吨)" span="1" prop="unitContractPrice" v-if="deptBudgetList.priceType == '定价销售'">
           <span v-if="deptBudgetList.unitContractPrice != 'null'">{{
             deptBudgetList.unitContractPrice
           }}</span>
         </ws-form-item>
         <!-- 合同总价(元) -->
-        <ws-form-item label="合同总价(元)" span="1" prop="totalContractPrice">
+        <ws-form-item label="合同总价(元)" span="1" prop="totalContractPrice" v-if="deptBudgetList.priceType == '定价销售'">
           <ws-input v-model="deptBudgetList.totalContractPrice" maxlength="100" placeholder="请输入合同单价" size="small" />
         </ws-form-item>
         <!-- 货源所在地区 -->

+ 5 - 2
src/views/contractManagement/purchaseContractExamine.vue

@@ -95,10 +95,13 @@
         <ws-form-item label="交货日期(止)" span="1" prop="deliveryDateEnd">
           {{ deptBudgetList.deliveryDateEnd }}
         </ws-form-item>
-        <ws-form-item label="合同单价(元/吨)" span="1" prop="unitContractPrice">
+        <ws-form-item label="价格类型" span="1" prop="priceType">
+          {{ deptBudgetList.priceType }}
+        </ws-form-item>
+        <ws-form-item label="合同单价(元/吨)" span="1" prop="unitContractPrice" v-if="deptBudgetList.priceType == '定价销售'">
           {{ deptBudgetList.unitContractPrice }}
         </ws-form-item>
-        <ws-form-item label="合同总价(元)" span="1" prop="totalContractPrice">
+        <ws-form-item label="合同总价(元)" span="1" prop="totalContractPrice" v-if="deptBudgetList.priceType == '定价销售'">
           {{ deptBudgetList.totalContractPrice }}
         </ws-form-item>
         <ws-form-item label="货源所在地区" span="1">

+ 8 - 4
src/views/contractManagement/salesContractEdit.vue

@@ -165,17 +165,21 @@
             <ws-date-picker v-model="deptBudgetList.deliveryDateEnd" type="date" placeholder="请选择交货日期(止)"
               value-format="yyyy-MM-dd" />
           </ws-form-item>
-
+          <!--价格类型-->
+          <ws-form-item label="价格类型" span="1" prop="priceType">
+            <div class="unchanged">
+              {{ deptBudgetList.priceType }}
+            </div>
+          </ws-form-item>
           <!--合同单价(元/吨)-->
-          <ws-form-item label="合同单价(元/吨)" span="1" prop="contractNo">
+          <ws-form-item label="合同单价(元/吨)" span="1" prop="contractNo" v-if="deptBudgetList.priceType == '定价销售'">
             <div class="unchanged">
               {{ deptBudgetList.unitContractPrice }}
             </div>
             <span class="unchangeable">*</span>
           </ws-form-item>
-
           <!--合同总价-->
-          <ws-form-item label="合同总价" span="1" prop="contractNo">
+          <ws-form-item label="合同总价" span="1" prop="totalContractPrice" v-if="deptBudgetList.priceType == '定价销售'">
             <ws-input v-model="deptBudgetList.totalContractPrice" placeholder="请输入合同总价" maxlength="100" size="small" />
           </ws-form-item>
           <!--签订日期-->

+ 7 - 3
src/views/contractManagement/salesContractExamine.vue

@@ -139,13 +139,17 @@
               {{ deptBudgetList.deliveryDateEnd }}
             </div>
           </ws-form-item>
-          <ws-form-item label="合同单价(元/吨)" span="1" prop="unitContractPrice">
+          <ws-form-item label="价格类型" span="1" prop="priceType">
+            <div class="unchanged">
+              {{ deptBudgetList.priceType }}
+            </div>
+          </ws-form-item>
+          <ws-form-item label="合同单价(元/吨)" span="1" prop="unitContractPrice" v-if="deptBudgetList.priceType == '定价销售'">
             <div class="unchanged">
               {{ deptBudgetList.unitContractPrice }}
             </div>
           </ws-form-item>
-
-          <ws-form-item label="合同总价(元)" span="1" prop="totalContractPrice">
+          <ws-form-item label="合同总价(元)" span="1" prop="totalContractPrice" v-if="deptBudgetList.priceType == '定价销售'">
             <div class="unchanged">
               {{ deptBudgetList.totalContractPrice }}
             </div>