123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <template>
- <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
- <a-row :gutter="48" slot="extra">
- <a-col :md="48" :sm="48">
- <span class="table-page-search-submitButtons" style="float: right">
- <a-popconfirm v-if="model.status==1" title="是否要提交到仓库?" @confirm="updateStore()">
- <a-button type="primary">提交仓库</a-button>
- </a-popconfirm>
- <a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
- </span>
- </a-col>
- </a-row>
- <detail-list title="" :col="3">
- <detail-list-item term="单号">{{ model.outNo }}</detail-list-item>
- <detail-list-item term="类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
- <detail-list-item term="仓库">{{ model.storeName }}</detail-list-item>
- <detail-list-item term="状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="statusMap[model.status]"/></detail-list-item>
- <detail-list-item term="是否出库"><badge :text="BaseTool.Object.getField(yesNoMap,model.isOut)" :status="statusMap[model.status]"/></detail-list-item>
- <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
- <detail-list-item term="更新人">{{ model.updateUserName }}</detail-list-item>
- <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
- </detail-list>
- <detail-list title="" :col="1">
- <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
- </detail-list>
- <title-divider title="备件明细" width="90px"></title-divider>
- <a-table
- bordered
- :data-source="data"
- :columns="columns"
- tableLayout="auto"
- rowKey="cbatch">
- </a-table>
- <history ref="history" :audit="false" :ok="handleCancel"></history>
- </a-card>
- </template>
- <script>
- import { updateStore, fetchOutStoreForm } from '@/api/store/outstoreform'
- import DetailList from '@/components/tools/DetailList'
- import History from '@/views/activiti/History'
- const DetailListItem = DetailList.Item
- export default {
- name: 'OutStoreFormDetail',
- components: {
- DetailList,
- History,
- DetailListItem
- },
- data () {
- return {
- confirmLoading: false,
- mdl: {},
- modalTitle: null,
- visible: false,
- // 下拉框map
- typeMap: {},
- statusMap: {},
- yesNoMap: {},
- model: {
- 'outNo': null,
- 'type': null,
- 'pickId': null,
- 'storeId': null,
- 'storeName': null,
- 'pickNo': null,
- 'totalPrice': null,
- 'remark': null,
- 'createdUserId': null,
- 'updateUserId': null,
- 'updateTime': null,
- 'createdUserName': null,
- 'updateUserName': null
- },
- // 表头
- columns: [
- {
- title: '序号',
- dataIndex: 'index',
- customRender: (text, record, index) => {
- return index + 1
- }
- },
- {
- title: '备件名称',
- dataIndex: 'spareName'
- },
- {
- title: '编号',
- dataIndex: 'no'
- },
- {
- title: '规格',
- dataIndex: 'ggxh'
- },
- {
- title: '仓库',
- dataIndex: 'storeName'
- },
- {
- title: '批次',
- dataIndex: 'cbatch'
- },
- {
- title: '申请数量',
- dataIndex: 'num',
- width: 150
- },
- {
- title: '实际数量',
- dataIndex: 'realNum',
- width: 150
- }
- ],
- data: []
- }
- },
- created () {
- // 下拉框map
- this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.OUT_STORE_FORM_TYPE)
- this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.OUT_STORE_FORM_STATUS)
- this.yesNoMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
- },
- methods: {
- base (record) {
- this.visible = true
- this.modalTitle = '详情'
- this.model = record
- this.data = record.detailList
- const modal = this.$refs.history
- modal.base(record, null)
- },
- handleCancel () {
- this.visible = false
- this.confirmLoading = false
- this.$emit('ok')
- },
- handleOk () {
- fetchOutStoreForm({ id: this.model.id }).then(res => {
- this.model = res.data
- })
- },
- updateStore () {
- updateStore({ id: this.model.id }).then(res => {
- this.$message.info('成功')
- this.handleOk()
- })
- }
- }
- }
- </script>
|