|
@@ -37,8 +37,8 @@
|
|
v-model="queryParam.state"
|
|
v-model="queryParam.state"
|
|
ref="state"
|
|
ref="state"
|
|
id="purchaseReceiptList-serviceState"
|
|
id="purchaseReceiptList-serviceState"
|
|
- code="SPARE_PARTS_RETURN_STATE"
|
|
|
|
- placeholder="请选择审核状态"
|
|
|
|
|
|
+ code="PURCHASE_STATE"
|
|
|
|
+ placeholder="请选择业务状态"
|
|
allowClear
|
|
allowClear
|
|
></v-select>
|
|
></v-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -49,7 +49,7 @@
|
|
v-model="queryParam.state"
|
|
v-model="queryParam.state"
|
|
ref="state"
|
|
ref="state"
|
|
id="purchaseReceiptList-state"
|
|
id="purchaseReceiptList-state"
|
|
- code="SPARE_PARTS_RETURN_STATE"
|
|
|
|
|
|
+ code="THIRD_PARTY_BIZ_STATE"
|
|
placeholder="请选择供应商状态"
|
|
placeholder="请选择供应商状态"
|
|
allowClear
|
|
allowClear
|
|
></v-select>
|
|
></v-select>
|
|
@@ -99,38 +99,39 @@
|
|
<span v-else>{{ record.sparePartsNo }}</span>
|
|
<span v-else>{{ record.sparePartsNo }}</span>
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
- <!-- state 待提交 WAIT_SUBMIT 待审核 WAIT_AUDIT 已完结 FINISH 审核不通过 AUDIT_REJECT -->
|
|
|
|
|
|
+ <!-- state 取消 CANCEL 待提交 WAIT_SUBMIT 待审核 WAIT_AUDIT 待入库 WAIT_PUT 已完结 FINISH 审核通过 PASS 审核不通过 REJECT -->
|
|
|
|
+ <!-- thirdpartyBizState 审核通过 AUDIT_PASS 审核不通过 AUDIT_REJECT 已取消 CANCEL 已出库 FINISH 待审核 WAIT_AUDIT 待发货 WAIT_RECEIVE -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-warning"
|
|
class="button-warning"
|
|
@click="handleCheck(record)"
|
|
@click="handleCheck(record)"
|
|
- v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
|
|
|
|
|
|
+ v-if="$hasPermissions('B_purchaseReturnRate') && record.state ==='WAIT_AUDIT'&&(!record.thirdpartyBizState)"
|
|
id="purchaseReceiptList-examine-btn">审核</a-button>
|
|
id="purchaseReceiptList-examine-btn">审核</a-button>
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
- v-if="$hasPermissions('B_purchaseReturnEdit')"
|
|
|
|
@click="handleEdit(record)"
|
|
@click="handleEdit(record)"
|
|
class="button-info"
|
|
class="button-info"
|
|
|
|
+ v-if="$hasPermissions('B_purchaseReturnEdit') && (record.state ==='WAIT_SUBMIT'||record.state ==='WAIT_AUDIT'||record.state ==='REJECT') && (!record.thirdpartyBizState)"
|
|
id="purchaseReceiptList-edit-btn">编辑</a-button>
|
|
id="purchaseReceiptList-edit-btn">编辑</a-button>
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
- v-if="$hasPermissions('B_purchaseReturnDel')"
|
|
|
|
|
|
+ v-if="$hasPermissions('B_purchaseReturnDel')&&isShowCancelBtn(record)"
|
|
@click="handleDel(record)"
|
|
@click="handleDel(record)"
|
|
class="button-error"
|
|
class="button-error"
|
|
id="purchaseReceiptList-del-btn">取消</a-button>
|
|
id="purchaseReceiptList-del-btn">取消</a-button>
|
|
<a-tooltip placement="left">
|
|
<a-tooltip placement="left">
|
|
<template slot="title">
|
|
<template slot="title">
|
|
- <span>物流单号:123456789</span>
|
|
|
|
|
|
+ <span>物流单号:{{ record.transportNo }}</span>
|
|
</template>
|
|
</template>
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-warning"
|
|
class="button-warning"
|
|
- v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
|
|
|
|
|
|
+ v-if="$hasPermissions('B_purchaseReturnRate') && (record.state === 'WAIT_PUT'&&record.thirdpartyBizState==='FINISH')||(record.state === 'FINISH'&&record.thirdpartyBizState==='FINISH')"
|
|
id="purchaseReceiptList-logistics-btn">
|
|
id="purchaseReceiptList-logistics-btn">
|
|
物流
|
|
物流
|
|
</a-button>
|
|
</a-button>
|
|
@@ -140,24 +141,25 @@
|
|
type="link"
|
|
type="link"
|
|
class="button-warning"
|
|
class="button-warning"
|
|
@click="addVoucher(record)"
|
|
@click="addVoucher(record)"
|
|
- v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
|
|
|
|
|
|
+ v-if="$hasPermissions('B_purchaseReturnRate') && isShowUploadBtn(record)"
|
|
id="purchaseReceiptList-addVoucher-btn">上传凭证</a-button>
|
|
id="purchaseReceiptList-addVoucher-btn">上传凭证</a-button>
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-warning"
|
|
class="button-warning"
|
|
@click="seeVoucher(record)"
|
|
@click="seeVoucher(record)"
|
|
- v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
|
|
|
|
|
|
+ v-if="$hasPermissions('B_purchaseReturnRate') && isShowCheckBtn(record)"
|
|
id="purchaseReceiptList-seeVoucher-btn">查看凭证</a-button>
|
|
id="purchaseReceiptList-seeVoucher-btn">查看凭证</a-button>
|
|
|
|
+ <span v-if="isShowNoBtn(record)">--</span>
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
</a-spin>
|
|
</a-spin>
|
|
<!-- 详情弹窗 -->
|
|
<!-- 详情弹窗 -->
|
|
<detailModal v-drag :openModal="openDetailModal" :itemSn="itemSn" @close="closeDetailModal" />
|
|
<detailModal v-drag :openModal="openDetailModal" :itemSn="itemSn" @close="closeDetailModal" />
|
|
<!-- 审核弹窗 -->
|
|
<!-- 审核弹窗 -->
|
|
- <reviewModal v-drag :openModal="openReviewModal" @close="openReviewModal=false"></reviewModal>
|
|
|
|
|
|
+ <reviewModal v-drag :openModal="openReviewModal" :itemSn="itemSn" @ok="okReviewModal" @close="closeReviewModal"></reviewModal>
|
|
<!-- 上传凭证 -->
|
|
<!-- 上传凭证 -->
|
|
- <uploadVoucherModal v-drag :openModal="openVoucherModal" @close="openVoucherModal=false"></uploadVoucherModal>
|
|
|
|
|
|
+ <uploadVoucherModal v-drag :openModal="openVoucherModal" :itemSn="itemSn" @close="openVoucherModal=false"></uploadVoucherModal>
|
|
</a-card>
|
|
</a-card>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -174,7 +176,7 @@ import reviewModal from './reviewModal.vue'
|
|
import detailModal from './detailModal.vue'
|
|
import detailModal from './detailModal.vue'
|
|
import uploadVoucherModal from './uploadVoucherModal.vue'
|
|
import uploadVoucherModal from './uploadVoucherModal.vue'
|
|
// 接口
|
|
// 接口
|
|
-import { purchaseList, purchasePageCount, purchaseCancel } from '@/api/purchase'
|
|
|
|
|
|
+import { purchaseList, purchasePageCount, purchaseCancel, purchaseAudit } from '@/api/purchase'
|
|
export default {
|
|
export default {
|
|
name: 'PurchaseReceiptList',
|
|
name: 'PurchaseReceiptList',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
@@ -234,14 +236,14 @@ export default {
|
|
{ title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '采购单号', scopedSlots: { customRender: 'purchaseReceiptNo' }, width: '9%', align: 'center' },
|
|
{ title: '采购单号', scopedSlots: { customRender: 'purchaseReceiptNo' }, width: '9%', align: 'center' },
|
|
{ title: '提交时间', dataIndex: 'updateDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '提交时间', dataIndex: 'updateDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '供应商名称', dataIndex: 'shippingAddr', align: 'left', width: '14%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '采购数量', dataIndex: 'totalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '采购金额', dataIndex: 'totalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
|
|
- { title: '入库仓库', dataIndex: 'returnReasonDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '关联单号', dataIndex: 'relationNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '客户名称', dataIndex: 'supplierName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
|
|
+ { title: '供应商名称', dataIndex: 'supplierName', align: 'left', width: '14%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '采购数量', dataIndex: 'productTotalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '采购金额', dataIndex: 'productTotalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
|
|
+ { title: '入库仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '关联单号', dataIndex: 'lockBizNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '客户名称', dataIndex: 'shippingAddr', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '业务状态', dataIndex: 'stateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '业务状态', dataIndex: 'stateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
- { title: '供应商状态', dataIndex: 'returnReasonDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
|
|
+ { title: '供应商状态', dataIndex: 'thirdpartyBizStateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '备注', dataIndex: 'remark', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '备注', dataIndex: 'remark', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
]
|
|
]
|
|
@@ -252,6 +254,28 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // <!-- state 取消 CANCEL 待提交 WAIT_SUBMIT 待审核 WAIT_AUDIT 待入库 WAIT_PUT 已完结 FINISH 审核通过 PASS 审核不通过 REJECT -->
|
|
|
|
+ // <!-- thirdpartyBizState 审核通过 AUDIT_PASS 审核不通过 AUDIT_REJECT 已取消 CANCEL 已出库 FINISH 待审核 WAIT_AUDIT 待发货 WAIT_RECEIVE -->
|
|
|
|
+ // 是否显示取消按钮
|
|
|
|
+ isShowCancelBtn (row) {
|
|
|
|
+ const res = ((row.state === 'WAIT_SUBMIT' || row.state === 'WAIT_AUDIT' || row.state === 'REJECT') && !row.thirdpartyBizState) || (row.state === 'PASS' && row.thirdpartyBizState === 'WAIT_AUDIT') || (row.state === 'PASS' && row.thirdpartyBizState === 'AUDIT_PASS')
|
|
|
|
+ return res
|
|
|
|
+ },
|
|
|
|
+ // 是否显示上传凭证按钮
|
|
|
|
+ isShowUploadBtn (con) {
|
|
|
|
+ const res = ((con.state === 'PASS' && con.thirdpartyBizState === 'AUDIT_PASS') || (con.state === 'WAIT_PUT' && con.thirdpartyBizState === 'WAIT_RECEIVE') || (con.state === 'WAIT_PUT' && con.thirdpartyBizState === 'FINISH') || (con.state === 'FINISH' && con.thirdpartyBizState === 'FINISH')) && !con.attachmentList
|
|
|
|
+ return res
|
|
|
|
+ },
|
|
|
|
+ // 是否显示查看凭证按钮
|
|
|
|
+ isShowCheckBtn (con) {
|
|
|
|
+ const res = ((con.state === 'PASS' && con.thirdpartyBizState === 'AUDIT_PASS') || (con.state === 'WAIT_PUT' && con.thirdpartyBizState === 'WAIT_RECEIVE') || (con.state === 'WAIT_PUT' && con.thirdpartyBizState === 'FINISH') || (con.state === 'FINISH' && con.thirdpartyBizState === 'FINISH')) && con.attachmentList
|
|
|
|
+ return res
|
|
|
|
+ },
|
|
|
|
+ // 是否显示 --
|
|
|
|
+ isShowNoBtn (rowVal) {
|
|
|
|
+ const res = (rowVal.state === 'CANCEL' && !rowVal.thirdpartyBizState) || (rowVal.state === 'CANCEL' && rowVal.thirdpartyBizState === 'WAIT_AUDIT') || (rowVal.state === 'CANCEL' && rowVal.thirdpartyBizState === 'AUDIT_PASS') || (rowVal.state === 'PASS' && rowVal.thirdpartyBizState === 'AUDIT_REJECT') || (rowVal.state === 'PASS' && rowVal.thirdpartyBizState === 'CANCEL')
|
|
|
|
+ return res
|
|
|
|
+ },
|
|
// 创建时间
|
|
// 创建时间
|
|
dateChange (date) {
|
|
dateChange (date) {
|
|
this.queryParam.beginDate = date[0]
|
|
this.queryParam.beginDate = date[0]
|
|
@@ -274,11 +298,36 @@ export default {
|
|
// 审核
|
|
// 审核
|
|
handleCheck (row) {
|
|
handleCheck (row) {
|
|
const _this = this
|
|
const _this = this
|
|
|
|
+ _this.itemSn = row.sparePartsSn
|
|
_this.openReviewModal = true
|
|
_this.openReviewModal = true
|
|
},
|
|
},
|
|
|
|
+ // 审核结果
|
|
|
|
+ okReviewModal (val) {
|
|
|
|
+ const _this = this
|
|
|
|
+ const ajaxData = {
|
|
|
|
+ sparePartsSn: _this.itemSn,
|
|
|
|
+ auditState: val
|
|
|
|
+ }
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ purchaseAudit(ajaxData).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ _this.$refs.table.refresh(true)
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ _this.closeReviewModal()
|
|
|
|
+ } else {
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 审核完成,清理sn数据
|
|
|
|
+ closeReviewModal () {
|
|
|
|
+ this.itemSn = null
|
|
|
|
+ this.openReviewModal = false
|
|
|
|
+ },
|
|
// 采购单号 打开详情弹窗
|
|
// 采购单号 打开详情弹窗
|
|
handleDetail (row) {
|
|
handleDetail (row) {
|
|
- this.itemSn = row.sparePartsReturnSn
|
|
|
|
|
|
+ this.itemSn = row.sparePartsSn
|
|
this.openDetailModal = true
|
|
this.openDetailModal = true
|
|
},
|
|
},
|
|
// 关闭采购退货详情弹框
|
|
// 关闭采购退货详情弹框
|
|
@@ -286,7 +335,8 @@ export default {
|
|
this.openDetailModal = false
|
|
this.openDetailModal = false
|
|
},
|
|
},
|
|
// 上传凭证
|
|
// 上传凭证
|
|
- addVoucher () {
|
|
|
|
|
|
+ addVoucher (row) {
|
|
|
|
+ this.itemSn = row.sparePartsSn
|
|
this.openVoucherModal = true
|
|
this.openVoucherModal = true
|
|
},
|
|
},
|
|
// 取消
|
|
// 取消
|