瀏覽代碼

修改bug

chenrui 1 年之前
父節點
當前提交
116af32140

+ 23 - 10
src/views/productManagement/productPricing/editModal.vue

@@ -42,7 +42,7 @@
               id="productPricingEdit-afterCityPrice"
               v-model="form.afterCityPrice"
               :precision="2"
-              :min="form.afterProvincePrice||0.01"
+              :min="0.01"
               :max="999999"
               placeholder="请输入市级价"
               ref="afterCityPrice"
@@ -54,7 +54,7 @@
               id="productPricingEdit-afterSpecialPrice"
               v-model="form.afterSpecialPrice"
               :precision="2"
-              :min="form.afterCityPrice||0.01"
+              :min="0.01"
               :max="999999"
               placeholder="请输入特约价"
               ref="afterSpecialPrice"
@@ -66,7 +66,7 @@
               id="productPricingEdit-afterTerminalPrice"
               v-model="form.afterTerminalPrice"
               :precision="2"
-              :min="form.afterSpecialPrice||0.01"
+              :min="0.01"
               :max="999999"
               placeholder="请输入终端价"
               ref="afterTerminalPrice"
@@ -78,7 +78,7 @@
               id="productPricingEdit-afterCarOwnersPrice"
               v-model="form.afterCarOwnersPrice"
               :precision="2"
-              :min="form.afterTerminalPrice||0.01"
+              :min="0.01"
               :max="999999"
               placeholder="请输入车主价"
               ref="afterCarOwnersPrice"
@@ -131,11 +131,11 @@ export default {
         wrapperCol: { span: 17 }
       },
       form: {
-        afterProvincePrice: '',
-        afterCityPrice: '',
-        afterSpecialPrice: '',
-        afterTerminalPrice: '',
-        afterCarOwnersPrice: '',
+        afterProvincePrice: '', // 省级价
+        afterCityPrice: '', // 市级价
+        afterSpecialPrice: '', // 特约价
+        afterTerminalPrice: '', // 终端价
+        afterCarOwnersPrice: '', // 车主价
         changeReason: undefined
       },
       rules: {
@@ -173,11 +173,24 @@ export default {
         }
       })
     },
-    // 保存
+    // 保存    定价规则==>省级价<市级价<特约价<终端价<车主价
     handleSave () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
+          const newFormData = _this.form
+          if (newFormData.afterCityPrice * 1 < newFormData.afterProvincePrice * 1 || newFormData.afterCityPrice * 1 > newFormData.afterSpecialPrice * 1) {
+            _this.$message.error({ content: '价格设置规则:省级价≤市级价≤特约价', duration: 5 })
+            return
+          }
+          if (newFormData.afterTerminalPrice && newFormData.afterTerminalPrice * 1 < newFormData.afterSpecialPrice * 1) {
+            _this.$message.error({ content: '价格设置规则:特约价≤终端价', duration: 5 })
+            return
+          }
+          if (newFormData.afterCarOwnersPrice && newFormData.afterCarOwnersPrice * 1 < newFormData.afterTerminalPrice * 1) {
+            _this.$message.error({ content: '价格设置规则:终端价≤车主价', duration: 5 })
+            return
+          }
           const form = JSON.parse(JSON.stringify(_this.form))
           form.id = this.detailData.id || undefined
           form.productSn = _this.itemSn

+ 27 - 25
src/views/promotionRulesManagement/dealerPromotions/tableType3.vue

@@ -100,14 +100,15 @@
       <!-- 省价折扣 -->
       <template slot="provinceDiscount" slot-scope="text, record">
         <div v-if="record.dataSourceOrigin=='0'">
-          <a-input
-            v-model="record.provinceDiscountRate"
-            style="width:80%;"
-            type="number"
-            @input="record.provinceDiscountRate=record.provinceDiscountRate.match(/^\d{1,4}(\.?\d{0,2})/g) ? record.provinceDiscountRate.match(/^\d{1,4}(\.?\d{0,2})/g)[0] : ''"
-            :min="0"
-            placeholder="请输入"
-            size="small"/>%
+            <a-input-number
+              size="small"
+              style="width:80%;"
+              v-model="record.provinceDiscountRate"
+              :min="0"
+              :step="1"
+              :precision="2"
+              placeholder="请输入"
+              :max="999999"/>%
         </div>
         <span v-else>{{ (record.provinceDiscountRate||record.provinceDiscountRate==0)?record.provinceDiscountRate+'%':'--' }}</span>
       </template>
@@ -130,14 +131,15 @@
       <!-- 市价折扣 -->
       <template slot="cityDiscount" slot-scope="text, record">
         <div v-if="record.dataSourceOrigin=='0'">
-          <a-input
-            v-model="record.cityDiscountRate"
-            style="width:80%;"
-            type="number"
-            placeholder="请输入"
-            @input="record.cityDiscountRate=record.cityDiscountRate.match(/^\d{1,4}(\.?\d{0,2})/g) ? record.cityDiscountRate.match(/^\d{1,4}(\.?\d{0,2})/g)[0] : ''"
-            :min="0"
-            size="small"/>%
+            <a-input-number
+              size="small"
+              style="width:80%;"
+              v-model="record.cityDiscountRate"
+              :min="record.provinceDiscountRate ||0"
+              :step="1"
+              :precision="2"
+              placeholder="请输入"
+              :max="999999"/>%
         </div>
         <span v-else>{{ (record.cityDiscountRate||record.cityDiscountRate==0)?record.cityDiscountRate+'%':'--' }}</span>
       </template>
@@ -160,15 +162,15 @@
       <!-- 特约折扣 -->
       <template slot="specialDiscount" slot-scope="text, record">
         <div v-if="record.dataSourceOrigin=='0'">
-          <a-input
-            v-model="record.specialDiscountRate"
-            style="width:80%;"
-            type="number"
-            @input="record.specialDiscountRate=record.specialDiscountRate.match(/^\d{1,4}(\.?\d{0,2})/g) ? record.specialDiscountRate.match(/^\d{1,4}(\.?\d{0,2})/g)[0] : ''"
-            :min="0"
-            placeholder="请输入"
-            step="0.01"
-            size="small"/>%
+            <a-input-number
+              size="small"
+              style="width:80%;"
+              v-model="record.specialDiscountRate"
+              :min="record.cityDiscountRate ||0"
+              :step="1"
+              :precision="2"
+              placeholder="请输入"
+              :max="999999"/>%
         </div>
         <span v-else>{{ (record.specialDiscountRate||record.specialDiscountRate==0) ? record.specialDiscountRate+'%':'--' }}</span>
       </template>

+ 82 - 83
src/views/salesManagement/pushOrderManagement/list.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-     <!-- 搜索条件 -->
+    <!-- 搜索条件 -->
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline">
@@ -105,89 +105,89 @@
         </a-form>
       </div>
     </a-card>
- 
-  <a-card size="small" :bordered="false" class="pushOrder-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <div class="tongji-bar" style="margin-bottom:10px">
-       下推总单数:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
-         下推总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
-         <span v-if="$hasPermissions('M_pushOrderManagementList_salesPrice')">下推总金额:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? toThousands(totalData.totalAmount) : '--' }}</strong>;</span>
-      </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+70+'px' }"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ y:tableHeight, x:1890 }"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 销售单号 -->
-        <template slot="salesBillNo" slot-scope="text, record">
-          <span class="link-bule" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record,0)">{{ record.salesBillNo }}</span>
-          <span v-else>{{ record.salesBillNo }}</span>
-        </template>
-        <!-- 备货单号 -->
-        <template slot="dispatchBillNo" slot-scope="text, record">
-          <span class="link-bule" v-if="$hasPermissions('B_dispatchDetail')" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
-          <span v-else>{{ record.dispatchBillNo }}</span>
-        </template>
-        <!-- 发货说明  -->
-        <template slot="explainInfo" slot-scope="text, record">
-          <span class="link-bule" @click="handleExplainInfo(record)" :title="record.explainInfo">{{ record.explainInfo||'--' }}</span>
-        </template>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <div>
-            <a-button
-              size="small"
-              type="link"
-              class="button-warning"
-              :loading="!!tipData"
-              v-if="(record.printStatus=='UNABLE_PRINT'||record.printStatus=='CANCEL_PRINT')&&record.voidFlag=='0'&&$hasPermissions('B_UNABLE_PRINT')"
-              @click="handlePrint(record,1)"
-            >允许打印</a-button>
-            <a-button
-              size="small"
-              type="link"
-              class="button-error"
-              :loading="!!tipData"
-              v-if="record.printStatus=='UNABLE_PRINT'&&record.voidFlag=='0'&&$hasPermissions('B_CANSEL_PRINT')"
-              @click="handlePrint(record,0)"
-            >取消打印</a-button>
-          </div>
-        </template>
-      </s-table>
 
-      <!-- 操作提示 -->
-      <commonModal modalTit="操作提示" :openModal="showTipModal" @cancel="canselModal" @ok="updatePrintStatus">
-        <div style="display:flex;flex-direction: column;align-items: center;">
-          <div style="margin-bottom: 15px;font-size: 14px;"><strong>{{ tipData&&tipData.printType==1?'确认允许此单进行备货打印吗?':'确认此单取消备货打印吗?' }}</strong></div>
-          <div style="line-height: 24px;">
-            <div>备货单号:{{ tipData&&tipData.dispatchBillNo }}</div>
-            <div>客户名称:{{ tipData&&tipData.buyerName }}</div>
-          </div>
+    <a-card size="small" :bordered="false" class="pushOrder-wrap">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <div class="tongji-bar" style="margin-bottom:10px">
+          下推总单数:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
+          下推总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
+          <span v-if="$hasPermissions('M_pushOrderManagementList_salesPrice')">下推总金额:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? toThousands(totalData.totalAmount) : '--' }}</strong>;</span>
         </div>
-      </commonModal>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+70+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y:tableHeight, x:1890 }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 销售单号 -->
+          <template slot="salesBillNo" slot-scope="text, record">
+            <span class="link-bule" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record,0)">{{ record.salesBillNo }}</span>
+            <span v-else>{{ record.salesBillNo }}</span>
+          </template>
+          <!-- 备货单号 -->
+          <template slot="dispatchBillNo" slot-scope="text, record">
+            <span class="link-bule" v-if="$hasPermissions('B_dispatchDetail')" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
+            <span v-else>{{ record.dispatchBillNo }}</span>
+          </template>
+          <!-- 发货说明  -->
+          <template slot="explainInfo" slot-scope="text, record">
+            <span class="link-bule" @click="handleExplainInfo(record)" :title="record.explainInfo">{{ record.explainInfo||'--' }}</span>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <div>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                :loading="!!tipData"
+                v-if="(record.printStatus=='UNABLE_PRINT'||record.printStatus=='CANCEL_PRINT')&&record.voidFlag=='0'&&$hasPermissions('B_UNABLE_PRINT')"
+                @click="handlePrint(record,1)"
+              >允许打印</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-error"
+                :loading="!!tipData"
+                v-if="record.printStatus=='UNABLE_PRINT'&&record.voidFlag=='0'&&$hasPermissions('B_CANSEL_PRINT')"
+                @click="handlePrint(record,0)"
+              >取消打印</a-button>
+            </div>
+          </template>
+        </s-table>
 
-      <!-- 查看销售单或备货单详情 -->
-      <commonModal
-        modalTit="销售单详情"
-        bodyPadding="10px"
-        width="70%"
-        :showFooter="false"
-        :openModal="showDetailModal"
-        @cancel="closeDetailModal">
-        <salesDetail v-if="showDetailModal" ref="salesDetail" :bizSn="bizSn"></salesDetail>
-      </commonModal>
-      <!-- 发货说明 -->
-      <explainInfoModal v-drag :rowData="tipData" :openModal="showInfoModal" @close="canselModal"></explainInfoModal>
-    </a-spin>
-  </a-card>
-   </div>
+        <!-- 操作提示 -->
+        <commonModal modalTit="操作提示" :openModal="showTipModal" @cancel="canselModal" @ok="updatePrintStatus">
+          <div style="display:flex;flex-direction: column;align-items: center;">
+            <div style="margin-bottom: 15px;font-size: 14px;"><strong>{{ tipData&&tipData.printType==1?'确认允许此单进行备货打印吗?':'确认此单取消备货打印吗?' }}</strong></div>
+            <div style="line-height: 24px;">
+              <div>备货单号:{{ tipData&&tipData.dispatchBillNo }}</div>
+              <div>客户名称:{{ tipData&&tipData.buyerName }}</div>
+            </div>
+          </div>
+        </commonModal>
+
+        <!-- 查看销售单或备货单详情 -->
+        <commonModal
+          modalTit="销售单详情"
+          bodyPadding="10px"
+          width="70%"
+          :showFooter="false"
+          :openModal="showDetailModal"
+          @cancel="closeDetailModal">
+          <salesDetail v-if="showDetailModal" ref="salesDetail" :bizSn="bizSn"></salesDetail>
+        </commonModal>
+        <!-- 发货说明 -->
+        <explainInfoModal v-drag :rowData="tipData" :openModal="showInfoModal" @close="canselModal"></explainInfoModal>
+      </a-spin>
+    </a-card>
+  </div>
 </template>
 
 <script>
@@ -275,7 +275,7 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '60px', align: 'center' },
-        { title: '下推时间', dataIndex: 'createDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '下推时间', dataIndex: 'pushedDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '120px', align: 'center' },
         { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '120px', align: 'center' },
         { title: '发货编号', dataIndex: 'sendNo', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -427,4 +427,3 @@ export default {
   }
 }
 </script>
-