Browse Source

修改bug

chenrui 10 months ago
parent
commit
45f6964f48

+ 58 - 43
src/views/promotionManagement/promotionInfo/detailModal.vue

@@ -37,56 +37,71 @@
           <a-form-model-item label="内容类型" prop="contentType">
           <a-form-model-item label="内容类型" prop="contentType">
             {{ form.contentType==='IMAGE_CONTENT'?'图文展示':form.contentType==='VIDEO'?'视频展示':'跳转链接' }}
             {{ form.contentType==='IMAGE_CONTENT'?'图文展示':form.contentType==='VIDEO'?'视频展示':'跳转链接' }}
           </a-form-model-item>
           </a-form-model-item>
-          <div>
-
+          <div v-if="form.contentType==='IMAGE_CONTENT'">
+            <a-form-model-item label="内容" prop="productRangeList" >
+              <div class="box" v-html="form.content"></div>
+            </a-form-model-item>
           </div>
           </div>
-          <a-form-model-item label="基本规则" prop="ruleType">
-            {{ form.promoRule&&form.promoRule.ruleType?form.promoRule.ruleType==='ticket'?'指定产品返代金券':'--':'--' }}
-          </a-form-model-item>
-          <a-form-model-item label="券名称" prop="ruleName">
-            {{ form.promoRule&&form.promoRule.ruleName?form.promoRule.ruleName:'--' }}
-          </a-form-model-item>
-          <a-form-model-item label="券副标题" prop="ruleTitle">
-            {{ form.promoRule&&form.promoRule.ruleTitle?form.promoRule.ruleTitle:'--' }}
-          </a-form-model-item>
-          <a-form-model-item label="生成方式" prop="ruleBaseType">
-            {{ form.promoRule&&form.promoRule.ruleBaseType?form.promoRule.ruleBaseType==='bill'?'按订单生成券':'按订单产品款数生成券':'--' }}
-          </a-form-model-item>
-          <a-form-model-item label="券有效期" prop="validType" >
-            <span>
-              {{ form.promoRule&&form.promoRule.validType?form.promoRule.validType==='FIXED'?'固定日期':'期限时间':'--' }}
-            </span>
-            <span class="timeBox" v-if="form.promoRule.validType==='FIXED'">{{ form.promoRule.validStartDate }}~{{ form.promoRule.validEndDate }}</span>
-            <span class="timeBox" v-else>领取后,立即生效,有效期{{ form.promoRule.validDays }}天</span>
-          </a-form-model-item>
-          <a-form-model-item label="券适用范围" prop="range" >
-            全部产品
-          </a-form-model-item>
-          <a-form-model-item label="使用说明" prop="ruleExplain" >
-            {{ form.promoRule&&form.promoRule.ruleExplain?form.promoRule.ruleExplain:'--' }}
-          </a-form-model-item>
-          <!-- <a-form-model-item label="加盟商编辑" prop="dealerEditFlag" >
+          <div v-if="form.contentType==='VIDEO'">
+            <video
+              ref="videoPlayer"
+              width="230"
+              height="150"
+              controls
+              loop
+              controlsList="nodownload">
+              <source :src="form.content" type="video/mp4">
+            </video>
+          </div>
+          <div v-if="form.contentType==='LINK'">
+            <a-form-model-item label="基本规则" prop="ruleType">
+              {{ form.promoRule&&form.promoRule.ruleType?form.promoRule.ruleType==='ticket'?'指定产品返代金券':'--':'--' }}
+            </a-form-model-item>
+            <a-form-model-item label="券名称" prop="ruleName">
+              {{ form.promoRule&&form.promoRule.ruleName?form.promoRule.ruleName:'--' }}
+            </a-form-model-item>
+            <a-form-model-item label="券副标题" prop="ruleTitle">
+              {{ form.promoRule&&form.promoRule.ruleTitle?form.promoRule.ruleTitle:'--' }}
+            </a-form-model-item>
+            <a-form-model-item label="生成方式" prop="ruleBaseType">
+              {{ form.promoRule&&form.promoRule.ruleBaseType?form.promoRule.ruleBaseType==='bill'?'按订单生成券':'按订单产品款数生成券':'--' }}
+            </a-form-model-item>
+            <a-form-model-item label="券有效期" prop="validType" >
+              <span>
+                {{ form.promoRule&&form.promoRule.validType?form.promoRule.validType==='FIXED'?'固定日期':'期限时间':'--' }}
+              </span>
+              <span class="timeBox" v-if="form.promoRule.validType==='FIXED'">{{ form.promoRule.validStartDate }}~{{ form.promoRule.validEndDate }}</span>
+              <span class="timeBox" v-else>领取后,立即生效,有效期{{ form.promoRule.validDays }}天</span>
+            </a-form-model-item>
+            <a-form-model-item label="券适用范围" prop="range" >
+              全部产品
+            </a-form-model-item>
+            <a-form-model-item label="使用说明" prop="ruleExplain" >
+              {{ form.promoRule&&form.promoRule.ruleExplain?form.promoRule.ruleExplain:'--' }}
+            </a-form-model-item>
+            <!-- <a-form-model-item label="加盟商编辑" prop="dealerEditFlag" >
             {{ form.dealerEditFlag?form.dealerEditFlag==='1'?'是':'否':'--' }}
             {{ form.dealerEditFlag?form.dealerEditFlag==='1'?'是':'否':'--' }}
           </a-form-model-item>
           </a-form-model-item>
           <a-form-model-item label="是否发布" prop="publishFlag" >
           <a-form-model-item label="是否发布" prop="publishFlag" >
             {{ form.publishFlag?form.publishFlag==='1'?'是':'否':'--' }}
             {{ form.publishFlag?form.publishFlag==='1'?'是':'否':'--' }}
           </a-form-model-item> -->
           </a-form-model-item> -->
-          <a-form-model-item label="产品范围" prop="productRangeList" >
-            <div v-if="form.promoRule&&form.promoRule.productRangeList">
-              <a-tree-select
-                v-model="form.promoRule.productRangeList"
-                :maxTagCount="12"
-                :tree-data="productTypeList"
-                tree-checkable
-                :disabled="true"
-                :getPopupContainer="triggerNode => triggerNode.parentNode"
-                :replaceFields="{children:'children',title: 'productTypeName',key: 'productTypeSn',value: 'productTypeSn'}"
-                placeholder="请选择产品范围" />
-            </div>
-            <div>--</div>
-          </a-form-model-item>
+            <a-form-model-item label="产品范围" prop="productRangeList" >
+              <div v-if="form.promoRule&&form.promoRule.productRangeList">
+                <a-tree-select
+                  v-model="form.promoRule.productRangeList"
+                  :maxTagCount="12"
+                  :tree-data="productTypeList"
+                  tree-checkable
+                  :disabled="true"
+                  :getPopupContainer="triggerNode => triggerNode.parentNode"
+                  :replaceFields="{children:'children',title: 'productTypeName',key: 'productTypeSn',value: 'productTypeSn'}"
+                  placeholder="请选择产品范围" />
+              </div>
+              <div>--</div>
+            </a-form-model-item>
+          </div>
         </a-form-model>
         </a-form-model>
-        <a-card size="small" :bordered="false" class="pages-wrap">
+        <a-card size="small" :bordered="false" class="pages-wrap" v-show="form.contentType==='LINK'">
           <div class="productTable">
           <div class="productTable">
             <s-table
             <s-table
               class="sTable"
               class="sTable"

+ 13 - 111
src/views/promotionManagement/promotionInfo/edit.vue

@@ -385,38 +385,21 @@ export default {
       imageSet: [], // 回显显示图片数据
       imageSet: [], // 回显显示图片数据
       productTypeList: [],
       productTypeList: [],
       rules: {
       rules: {
-        title: [
-          { required: true, message: '请输入标题名称', trigger: 'blur' }
-        ],
-        imageSet: [
-          { required: true, message: '请选择要上传的封面图片', trigger: 'change' }
-        ],
-        sort: [
-          { required: true, message: '请输入排序数字', trigger: 'blur' }
-        ],
-        contentType: [
-          { required: true, message: '请选择内容类型', trigger: 'change' }
-        ],
-        content: [
-          { required: true, message: '请输入对应内容', trigger: ['blur', 'change'] }
-        ],
-        contentLink: [
-          { required: true, message: '请输入对应内容', trigger: 'blur' }
-        ],
-        publishFlag: [
-          { required: true, message: '请选择是否发布', trigger: 'change' }
-        ],
-        range: [
-          { required: true, message: '请选择券适用范围', trigger: 'change' }
-        ]
+        title: [{ required: true, message: '请输入标题名称', trigger: 'blur' }],
+        imageSet: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
+        sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
+        contentType: [{ required: true, message: '请选择内容类型', trigger: 'change' }],
+        content: [{ required: true, message: '请输入对应内容', trigger: ['blur', 'change'] }],
+        contentLink: [{ required: true, message: '请输入对应内容', trigger: 'blur' }],
+        publishFlag: [{ required: true, message: '请选择是否发布', trigger: 'change' }]
       },
       },
       sellRules: {
       sellRules: {
         ruleType: [{ required: true, message: '请选择基本规则', trigger: 'change' }],
         ruleType: [{ required: true, message: '请选择基本规则', trigger: 'change' }],
         ruleName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
         ruleName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
         ruleBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
         ruleBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
         validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
         validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
-        ruleDetailList: [{ type: 'array', required: true, message: '请选择券内容', trigger: 'blur' }]
-        // dealerEditFlag: [{ required: true, message: '请选择加盟商是否可编辑', trigger: 'change' }]
+        ruleDetailList: [{ type: 'array', required: true, message: '请选择券内容', trigger: 'blur' }],
+        range: [{ required: true, message: '请选择券适用范围', trigger: 'change' }]
       }
       }
     }
     }
   },
   },
@@ -498,91 +481,10 @@ export default {
     },
     },
     //  确定保存
     //  确定保存
     handleSave (type) {
     handleSave (type) {
-      const _this = this
-      if (_this.form.contentType === 'LINK') {
-        _this.form.content = _this.form.contentLink
-        // 验证组件必填项
-        _this.$refs.ruleForm.validate(valid => {
-          if (valid) {
-            // 验证设置参数必填项
-            _this.testAndVerify(function (res) {
-              if (res) {
-                _this.savePartInfo(type)
-              }
-            })
-          }
-        })
-      } else {
-        _this.$refs.ruleForm.validate(valid => {
-          if (valid) {
-            _this.savePartInfo(type)
-          }
-        })
-      }
-    },
-    testAndVerify (callBack) {
-      if (this.sellForm.validType === 'FIXED') {
-        if (!this.sellForm.validStartDate || this.sellForm.validStartDate.validEndDate) {
-          this.$message.warning('请选择固定日期!')
-          return false
-        }
-      } else {
-        if (!this.sellForm.validDays) {
-          this.$message.warning('请输入有效天数!')
-          return false
-        }
-      }
-      this.$refs.sellRuleForm.validate(valid => {
-        if (valid) {
-          callBack(valid)
-        } else {
-          return false
-        }
-      })
-    },
-    // 保存部分参数
-    // handlePartSave () {
-    //   const _this = this
-    //   _this.$refs.ruleForm.validate(valid => {
-    //     if (valid) {
-    //       // 验证设置参数必填项
-    //       _this.testAndVerify(function (res) {
-    //         if (res) {
-    //           _this.savePartInfo()
-    //         }
-    //       })
-    //     }
-    //   })
-    // },
-    savePartInfo (type) {
-      const _this = this
-      _this.form.promoActiveSn = this.$route.params.sn
-      _this.form.promoRule = _this.sellForm
-      var formData = JSON.parse(JSON.stringify(_this.form))
-      formData.imageSet = formData.imageSet ? formData.imageSet.split(',') : []
-      if (formData.contentType == 'LINK') {
-        delete formData.contentLink
-        if (formData.promoRule.productRangeList && formData.promoRule.productRangeList.length > 0) {
-          formData.promoRule.productRangeList = formData.promoRule.productRangeList.map(item => { return { productTypeSn: item } })
-        }
-      }
-      _this.spinning = true
-      promoActivePublish(formData).then(res => {
-        if (res.status == 200) {
-          _this.$message.success(res.message)
-          if (type === 'all') {
-            _this.$nextTick(() => {
-              _this.handleBack()
-              _this.resetSearchForm()
-            })
-          } else {
-            _this.isShowNextStep = true
-            _this.getDetail()
-          }
-          _this.spinning = false
-        } else {
-          _this.spinning = false
-        }
+      this.$message.success('保存成功')
+      this.$nextTick(() => {
+        this.handleBack()
+        this.resetSearchForm()
       })
       })
     },
     },
     //  图片上传
     //  图片上传

+ 2 - 1
src/views/promotionManagement/promotionInfo/productTable.vue

@@ -115,7 +115,8 @@ export default {
       if (typeName != 'all') {
       if (typeName != 'all') {
         ajaxData.push({
         ajaxData.push({
           id: row.id,
           id: row.id,
-          ruleValue: typeName === 'ruleValue' ? row.ruleValue : row.price
+          price: typeName === 'price' ? row.price : undefined,
+          ruleValue: typeName === 'ruleValue' ? row.ruleValue : undefined
         })
         })
       } else {
       } else {
         ajaxData = row || []
         ajaxData = row || []

+ 4 - 1
src/views/salesManagement/salesQuery/detail.vue

@@ -66,7 +66,7 @@
               折后总售价:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>;
               折后总售价:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>;
               折扣:<strong>{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</strong>;
               折扣:<strong>{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</strong>;
               折扣金额:<strong>{{ detailData&&(detailData.discountAmount || detailData.discountAmount==0) ? toThousands(detailData.discountAmount) : '--' }}</strong>;
               折扣金额:<strong>{{ detailData&&(detailData.discountAmount || detailData.discountAmount==0) ? toThousands(detailData.discountAmount) : '--' }}</strong>;
-              已发放券金额:<strong>{{ detailData&&(detailData.totalGiveAmount || detailData.totalGiveAmount==0) ? toThousands(detailData.totalGiveAmount) : '--' }}</strong>;
+              <span v-if="detailData&&detailData.sourceType&&detailData.sourceType==='XPRH_PURCHASE'"> 已发放券金额:<strong>{{ detailData&&(detailData.totalGiveAmount || detailData.totalGiveAmount==0) ? toThousands(detailData.totalGiveAmount) : '--' }}</strong>;</span>
             </div>
             </div>
             <div>
             <div>
               <a-checkbox v-model="showCost" v-if="$hasPermissions('M_ShowAllCost')" id="salesQuery-cost">成本价</a-checkbox>
               <a-checkbox v-model="showCost" v-if="$hasPermissions('M_ShowAllCost')" id="salesQuery-cost">成本价</a-checkbox>
@@ -219,6 +219,9 @@ export default {
       } else {
       } else {
         arr.splice(11, 1)
         arr.splice(11, 1)
       }
       }
+      if (this.detailData && this.detailData.sourceType && this.detailData.sourceType === 'XPRH_PURCHASE') {
+        arr.splice(11, 1, { title: <a-tooltip placement="bottom" title='返券金额以销售单完结时的活动规则为准'>返券金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'giveAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
       // 下级创建,不显示仓库仓位
       // 下级创建,不显示仓库仓位
       if (!this.isOwerEdit) {
       if (!this.isOwerEdit) {
         arr.splice(this.showCost ? 12 : 11, 0, { title: '库存数量', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         arr.splice(this.showCost ? 12 : 11, 0, { title: '库存数量', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })

+ 3 - 0
src/views/salesManagement/salesQuery/edit.vue

@@ -330,6 +330,9 @@ export default {
         arr.splice(5, 0, { title: '仓库', dataIndex: 'warehouseEntity.name', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } })
         arr.splice(5, 0, { title: '仓库', dataIndex: 'warehouseEntity.name', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } })
         arr.splice(6, 0, { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
         arr.splice(6, 0, { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       }
+      if (this.detailData && this.detailData.sourceType && this.detailData.sourceType === 'XPRH_PURCHASE') {
+        arr.splice(11, 1, { title: <a-tooltip placement="bottom" title='返券金额以销售单完结时的活动规则为准'>返券金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'giveAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
       // 实际总成本
       // 实际总成本
       if (this.isCosts) {
       if (this.isCosts) {
         arr.splice(!this.isOwerEdit ? 11 : 12, 0, { slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.splice(!this.isOwerEdit ? 11 : 12, 0, { slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })

+ 4 - 3
src/views/salesManagement/salesQuery/list.vue

@@ -181,6 +181,7 @@
           <stateIcon :title="record.financialStatusDictValue" :state="record.financialStatus == 'FINISH'?'1':'2'"></stateIcon>
           <stateIcon :title="record.financialStatusDictValue" :state="record.financialStatus == 'FINISH'?'1':'2'"></stateIcon>
         </template>
         </template>
         <!-- 操作 -->
         <!-- 操作 -->
+        <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
         <template slot="action" slot-scope="text, record">
           <a-button
           <a-button
             size="small"
             size="small"
@@ -200,7 +201,7 @@
             size="small"
             size="small"
             type="link"
             type="link"
             class="button-primary"
             class="button-primary"
-            v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')"
+            v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING'||record.sourceType == 'XPRH_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')"
             @click="handleEdit(record)"
             @click="handleEdit(record)"
           >
           >
             编辑
             编辑
@@ -209,7 +210,7 @@
             size="small"
             size="small"
             type="link"
             type="link"
             class="button-error"
             class="button-error"
-            v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')"
+            v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING' ||record.sourceType =='XPRH_PURCHASE' ) && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')"
             @click="handleDel(record)"
             @click="handleDel(record)"
           >
           >
             删除
             删除
@@ -232,7 +233,7 @@
           >
           >
             取消
             取消
           </a-button>
           </a-button>
-          <span v-if="!(record.billStatus == 'WAIT_AUDIT' && $hasPermissions('B_salesAudit')) && !(record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')) && !(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')) && !(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel'))">
+          <span v-if="!(record.billStatus == 'WAIT_AUDIT' && $hasPermissions('B_salesAudit')) && !(record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')) && !(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING'||record.sourceType == 'XPRH_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')) && !(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel'))">
             <span v-if="!(((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) &&$hasPermissions('B_salesEdit')) && !(((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel'))">--</span>
             <span v-if="!(((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) &&$hasPermissions('B_salesEdit')) && !(((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel'))">--</span>
           </span>
           </span>
         </template>
         </template>

+ 9 - 7
src/views/salesManagement/salesQueryNew/detail.vue

@@ -71,7 +71,7 @@
               折后总售价:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>;
               折后总售价:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>;
               折扣:<strong>{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</strong>;
               折扣:<strong>{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</strong>;
               折扣金额:<strong>{{ detailData&&(detailData.discountAmount || detailData.discountAmount==0) ? toThousands(detailData.discountAmount) : '--' }}</strong>;
               折扣金额:<strong>{{ detailData&&(detailData.discountAmount || detailData.discountAmount==0) ? toThousands(detailData.discountAmount) : '--' }}</strong>;
-              <span v-if="detailData.sourceType==='XPRH_PURCHASE'"> 已发放券金额:<strong>{{ detailData&&(detailData.totalGiveAmount || detailData.totalGiveAmount==0) ? toThousands(detailData.totalGiveAmount) : '--' }}</strong>;</span>
+              <span v-if="detailData&&detailData.sourceType&&detailData.sourceType==='XPRH_PURCHASE'"> 已发放券金额:<strong>{{ detailData&&(detailData.totalGiveAmount || detailData.totalGiveAmount==0) ? toThousands(detailData.totalGiveAmount) : '--' }}</strong>;</span>
             </div>
             </div>
             <div>
             <div>
               <a-checkbox v-model="showCost" v-if="$hasPermissions('M_ShowAllCost')" id="salesQuery-cost">成本价</a-checkbox>
               <a-checkbox v-model="showCost" v-if="$hasPermissions('M_ShowAllCost')" id="salesQuery-cost">成本价</a-checkbox>
@@ -216,7 +216,6 @@ export default {
         { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '折后小计', dataIndex: 'discountedAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '折后小计', dataIndex: 'discountedAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '折扣金额', dataIndex: 'discountAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '折扣金额', dataIndex: 'discountAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: <a-tooltip placement="bottom"><template slot="title"><span>返券金额以销售单完结时的活动规则为准</span></template>返券金额</a-tooltip>, dataIndex: 'discountAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '是否急件', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '是否急件', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -224,16 +223,19 @@ export default {
       ]
       ]
       // 实际总成本
       // 实际总成本
       if (this.showCost) {
       if (this.showCost) {
-        arr.splice(11, 0, { slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(12, 0, { slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       } else {
       } else {
-        arr.splice(11, 1)
+        arr.splice(12, 1)
+      }
+      if (this.detailData && this.detailData.sourceType && this.detailData.sourceType === 'XPRH_PURCHASE') {
+        arr.splice(11, 1, { title: <a-tooltip placement="bottom" title='返券金额以销售单完结时的活动规则为准'>返券金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'giveAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       }
       // 下级创建,不显示仓库仓位
       // 下级创建,不显示仓库仓位
       if (!this.isOwerEdit) {
       if (!this.isOwerEdit) {
-        arr.splice(this.showCost ? 12 : 11, 0, { title: '库存数量', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(this.showCost ? 13 : 12, 0, { title: '库存数量', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       } else {
       } else {
-        arr.splice(this.showCost ? 12 : 11, 0, { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } })
-        arr.splice(this.showCost ? 13 : 12, 0, { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(this.showCost ? 13 : 12, 0, { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(this.showCost ? 14 : 13, 0, { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       }
       return arr
       return arr
     }
     }

+ 4 - 0
src/views/salesManagement/salesQueryNew/edit.vue

@@ -436,6 +436,10 @@ export default {
         arr.splice(5, 0, { title: '仓库', dataIndex: 'warehouseEntity.name', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } })
         arr.splice(5, 0, { title: '仓库', dataIndex: 'warehouseEntity.name', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } })
         arr.splice(6, 0, { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
         arr.splice(6, 0, { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       }
+
+      if (this.detailData && this.detailData.sourceType && this.detailData.sourceType === 'XPRH_PURCHASE') {
+        arr.splice(10, 1, { title: <a-tooltip placement="bottom" title='返券金额以销售单完结时的活动规则为准'>返券金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'giveAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
       // 实际总成本
       // 实际总成本
       if (this.isCosts) {
       if (this.isCosts) {
         arr.splice(!this.isOwerEdit ? 11 : 12, 0, { slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.splice(!this.isOwerEdit ? 11 : 12, 0, { slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })

+ 3 - 3
src/views/salesManagement/salesQueryNew/list.vue

@@ -200,7 +200,7 @@
               size="small"
               size="small"
               type="link"
               type="link"
               class="button-primary"
               class="button-primary"
-              v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')"
+              v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING'||record.sourceType == 'XPRH_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')"
               @click="handleEdit(record)"
               @click="handleEdit(record)"
             >
             >
               编辑
               编辑
@@ -209,7 +209,7 @@
               size="small"
               size="small"
               type="link"
               type="link"
               class="button-error"
               class="button-error"
-              v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')"
+              v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING' ||record.sourceType =='XPRH_PURCHASE' ) && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')"
               @click="handleDel(record)"
               @click="handleDel(record)"
             >
             >
               删除
               删除
@@ -232,7 +232,7 @@
             >
             >
               取消
               取消
             </a-button>
             </a-button>
-            <span v-if="!(record.billStatus == 'WAIT_AUDIT' && $hasPermissions('B_salesAudit')) && !(record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')) && !(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')) && !(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel'))">
+            <span v-if="!(record.billStatus == 'WAIT_AUDIT' && $hasPermissions('B_salesAudit')) && !(record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')) && !(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING'||record.sourceType == 'XPRH_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')) && !(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel'))">
               <span v-if="!(((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) &&$hasPermissions('B_salesEdit')) && !(((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel'))">--</span>
               <span v-if="!(((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) &&$hasPermissions('B_salesEdit')) && !(((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel'))">--</span>
             </span>
             </span>
           </template>
           </template>