|
@@ -7,7 +7,7 @@
|
|
|
<a id="purchaseReturnDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
</template>
|
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
|
- <template slot="extra" v-if="$hasPermissions('B_purchaseReturnPrint')">
|
|
|
+ <template slot="extra">
|
|
|
<Print :disabled="dataSource.length==0" @handlePrint="handlePrint"></Print>
|
|
|
</template>
|
|
|
</a-page-header>
|
|
@@ -41,6 +41,10 @@
|
|
|
退货金额:<strong>{{ (basicInfoData&&(basicInfoData.totalAmount || basicInfoData.totalAmount==0)) ? basicInfoData.totalAmount : '--' }}</strong>;
|
|
|
</div>
|
|
|
</a-alert>
|
|
|
+ <div v-if="basicInfoData" style="margin-bottom:10px;display:flex;align-items:center;">
|
|
|
+ <div>总公司删除产品明细:共 {{ basicInfoData.removeQty }} 款产品,{{ basicInfoData.removeCode.replace(',','、') }}。</div>
|
|
|
+ <a-button @click="exportDelProduct" type="link">导出删除产品明细</a-button>
|
|
|
+ </div>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
|
class="sTable"
|
|
@@ -64,8 +68,7 @@ import { commonMixin } from '@/utils/mixin'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import Print from '@/views/common/print.vue'
|
|
|
import { hdPrint } from '@/libs/JGPrint'
|
|
|
-import { getOperationalPrecision } from '@/libs/tools.js'
|
|
|
-import { purchaseReturnDetail, purchaseReturnDetailList, purchaseReturnDetailPrint, purchaseReturnDetailExport } from '@/api/purchaseReturnApply'
|
|
|
+import { purchaseReturnDetail, purchaseReturnDetailList, purchaseReturnApplyPrint, purchaseReturnApplyExport, exportDeleteExcel } from '@/api/purchaseReturnApply'
|
|
|
export default {
|
|
|
name: 'PurchaseReturnDetail',
|
|
|
components: { STable, VSelect, Print },
|
|
@@ -83,15 +86,13 @@ export default {
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
- return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnSn: this.outBizSn || this.$route.params.sn })).then(res => {
|
|
|
+ return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnApplySn: this.outBizSn || this.$route.params.sn })).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
- // 采购金额 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
|
|
|
- data.list[i].purchaseReturnAmount = getOperationalPrecision(data.list[i].cost, data.list[i].qty)
|
|
|
}
|
|
|
this.disabled = false
|
|
|
this.dataSource = data.list
|
|
@@ -106,20 +107,20 @@ export default {
|
|
|
columns () {
|
|
|
const arr = [
|
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
- { title: '采购单号', dataIndex: 'purchaseBillNo', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- // { title: '售价', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '退货数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '产品编码', dataIndex: 'product.code', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'product.name', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '申请退货数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '总公司实收数量', dataIndex: 'receiveQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '坏件数量', dataIndex: 'badQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '良品数量', dataIndex: 'goodQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '返库数量', dataIndex: 'backStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- // { title: '退货金额小计', dataIndex: 'purchaseReturnAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '退货原因', dataIndex: 'remarks', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
|
|
|
+ { title: '单位', dataIndex: 'product.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '总公司变更详情', dataIndex: 'remarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
]
|
|
|
if (this.$hasPermissions('M_ShowAllCost')) {
|
|
|
- arr.splice(4, 0, { title: '售价', dataIndex: 'cost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
- arr.splice(9, 0, { title: '退货金额小计', dataIndex: 'purchaseReturnAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
+ arr.splice(9, 0, { title: '退货单价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
+ arr.splice(10, 0, { title: '退货金额', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
}
|
|
|
return arr
|
|
|
}
|
|
@@ -127,20 +128,28 @@ export default {
|
|
|
methods: {
|
|
|
// 返回列表
|
|
|
handleBack () {
|
|
|
- this.$router.push({ path: '/purchasingManagement/purchaseReturn/list' })
|
|
|
+ this.$router.push({ name: 'purchaseReturnApplyFormList' })
|
|
|
},
|
|
|
// 打印预览/快捷打印
|
|
|
handlePrint (type, printerType) {
|
|
|
const _this = this
|
|
|
_this.spinning = true
|
|
|
- let url = purchaseReturnDetailPrint
|
|
|
+ let url = purchaseReturnApplyPrint
|
|
|
const params = { sn: this.$route.params.sn || this.outBizSn }
|
|
|
- params.showFlag = this.$hasPermissions('M_ShowAllCost') ? 1 : 0
|
|
|
if (type == 'export') { // 导出
|
|
|
- url = purchaseReturnDetailExport
|
|
|
+ url = purchaseReturnApplyExport
|
|
|
}
|
|
|
// 打印或导出
|
|
|
- hdPrint(printerType, type, url, params, '采购退货单', function () {
|
|
|
+ hdPrint(printerType, type, url, params, '采购退货申请单', function () {
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 导出删除的产品
|
|
|
+ exportDelProduct () {
|
|
|
+ const _this = this
|
|
|
+ _this.spinning = true
|
|
|
+ const params = { sn: this.$route.params.sn || this.outBizSn }
|
|
|
+ hdPrint('', 'export', exportDeleteExcel, params, '采购退货申请单删除产品明细', function () {
|
|
|
_this.spinning = false
|
|
|
})
|
|
|
},
|