|
@@ -161,7 +161,7 @@
|
|
type="primary"
|
|
type="primary"
|
|
class="button-info"
|
|
class="button-info"
|
|
id="salesDetail-audit-btn"
|
|
id="salesDetail-audit-btn"
|
|
- v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
|
|
|
|
|
|
+ v-if="(detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus=='WAIT_UP_AUDIT_PASS'))&&$hasPermissions('B_salesAudit')"
|
|
@click="handleAudit()"
|
|
@click="handleAudit()"
|
|
>
|
|
>
|
|
审核
|
|
审核
|
|
@@ -220,8 +220,10 @@
|
|
<dsModal ref="dsModal" title="销售单一键审核" :openModal="showDsModal" @close="showDsModal=false" @ok="handleOnceAudit" />
|
|
<dsModal ref="dsModal" title="销售单一键审核" :openModal="showDsModal" @close="showDsModal=false" @ok="handleOnceAudit" />
|
|
<!-- 缺货明细 -->
|
|
<!-- 缺货明细 -->
|
|
<stockOutDetail :openModal="showStockOut" :detailData="detailData" :salesBillSn="$route.params.sn || bizSn" @close="showStockOut=false"></stockOutDetail>
|
|
<stockOutDetail :openModal="showStockOut" :detailData="detailData" :salesBillSn="$route.params.sn || bizSn" @close="showStockOut=false"></stockOutDetail>
|
|
- <!-- 改单 -->
|
|
|
|
|
|
+ <!-- 改单时价格变更提示 -->
|
|
<tipModal ref="tipModal" :openModal="openTipModal" :dataList="sourceData" @close="closeTipModal" @ok="openTipModalOk"></tipModal>
|
|
<tipModal ref="tipModal" :openModal="openTipModal" :dataList="sourceData" @close="closeTipModal" @ok="openTipModalOk"></tipModal>
|
|
|
|
+ <!-- 审核时校验销售价低于成本价提示 -->
|
|
|
|
+ <vaildPriceModal ref="vaildPriceModal" :openModal="openVaildPriceModal" :dataObj="tempData" @close="openVaildPriceModal=false" @ok="vaildPriceOk"></vaildPriceModal>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -237,13 +239,14 @@ import stockOutDetail from './stockOutDetailModal.vue'
|
|
import chooseWarehouse from '@/views/common/chooseWarehouse'
|
|
import chooseWarehouse from '@/views/common/chooseWarehouse'
|
|
import detailProductList from './comps/detailProductList.vue'
|
|
import detailProductList from './comps/detailProductList.vue'
|
|
import tipModal from './tipModal.vue'
|
|
import tipModal from './tipModal.vue'
|
|
|
|
+import vaildPriceModal from './vaildPriceModal.vue'
|
|
// 接口
|
|
// 接口
|
|
-import { salesDetailBySn, salesDetailPrint, salesDetailExcel, salesDetailTypeExcel, salesWriteAuditPass, salesWriteAuditReject, salesWriteAuditPush, getThirdStockQty, salesPromoValidaSubmit, changeBillCheckUpdatePrice, changeBillCheck } from '@/api/salesNew'
|
|
|
|
|
|
+import { salesDetailBySn, salesDetailPrint, salesDetailExcel, salesDetailTypeExcel, salesWriteAuditPass, salesWriteUpAuditPass, salesWriteAuditReject, salesWriteAuditPush, getThirdStockQty, salesPromoValidaAudit, changeBillCheckUpdatePrice, changeBillCheck } from '@/api/salesNew'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'SalesDetailNew',
|
|
name: 'SalesDetailNew',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
- components: { VSelect, printModal, auditModal, dsModal, stockOutDetail, chooseWarehouse, detailProductList, tipModal },
|
|
|
|
|
|
+ components: { VSelect, printModal, auditModal, dsModal, stockOutDetail, chooseWarehouse, detailProductList, tipModal, vaildPriceModal },
|
|
props: {
|
|
props: {
|
|
bizSn: { // 有值则为弹框,无值则为页面
|
|
bizSn: { // 有值则为弹框,无值则为页面
|
|
type: [Number, String],
|
|
type: [Number, String],
|
|
@@ -270,7 +273,9 @@ export default {
|
|
warehouseSn: undefined, // 所在仓库
|
|
warehouseSn: undefined, // 所在仓库
|
|
promoFlag: undefined, // 产品类型
|
|
promoFlag: undefined, // 产品类型
|
|
openTipModal: false, // 改单弹窗
|
|
openTipModal: false, // 改单弹窗
|
|
- sourceData: undefined// 价格变动数据
|
|
|
|
|
|
+ sourceData: undefined, // 价格变动数据
|
|
|
|
+ tempData: undefined, // 校验临时数据
|
|
|
|
+ openVaildPriceModal: false // 校验价格弹框
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -360,6 +365,32 @@ export default {
|
|
this.openTipModal = false
|
|
this.openTipModal = false
|
|
this.$router.push({ name: 'salesNewEdit', params: { sn: this.$route.params.sn } })
|
|
this.$router.push({ name: 'salesNewEdit', params: { sn: this.$route.params.sn } })
|
|
},
|
|
},
|
|
|
|
+ // 价格低于成本校验提示,继续审核
|
|
|
|
+ vaildPriceOk (type) {
|
|
|
|
+ // 不通过
|
|
|
|
+ if (type == 'AUDIT_REJECT') {
|
|
|
|
+ this.auditOrder(type)
|
|
|
|
+ } else {
|
|
|
|
+ // 如果时 待上级审核,调用
|
|
|
|
+ if (this.detailData.billStatus == 'WAIT_UP_AUDIT_PASS') {
|
|
|
|
+ this.auditOrder(type)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.spinning = true
|
|
|
|
+ // 通过,业务状态变更 待上级审核
|
|
|
|
+ salesWriteUpAuditPass({
|
|
|
|
+ salesBillSn: this.bizSn || this.$route.params.sn,
|
|
|
|
+ billStatus: type
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.$message.success(res.message)
|
|
|
|
+ this.handleBack()
|
|
|
|
+ }
|
|
|
|
+ this.$refs.vaildPriceModal.spinning = false
|
|
|
|
+ this.spinning = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
this.warehouseSn = undefined
|
|
this.warehouseSn = undefined
|
|
@@ -410,12 +441,14 @@ export default {
|
|
this.$router.push({ name: 'waitDispatchNew', params: { salesBillSn: row.salesBillSn } })
|
|
this.$router.push({ name: 'waitDispatchNew', params: { salesBillSn: row.salesBillSn } })
|
|
},
|
|
},
|
|
// 打开审核/一键审核弹框
|
|
// 打开审核/一键审核弹框
|
|
- async handleAudit (isBatch) {
|
|
|
|
|
|
+ async handleAudit (isBatch) {
|
|
|
|
+ const _this = this
|
|
// 校验产品是否付个促销活动规则
|
|
// 校验产品是否付个促销活动规则
|
|
- const vaildActive = await salesPromoValidaSubmit({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => res.data)
|
|
|
|
|
|
+ const vaildActive = await salesPromoValidaAudit({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => res.data)
|
|
if (vaildActive && vaildActive.length > 0) {
|
|
if (vaildActive && vaildActive.length > 0) {
|
|
const a = vaildActive.filter(item => item.type == 1) // 不可提交
|
|
const a = vaildActive.filter(item => item.type == 1) // 不可提交
|
|
const b = vaildActive.filter(item => item.type == 0) // 可跳过继续提交
|
|
const b = vaildActive.filter(item => item.type == 0) // 可跳过继续提交
|
|
|
|
+ const d = vaildActive.filter(item => item.type == 'audit') // 售价是否低于参考成本价
|
|
// 弹出不符合规则弹框,不可提交
|
|
// 弹出不符合规则弹框,不可提交
|
|
if (a.length) {
|
|
if (a.length) {
|
|
this.$info({
|
|
this.$info({
|
|
@@ -434,62 +467,64 @@ export default {
|
|
</div>
|
|
</div>
|
|
})
|
|
})
|
|
this.spinning = false
|
|
this.spinning = false
|
|
- } else {
|
|
|
|
- const _this = this
|
|
|
|
|
|
+ } else if (b.length) {
|
|
// 弹出确认提示信息,可跳过继续提交
|
|
// 弹出确认提示信息,可跳过继续提交
|
|
- if (b.length) {
|
|
|
|
- _this.$confirm({
|
|
|
|
- title: '提示',
|
|
|
|
- centered: true,
|
|
|
|
- class: 'confirm-center',
|
|
|
|
- okText: '提交',
|
|
|
|
- width: 600,
|
|
|
|
- content: <div style="padding-top:15px;">
|
|
|
|
- <ol>
|
|
|
|
- {b.map(item => (
|
|
|
|
- <li style="padding:3px 0;">{item.message}</li>
|
|
|
|
- ))}
|
|
|
|
- </ol>
|
|
|
|
- </div>,
|
|
|
|
- onOk () {
|
|
|
|
- _this.verificationSuccess(isBatch)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- _this.spinning = false
|
|
|
|
|
|
+ _this.$confirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ centered: true,
|
|
|
|
+ class: 'confirm-center',
|
|
|
|
+ okText: '提交',
|
|
|
|
+ width: 600,
|
|
|
|
+ content: <div style="padding-top:15px;">
|
|
|
|
+ <ol>
|
|
|
|
+ {b.map(item => (
|
|
|
|
+ <li style="padding:3px 0;">{item.message}</li>
|
|
|
|
+ ))}
|
|
|
|
+ </ol>
|
|
|
|
+ </div>,
|
|
|
|
+ onOk () {
|
|
|
|
+ _this.verificationSuccess(isBatch)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ } else if (d.length) {
|
|
|
|
+ _this.tempData = d[0]
|
|
|
|
+ // 售价是否低于参考成本价
|
|
|
|
+ if (isBatch) { // 一键审核
|
|
|
|
+ const codeStr = _this.tempData.salesPromoDetailEntityList.map(item => item.productCode)
|
|
|
|
+ // 直接提示文字信息
|
|
|
|
+ _this.messageInfo(codeStr + '售价已低于成本价,不可一键审核!')
|
|
} else {
|
|
} else {
|
|
- _this.verificationSuccess(isBatch)
|
|
|
|
|
|
+ _this.openVaildPriceModal = true
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ this.verificationSuccess(isBatch)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
this.verificationSuccess(isBatch)
|
|
this.verificationSuccess(isBatch)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 消息提示
|
|
|
|
+ messageInfo (content) {
|
|
|
|
+ this.$info({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: content,
|
|
|
|
+ centered: true
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 验证通过
|
|
// 验证通过
|
|
verificationSuccess (isBatch) {
|
|
verificationSuccess (isBatch) {
|
|
if (isBatch) { // 一键审核
|
|
if (isBatch) { // 一键审核
|
|
if (this.$refs.productList.hasOutStockOfActive) {
|
|
if (this.$refs.productList.hasOutStockOfActive) {
|
|
- this.$info({
|
|
|
|
- title: '提示',
|
|
|
|
- content: '参加促销活动的产品存在缺货,不可一键审核!',
|
|
|
|
- centered: true
|
|
|
|
- })
|
|
|
|
|
|
+ this.messageInfo('参加促销活动的产品存在缺货,不可一键审核!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
if (this.$refs.productList.showConvertPromoGifts) {
|
|
if (this.$refs.productList.showConvertPromoGifts) {
|
|
- this.$info({
|
|
|
|
- title: '提示',
|
|
|
|
- content: '该活动规则中,促销产品可转费用报销单,不可一键审核!',
|
|
|
|
- centered: true
|
|
|
|
- })
|
|
|
|
|
|
+ this.messageInfo('该活动规则中,促销产品可转费用报销单,不可一键审核!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if (this.$refs.productList.hasJGtire) {
|
|
if (this.$refs.productList.hasJGtire) {
|
|
- this.$info({
|
|
|
|
- title: '提示',
|
|
|
|
- content: '销售单内有品牌是【箭冠】,且三级分类是【轮胎】的产品,不可一键审核!',
|
|
|
|
- centered: true
|
|
|
|
- })
|
|
|
|
|
|
+ this.messageInfo('销售单内有品牌是【箭冠】,且三级分类是【轮胎】的产品,不可一键审核!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
// 一键审核成功
|
|
// 一键审核成功
|