Explorar el Código

fix: 样品库存

32197351@qq.com hace 1 año
padre
commit
4fff615e6d

+ 77 - 72
itdmWeb/src/views/module-iTDM/inventory/ItdmInventoryBarcodeList.vue

@@ -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() {
     }
   }
 }

+ 12 - 33
itdmWeb/src/views/module-iTDM/inventory/ItdmSampleInventoryList.vue

@@ -12,34 +12,15 @@
     <!-- 操作按钮区域 -->
     <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>
     </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>
+<!--      <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"
@@ -87,9 +68,6 @@
             <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>删除</a>
                 </a-popconfirm>
@@ -102,7 +80,7 @@
     </div>
 
     <itdm-sample-inventory-modal ref="modalForm" @ok="modalFormOk"></itdm-sample-inventory-modal>
-    <itdm-inventory-barcode-list ref="blist" v-show="barcodeShow" @vShow="vShow"></itdm-inventory-barcode-list>
+    <itdm-inventory-barcode-list ref="blist" @ok="modalFormOk"></itdm-inventory-barcode-list>
   </a-card>
 </template>
 
@@ -122,6 +100,7 @@ export default {
   },
   data() {
     return {
+
       description: '样品库存管理页面',
       barcodeShow: false,
       // 表头
@@ -210,6 +189,7 @@ export default {
   },
   created() {
     this.getSuperFieldList()
+
   },
   computed: {
     importExcelUrl: function() {
@@ -217,11 +197,10 @@ export default {
     }
   },
   methods: {
-    vShow() {
-      this.barcodeShow = false
-    },
-    handletiaoma(){
-      this.barcodeShow=true
+
+    handletiaoma(record) {
+      this.$refs.blist.init(record.id)
+
     },
     initDictConfig() {
     },