|
@@ -1,12 +1,10 @@
|
|
|
<template>
|
|
|
<a-modal
|
|
|
+ :width="width"
|
|
|
ref="modal"
|
|
|
:visible="visible"
|
|
|
- v-bind="_attrs"
|
|
|
- v-on="$listeners"
|
|
|
- @ok="handleOk"
|
|
|
+ @ok="ok"
|
|
|
@cancel="handleCancel"
|
|
|
- :destroyOnClose="destroyOnClose"
|
|
|
>
|
|
|
|
|
|
<a-card :bordered="false">
|
|
@@ -21,35 +19,13 @@
|
|
|
|
|
|
<!-- 操作按钮区域 -->
|
|
|
<div class="table-operator">
|
|
|
- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
|
|
- <a-button type="primary" icon="download" @click="handleExportXls('库存条码')">导出</a-button>
|
|
|
- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
|
|
|
- @change="handleImportExcel">
|
|
|
- <a-button type="primary" icon="import">导入</a-button>
|
|
|
- </a-upload>
|
|
|
- <!-- 高级查询区域 -->
|
|
|
- <j-super-query :fieldList="superFieldList" ref="superQueryModal"
|
|
|
- @handleSuperQuery="handleSuperQuery"></j-super-query>
|
|
|
- <a-dropdown v-if="selectedRowKeys.length > 0">
|
|
|
- <a-menu slot="overlay">
|
|
|
- <a-menu-item key="1" @click="batchDel">
|
|
|
- <a-icon type="delete" />
|
|
|
- 删除
|
|
|
- </a-menu-item>
|
|
|
- </a-menu>
|
|
|
- <a-button style="margin-left: 8px"> 批量操作
|
|
|
- <a-icon type="down" />
|
|
|
- </a-button>
|
|
|
- </a-dropdown>
|
|
|
+ <a-button @click="createBarCode" type="primary" icon="plus">生成</a-button>
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
<!-- table区域-begin -->
|
|
|
<div>
|
|
|
- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
|
|
- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
|
|
|
- style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
|
|
|
- <a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
|
|
- </div>
|
|
|
+
|
|
|
|
|
|
<a-table
|
|
|
ref="table"
|
|
@@ -65,6 +41,15 @@
|
|
|
class="j-table-force-nowrap"
|
|
|
@change="handleTableChange">
|
|
|
|
|
|
+
|
|
|
+ <template slot="changeSwitch" slot-scope="text,record">
|
|
|
+
|
|
|
+
|
|
|
+ <a-switch :checked="record.disableStatus==='0'" @change="onChange(record)" />
|
|
|
+
|
|
|
+
|
|
|
+ </template>
|
|
|
+
|
|
|
<template slot="htmlSlot" slot-scope="text">
|
|
|
<div v-html="text"></div>
|
|
|
</template>
|
|
@@ -87,28 +72,16 @@
|
|
|
</template>
|
|
|
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
- <a @click="handleEdit(record)">编辑</a>
|
|
|
-
|
|
|
- <a-divider type="vertical" />
|
|
|
- <a-dropdown>
|
|
|
- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
|
|
|
- <a-menu slot="overlay">
|
|
|
- <a-menu-item>
|
|
|
- <a @click="handleDetail(record)">详情</a>
|
|
|
- </a-menu-item>
|
|
|
- <a-menu-item>
|
|
|
- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
|
|
+ <a-popconfirm title="确定删除吗?" @confirm="() => deleteBarcode(record.id)">
|
|
|
<a>删除</a>
|
|
|
</a-popconfirm>
|
|
|
- </a-menu-item>
|
|
|
- </a-menu>
|
|
|
- </a-dropdown>
|
|
|
+
|
|
|
+
|
|
|
</span>
|
|
|
|
|
|
</a-table>
|
|
|
</div>
|
|
|
|
|
|
- <itdm-inventory-barcode-modal ref="modalForm" @ok="modalFormOk"></itdm-inventory-barcode-modal>
|
|
|
</a-card>
|
|
|
</a-modal>
|
|
|
</template>
|
|
@@ -119,20 +92,17 @@
|
|
|
import '@/assets/less/TableExpand.less'
|
|
|
import { mixinDevice } from '@/utils/mixin'
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
-import ItdmInventoryBarcodeModal from './modules/ItdmInventoryBarcodeModal'
|
|
|
+import { createBarcode, deleteBarcode, updateBarcode } from '@api/api'
|
|
|
|
|
|
export default {
|
|
|
name: 'ItdmInventoryBarcodeList',
|
|
|
mixins: [JeecgListMixin, mixinDevice],
|
|
|
- components: {
|
|
|
- ItdmInventoryBarcodeModal
|
|
|
- },
|
|
|
- props: {
|
|
|
- //表单禁用
|
|
|
- id: { type: String }
|
|
|
- },
|
|
|
+
|
|
|
data() {
|
|
|
return {
|
|
|
+ id: null,
|
|
|
+ visible: false,
|
|
|
+ width: 1200,
|
|
|
description: '库存条码管理页面',
|
|
|
// 表头
|
|
|
columns: [
|
|
@@ -147,11 +117,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- title: '库存id',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'inventoryId'
|
|
|
- },
|
|
|
- {
|
|
|
title: '条码',
|
|
|
align: 'center',
|
|
|
dataIndex: 'barCode'
|
|
@@ -159,7 +124,9 @@ export default {
|
|
|
{
|
|
|
title: '状态',
|
|
|
align: 'center',
|
|
|
- dataIndex: 'disableStatus'
|
|
|
+ dataIndex: 'disableStatus',
|
|
|
+ scopedSlots: { customRender: 'changeSwitch' }
|
|
|
+
|
|
|
},
|
|
|
{
|
|
|
title: '数量',
|
|
@@ -167,9 +134,9 @@ export default {
|
|
|
dataIndex: 'num'
|
|
|
},
|
|
|
{
|
|
|
- title: '当前使用状态(未使用、入库、出库)',
|
|
|
+ title: '当前使用状态',
|
|
|
align: 'center',
|
|
|
- dataIndex: 'useStatus'
|
|
|
+ dataIndex: 'useStatus_dictText'
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
@@ -188,12 +155,12 @@ export default {
|
|
|
importExcelUrl: 'inventory/itdmInventoryBarcode/importExcel'
|
|
|
|
|
|
},
|
|
|
- dictOptions: {},
|
|
|
- superFieldList: []
|
|
|
+ dictOptions: {}
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.getSuperFieldList()
|
|
|
+
|
|
|
},
|
|
|
computed: {
|
|
|
importExcelUrl: function() {
|
|
@@ -201,16 +168,54 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- initDictConfig() {
|
|
|
+ handleCancel() {
|
|
|
+ this.visible = false
|
|
|
+
|
|
|
+ },
|
|
|
+ ok() {
|
|
|
+ this.visible = false
|
|
|
+
|
|
|
},
|
|
|
- getSuperFieldList() {
|
|
|
- let fieldList = []
|
|
|
- fieldList.push({ type: 'string', value: 'inventoryId', text: '库存id', dictCode: '' })
|
|
|
- fieldList.push({ type: 'string', value: 'barCode', text: '条码', dictCode: '' })
|
|
|
- fieldList.push({ type: 'string', value: 'disableStatus', text: '状态', dictCode: '' })
|
|
|
- fieldList.push({ type: 'string', value: 'num', text: '数量', dictCode: '' })
|
|
|
- fieldList.push({ type: 'string', value: 'useStatus', text: '当前使用状态(未使用、入库、出库)', dictCode: '' })
|
|
|
- this.superFieldList = fieldList
|
|
|
+ createBarCode() {
|
|
|
+ createBarcode({ inventoryId: this.id }).then(response => {
|
|
|
+ console.log(response)
|
|
|
+ if (!response.success) {
|
|
|
+ this.$message.warning(response.message)
|
|
|
+ }
|
|
|
+ this.init(this.id)
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ deleteBarcode(id) {
|
|
|
+ deleteBarcode({ id: id }).then(response => {
|
|
|
+ if (!response.success) {
|
|
|
+ this.$message.warning(response.message)
|
|
|
+ }
|
|
|
+ this.init(this.id)
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onChange(r) {
|
|
|
+ r.disableStatus = r.disableStatus === '1' ? '0' : '1'
|
|
|
+ updateBarcode({ id: r.id, disableStatus: r.disableStatus }).then(response => {
|
|
|
+ if (!response.success) {
|
|
|
+ this.$message.warning(response.message)
|
|
|
+ }
|
|
|
+ this.init(this.id)
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ init(id) {
|
|
|
+ console.log('xxxxxxxxxxxxxxxxx')
|
|
|
+ this.visible = true
|
|
|
+ this.queryParam.inventoryId = id
|
|
|
+ this.id = id
|
|
|
+ this.searchQuery()
|
|
|
+
|
|
|
+ },
|
|
|
+ initDictConfig() {
|
|
|
}
|
|
|
}
|
|
|
}
|