123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <template>
- <div class="urgentItemsOffsetDetail-page-wrapper">
- <!-- 操作 -->
- <a-page-header :ghost="false" @back="handleBack" class="urgentItemsOffsetDetail-operation-wrapper">
- <!-- 自定义的二级文字标题 -->
- <template slot="subTitle">
- <a id="urgentItemsOffsetDetail-btn-back" href="javascript:;" @click="handleBack">返回列表</a>
- </template>
- <!-- 操作区,位于 title 行的行尾 -->
- <template slot="extra">
- <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-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-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="isWriteDown ? columns : unColumns"
- :data="loadData"
- :scroll="{ x: isWriteDown ? 1330 : '100%' }"
- bordered>
- <!-- 库存数量 -->
- <template slot="inventoryQuantity" slot-scope="text, record">
- <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>
- </div>
- </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 {
- 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: '库存数量', 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: 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: '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', 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, { 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: {
- // 返回
- 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
- this.$confirm({
- title: '提示',
- content: '确定要进行冲减吗?',
- okText: '确定',
- cancelText: '取消',
- 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()
- // }
- // })
- }
- })
- },
- // 快速打印
- handlePrint () {
- },
- // 打印预览
- handlePreview () {
- }
- },
- mounted () {
- this.getDetail()
- }
- }
- </script>
- <style lang="less">
- .urgentItemsOffsetDetail-page-wrapper{
- .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;
- word-break: break-all;
- }
- }
- }
- .urgentItemsOffsetDetail-table-wrapper{
- .red{
- color: #ed1c24;
- }
- }
- }
- </style>
|