|
@@ -8,41 +8,45 @@
|
|
|
</template>
|
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
|
<template slot="extra">
|
|
|
- <a-button key="3" type="danger" @click="handleSubmit" id="urgentItemsOffsetDetail-btn-submit">冲减</a-button>
|
|
|
+ <a-button key="3" type="danger" v-if="!isWriteDown" @click="handleSubmit" id="urgentItemsOffsetDetail-btn-submit">冲减</a-button>
|
|
|
<a-button key="2" @click="handlePreview" id="urgentItemsOffsetDetail-btn-preview">打印预览</a-button>
|
|
|
<a-button key="1" type="primary" @click="handlePrint" id="urgentItemsOffsetDetail-btn-print">快速打印</a-button>
|
|
|
</template>
|
|
|
</a-page-header>
|
|
|
<!-- 急件单信息 -->
|
|
|
<a-card size="small" :bordered="false" class="urgentItemsOffsetDetail-info-wrapper">
|
|
|
- <a-descriptions :column="3">
|
|
|
- <a-descriptions-item label="客户名称">名称思密达</a-descriptions-item>
|
|
|
- <a-descriptions-item label="客户地址">陕西省西安市未央区凤城八路</a-descriptions-item>
|
|
|
- <a-descriptions-item label="支付方式">名称思密达</a-descriptions-item>
|
|
|
- <a-descriptions-item label="联系手机">名称思密达</a-descriptions-item>
|
|
|
- <a-descriptions-item label="联系电话">名称思密达</a-descriptions-item>
|
|
|
- <a-descriptions-item label="收款方式">名称思密达</a-descriptions-item>
|
|
|
- <a-descriptions-item label="急件单号">名称思密达</a-descriptions-item>
|
|
|
- <a-descriptions-item label="完结状态">名称思密达</a-descriptions-item>
|
|
|
- </a-descriptions>
|
|
|
+ <a-collapse :activeKey="['1']">
|
|
|
+ <a-collapse-panel key="1" header="基础信息">
|
|
|
+ <a-descriptions :column="3" v-if="detailData">
|
|
|
+ <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="客户地址">{{ detailData.shippingAddressProvinceName || '--' }}{{ detailData.shippingAddressCityName || '--' }}{{ detailData.shippingAddressCountyName || '--' }}{{ detailData.shippingAddress || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="支付方式">{{ detailData.buyerName || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="联系电话">{{ detailData.consigneeTel || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="收款方式">{{ detailData.buyerName || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="急件单号">{{ detailData.urgentBillNo || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="状态">{{ detailData.statusDictValue || '--' }}</a-descriptions-item>
|
|
|
+ </a-descriptions>
|
|
|
+ </a-collapse-panel>
|
|
|
+ </a-collapse>
|
|
|
</a-card>
|
|
|
- <!-- 合计 -->
|
|
|
- <a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
- <div class="ftext" slot="message">总款数:<strong>998</strong>;总数量:<strong>2009</strong>。</div>
|
|
|
- </a-alert>
|
|
|
<!-- 表格 -->
|
|
|
<a-card size="small" :bordered="false" class="urgentItemsOffsetDetail-table-wrapper">
|
|
|
+ <!-- 合计 -->
|
|
|
+ <a-alert type="info" showIcon style="margin-bottom:15px" v-if="detailData">
|
|
|
+ <div class="ftext" slot="message">总款数:<strong>{{ detailData.totalCategory || 0 }}</strong>;总数量:<strong>{{ detailData.totalQty || 0 }}</strong>。</div>
|
|
|
+ </a-alert>
|
|
|
<s-table
|
|
|
class="sTable"
|
|
|
ref="table"
|
|
|
size="default"
|
|
|
:rowKey="(record) => record.id"
|
|
|
- :columns="unColumns"
|
|
|
+ :columns="isWriteDown ? columns : unColumns"
|
|
|
:data="loadData"
|
|
|
+ :scroll="{ x: isWriteDown ? 1330 : '100%' }"
|
|
|
bordered>
|
|
|
<!-- 库存数量 -->
|
|
|
<template slot="inventoryQuantity" slot-scope="text, record">
|
|
|
- <span :class="[record.inventoryQuantity < record.quantityNotOffset ? 'red' : '']">{{ record.inventoryQuantity }}</span>
|
|
|
+ <span :class="[record.stockEntity.currentStockQty < record.qty ? 'red' : '']" :style="{fontWeight: record.stockEntity.currentStockQty < record.qty?'bold':''}">{{ record.stockEntity.currentStockQty }}</span>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-card>
|
|
@@ -51,6 +55,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { getOperationalPrecision } from '@/libs/tools.js'
|
|
|
+import { urgentDetail } from '@/api/urgent'
|
|
|
import { urgentDetailList } from '@/api/urgentDetail'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
export default {
|
|
@@ -58,40 +64,58 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
unColumns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'productName', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'productOldNum', width: 160, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
- { title: '原厂编码', dataIndex: 'productBrand', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '库存数量', scopedSlots: { customRender: 'inventoryQuantity' }, width: 200, align: 'center' },
|
|
|
- { title: '未冲减数量', dataIndex: 'quantityNotOffset', width: 180, align: 'center', ellipsis: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '单位', dataIndex: 'inventoryMoneys', width: 180, align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
+ { 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: '库存数量', 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' }
|
|
|
],
|
|
|
columns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'productName', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'productOldNum', width: 160, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
- { title: '原厂编码', dataIndex: 'productBrand', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '入库时间', dataIndex: 'product2Brand', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '仓库', dataIndex: 'productBrawnd', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '仓位', dataIndex: 'productBradnd', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '成本价', dataIndex: 'productsBrand', width: 200, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '已冲减数量', dataIndex: 'inventoryNum', width: 180, align: 'center', ellipsis: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '单位', dataIndex: 'inventoryMoneys', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '成本小计', dataIndex: 'inventoryMoneyss', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
+ { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', ellipsis: true },
|
|
|
+ { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true },
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center' },
|
|
|
+ { 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: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '已冲减数量', dataIndex: 'qty', width: 110, align: 'center', ellipsis: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center' },
|
|
|
+ { title: '成本小计', dataIndex: 'costSubtotal', width: 100, align: 'center' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
- return urgentDetailList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ return urgentDetailList(Object.assign(parameter, { urgentBillSn: this.$route.params.sn })).then(res => {
|
|
|
const 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
|
|
|
+ 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
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ detailData: null // 详情数据
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ isWriteDown () {
|
|
|
+ return this.detailData && this.detailData.status == 'FINISH'
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -99,6 +123,16 @@ export default {
|
|
|
handleBack () {
|
|
|
this.$router.push({ path: '/salesManagement/urgentItemsOffset/list' })
|
|
|
},
|
|
|
+ // 详情
|
|
|
+ getDetail () {
|
|
|
+ urgentDetail({ id: this.$route.params.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.detailData = res.data
|
|
|
+ } else {
|
|
|
+ this.detailData = null
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 冲减
|
|
|
handleSubmit () {
|
|
|
const _this = this
|
|
@@ -107,7 +141,7 @@ export default {
|
|
|
content: '确定要进行冲减吗?',
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
- centered: true,
|
|
|
+ centered: true,
|
|
|
onOk () {
|
|
|
// delectRolePower({
|
|
|
// id: row.id
|
|
@@ -129,6 +163,9 @@ export default {
|
|
|
handlePreview () {
|
|
|
|
|
|
}
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.getDetail()
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -138,26 +175,21 @@ export default {
|
|
|
.urgentItemsOffsetDetail-info-wrapper{
|
|
|
margin: 15px 0;
|
|
|
.item-cont {
|
|
|
- margin-bottom: 15px;
|
|
|
- display: flex;
|
|
|
- .item-label {
|
|
|
- width: 115px;
|
|
|
- font-size: 14px;
|
|
|
- color: rgba(0, 0, 0, 0.85);
|
|
|
- flex-shrink: 0;
|
|
|
- }
|
|
|
- .item-main {
|
|
|
- flex-grow: 1;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ display: flex;
|
|
|
+ .item-label {
|
|
|
+ width: 115px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: rgba(0, 0, 0, 0.85);
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+ .item-main {
|
|
|
+ flex-grow: 1;
|
|
|
word-break: break-all;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.urgentItemsOffsetDetail-table-wrapper{
|
|
|
- .sTable{
|
|
|
- table{
|
|
|
- width: auto;
|
|
|
- }
|
|
|
- }
|
|
|
.red{
|
|
|
color: #ed1c24;
|
|
|
}
|