123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <template>
- <a-modal
- centered
- class="confirmationDetail-modal"
- :footer="null"
- :maskClosable="false"
- title="详情"
- v-model="isShow"
- @cancle="isShow=false"
- :width="960">
- <div>
- <a-descriptions size="small" :column="3" style="margin-bottom: 10px;">
- <a-descriptions-item label="入库单号">{{ nowData&&nowData.stockPutNo || '--' }}</a-descriptions-item>
- <a-descriptions-item label="入库时间">{{ nowData&&nowData.putTime || '--' }}</a-descriptions-item>
- <a-descriptions-item label="入库类型">{{ nowData&&nowData.putBizTypeDictValue || '--' }}</a-descriptions-item>
- </a-descriptions>
- <s-table
- class="sTable"
- ref="table"
- size="small"
- :rowKey="(record) => record.stockPutSn"
- :columns="columns"
- :data="loadData"
- :defaultLoadData="false"
- bordered>
- </s-table>
- <div class="btn-cont"><a-button id="confirmationDetail-modal-back" @click="isShow = false">返回列表</a-button></div>
- </div>
- </a-modal>
- </template>
- <script>
- import { STable } from '@/components'
- import { stockPutDetailList } from '@/api/stockPut'
- export default {
- name: 'ConfirmationDetailModal',
- components: { STable },
- props: {
- openModal: { // 弹框显示状态
- type: Boolean,
- default: false
- },
- itemSn: {
- type: [Number, String],
- default: ''
- },
- nowData: {
- type: Object,
- default: () => {
- return {}
- }
- }
- },
- data () {
- return {
- isShow: this.openModal, // 是否打开弹框
- detailsData: null, // 详情数据
- // 加载数据方法 必须为 Promise 对象
- loadData: parameter => {
- return stockPutDetailList(Object.assign(parameter, { sn: this.itemSn })).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
- }
- this.disabled = false
- }
- return data
- })
- }
- }
- },
- computed: {
- // 列表表头
- columns () {
- const arr = [
- { title: '序号', dataIndex: 'no', width: '7%', align: 'center' },
- { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
- { title: '产品名称', dataIndex: 'productName', width: '45%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
- { title: '入库数量(个)', dataIndex: 'putQty', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
- // { title: '入库成本(¥)', dataIndex: 'putCost',width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
- ]
- if (this.$hasPermissions('B_isShowCost')) {
- arr.splice(4, 0, { title: '入库成本(¥)', dataIndex: 'putCost', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
- }
- return arr
- }
- },
- methods: {},
- watch: {
- // 父页面传过来的弹框状态
- openModal (newValue, oldValue) {
- this.isShow = newValue
- },
- // 重定义的弹框状态
- isShow (newValue, oldValue) {
- if (!newValue) {
- this.$emit('close')
- this.$refs.table.clearTable()
- }
- },
- itemSn (newValue, oldValue) {
- if (this.isShow && newValue) {
- const _this = this
- setTimeout(() => {
- _this.$refs.table.refresh(true)
- }, 200)
- }
- }
- }
- }
- </script>
- <style lang="less">
- .confirmationDetail-modal{
- .ant-modal-body {
- padding: 40px 40px 24px;
- }
- .btn-cont {
- text-align: center;
- margin: 5px 0 10px;
- }
- }
- </style>
|