|
@@ -1,10 +1,10 @@
|
|
|
<template>
|
|
|
<div class="urgentItemsOffsetDetail-page-wrapper">
|
|
|
<!-- 操作 -->
|
|
|
- <a-page-header :ghost="false" @back="handleBack" class="urgentItemsOffsetDetail-operation-wrapper">
|
|
|
+ <a-page-header :ghost="false" :backIcon="false" class="urgentItemsOffsetDetail-operation-wrapper" >
|
|
|
<!-- 自定义的二级文字标题 -->
|
|
|
<template slot="subTitle">
|
|
|
- <a id="urgentItemsOffsetDetail-btn-back" href="javascript:;" @click="handleBack">返回列表</a>
|
|
|
+ <a id="urgentItemsOffsetDetail-btn-back" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
</template>
|
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
|
<template slot="extra">
|
|
@@ -42,7 +42,7 @@
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="isWriteDown ? columns : unColumns"
|
|
|
:data="loadData"
|
|
|
- :scroll="{ x: isWriteDown ? 1330 : '100%' }"
|
|
|
+ :scroll="{ x: isWriteDown ? 1570 : '100%' }"
|
|
|
bordered>
|
|
|
<!-- 库存数量 -->
|
|
|
<template slot="inventoryQuantity" slot-scope="text, record">
|
|
@@ -55,35 +55,34 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getOperationalPrecision } from '@/libs/tools.js'
|
|
|
-import { urgentDetail } from '@/api/urgent'
|
|
|
-import { urgentDetailList } from '@/api/urgentDetail'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
+import { urgentDetail, urgentWriteDown } from '@/api/urgent'
|
|
|
+import { urgentDetailList } from '@/api/urgentDetail'
|
|
|
export default {
|
|
|
components: { STable, VSelect },
|
|
|
data () {
|
|
|
return {
|
|
|
unColumns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 160, align: 'center' },
|
|
|
- { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
|
|
|
- { title: '原厂编码', dataIndex: 'productOrigCode', width: 200, align: 'center' },
|
|
|
+ { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 200, align: 'center' },
|
|
|
+ { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true },
|
|
|
+ { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 200, align: 'center' },
|
|
|
{ title: '库存数量', scopedSlots: { customRender: 'inventoryQuantity' }, width: 100, align: 'center' },
|
|
|
{ title: '未冲减数量', dataIndex: 'qty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center' }
|
|
|
+ { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
],
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
|
|
|
- { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
|
|
|
- { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center' },
|
|
|
+ { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 200, align: 'center' },
|
|
|
+ { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', ellipsis: true },
|
|
|
+ { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '入库时间', dataIndex: 'stockInDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '仓库', dataIndex: 'warehouseName', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '仓位', dataIndex: 'warehouseLocationName', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '成本价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '已冲减数量', dataIndex: 'qty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center' },
|
|
|
- { title: '成本小计', dataIndex: 'costSubtotal', width: 100, align: 'center' }
|
|
|
+ { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '成本小计', dataIndex: 'totalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
@@ -93,18 +92,8 @@ export default {
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
- const productCode = (data.list[i].productEntity && data.list[i].productEntity.code) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.code)
|
|
|
- const productName = (data.list[i].productEntity && data.list[i].productEntity.name) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.name)
|
|
|
- const productOrigCode = (data.list[i].productEntity && data.list[i].productEntity.origCode) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.origCode)
|
|
|
- const productOrigUnit = (data.list[i].productEntity && data.list[i].productEntity.unit) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.unit)
|
|
|
- data.list[i].productCode = productCode || '--'
|
|
|
- data.list[i].productName = productName || '--'
|
|
|
- data.list[i].productOrigCode = productOrigCode || '--'
|
|
|
- data.list[i].productOrigUnit = productOrigUnit || '--'
|
|
|
data.list[i].warehouseName = data.list[i].warehouseEntity && data.list[i].warehouseEntity.name || '--'
|
|
|
data.list[i].warehouseLocationName = data.list[i].warehouseLocationEntity && data.list[i].warehouseLocationEntity.name || '--'
|
|
|
- // 成本小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
|
|
|
- data.list[i].costSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
|
|
|
}
|
|
|
this.disabled = false
|
|
|
return data
|
|
@@ -141,15 +130,13 @@ export default {
|
|
|
content: '确定要进行冲减吗?',
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
- // delectRolePower({
|
|
|
- // id: row.id
|
|
|
- // }).then(res => {
|
|
|
- // console.log(res, 'res1111')
|
|
|
- // if (res.status == 200) {
|
|
|
- // _this.$message.success(res.message)
|
|
|
- // _this.$refs.table.refresh()
|
|
|
- // }
|
|
|
- // })
|
|
|
+ urgentWriteDown({ id: _this.$route.params.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.getDetail()
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|