ソースを参照

feat: 样品管理

32197351@qq.com 1 年間 前
コミット
f5efd71763

+ 11 - 1
itdmWeb/src/api/api.js

@@ -152,6 +152,13 @@ const downWeituo_info= (params)=>downFile("weituo/itdmWeituoInfo/word",params);
 
 
 
+
+const updateBarcode = (params)=>postAction("/inventory/itdmInventoryBarcode/edit",params);
+const createBarcode = (params)=>postAction("/inventory/itdmInventoryBarcode/add",params);
+const deleteBarcode   = (params)=>deleteAction("/inventory/itdmInventoryBarcode/delete",params);
+
+
+
 // 中转HTTP请求
 export const transitRESTful = {
   get: (url, parameter) => getAction(getTransitURL(url), parameter),
@@ -243,7 +250,10 @@ export {
   upload,
   getUpload,
   downWeituo_info,
-  checkWancheng
+  checkWancheng,
+  updateBarcode,
+  createBarcode,
+  deleteBarcode,
 }
 
 

+ 197 - 0
itdmWeb/src/views/module-iTDM/inventory/ItdmInventoryLogList.vue

@@ -0,0 +1,197 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handle1" type="primary" icon="plus">入库</a-button>
+      <a-button @click="handle2" type="primary" icon="plus">出库</a-button>
+
+
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt=""
+               style="max-width:80px;font-size: 12px;font-style: italic;" />
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </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>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <itdm-inventory-log-modal ref="modalForm" @ok="modalFormOk"></itdm-inventory-log-modal>
+  </a-card>
+</template>
+
+<script>
+
+import '@/assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import ItdmInventoryLogModal from './modules/ItdmInventoryLogModal'
+
+export default {
+  name: 'ItdmInventoryLogList',
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    ItdmInventoryLogModal
+  },
+  data() {
+    return {
+      description: '库存日志管理页面',
+      // 表头
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function(t, r, index) {
+            return parseInt(index) + 1
+          }
+        },
+        {
+          title: '类型(入库、出库)',
+          align: 'center',
+          dataIndex: 'type_dictText'
+        },
+        {
+          title: '条码',
+          align: 'center',
+          dataIndex: 'barCode'
+        },
+        {
+          title: '样品库存id',
+          align: 'center',
+          dataIndex: 'inventoryId_dictText'
+        },
+        {
+          title: '数量 用来同步',
+          align: 'center',
+          dataIndex: 'num'
+        },
+        {
+          title: '使用人员(入库借出和出库归还)',
+          align: 'center',
+          dataIndex: 'useBy'
+        },
+        {
+          title: '使用时间',
+          align: 'center',
+          dataIndex: 'useTime'
+        },
+        {
+          title: '备注',
+          align: 'center',
+          dataIndex: 'remark'
+        }
+        // {
+        //   title: '操作',
+        //   dataIndex: 'action',
+        //   align:"center",
+        //   fixed:"right",
+        //   width:147,
+        //   scopedSlots: { customRender: 'action' }
+        // }
+      ],
+      url: {
+        list: '/inventory/itdmInventoryLog/list',
+        delete: '/inventory/itdmInventoryLog/delete',
+        deleteBatch: '/inventory/itdmInventoryLog/deleteBatch',
+        exportXlsUrl: '/inventory/itdmInventoryLog/exportXls',
+        importExcelUrl: 'inventory/itdmInventoryLog/importExcel'
+
+      },
+      dictOptions: {}
+    }
+  },
+  created() {
+  },
+  computed: {
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+    }
+  },
+  methods: {
+    initDictConfig() {
+    },
+    handle1: function() {
+      this.$refs.modalForm.add()
+      this.$refs.modalForm.initModel('1')
+
+      this.$refs.modalForm.title = '入库'
+      this.$refs.modalForm.disableSubmit = false
+    },
+    handle2: function() {
+      this.$refs.modalForm.add()
+      this.$refs.modalForm.initModel('2')
+
+      this.$refs.modalForm.title = '出库'
+      this.$refs.modalForm.disableSubmit = false
+    }
+  }
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 0 - 124
itdmWeb/src/views/module-iTDM/inventory/modules/ItdmInventoryBarcodeForm.vue

@@ -1,124 +0,0 @@
-<template>
-  <a-spin :spinning="confirmLoading">
-    <j-form-container :disabled="formDisabled">
-      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
-        <a-row>
-          <a-col :span="24">
-            <a-form-model-item label="库存id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryId">
-              <a-input v-model="model.inventoryId" placeholder="请输入库存id"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="条码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="barCode">
-              <a-input v-model="model.barCode" placeholder="请输入条码"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="disableStatus">
-              <a-input v-model="model.disableStatus" placeholder="请输入状态"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
-              <a-input v-model="model.num" placeholder="请输入数量"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="当前使用状态(未使用、入库、出库)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="useStatus">
-              <a-input v-model="model.useStatus" placeholder="请输入当前使用状态(未使用、入库、出库)"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
-      </a-form-model>
-    </j-form-container>
-  </a-spin>
-</template>
-
-<script>
-
-  import { httpAction, getAction } from '@/api/manage'
-  import { validateDuplicateValue } from '@/utils/util'
-
-  export default {
-    name: 'ItdmInventoryBarcodeForm',
-    components: {
-    },
-    props: {
-      //表单禁用
-      disabled: {
-        type: Boolean,
-        default: false,
-        required: false
-      }
-    },
-    data () {
-      return {
-        model:{
-         },
-        labelCol: {
-          xs: { span: 24 },
-          sm: { span: 5 },
-        },
-        wrapperCol: {
-          xs: { span: 24 },
-          sm: { span: 16 },
-        },
-        confirmLoading: false,
-        validatorRules: {
-        },
-        url: {
-          add: "/inventory/itdmInventoryBarcode/add",
-          edit: "/inventory/itdmInventoryBarcode/edit",
-          queryById: "/inventory/itdmInventoryBarcode/queryById"
-        }
-      }
-    },
-    computed: {
-      formDisabled(){
-        return this.disabled
-      },
-    },
-    created () {
-       //备份model原始值
-      this.modelDefault = JSON.parse(JSON.stringify(this.model));
-    },
-    methods: {
-      add () {
-        this.edit(this.modelDefault);
-      },
-      edit (record) {
-        this.model = Object.assign({}, record);
-        this.visible = true;
-      },
-      submitForm () {
-        const that = this;
-        // 触发表单验证
-        this.$refs.form.validate(valid => {
-          if (valid) {
-            that.confirmLoading = true;
-            let httpurl = '';
-            let method = '';
-            if(!this.model.id){
-              httpurl+=this.url.add;
-              method = 'post';
-            }else{
-              httpurl+=this.url.edit;
-               method = 'put';
-            }
-            httpAction(httpurl,this.model,method).then((res)=>{
-              if(res.success){
-                that.$message.success(res.message);
-                that.$emit('ok');
-              }else{
-                that.$message.warning(res.message);
-              }
-            }).finally(() => {
-              that.confirmLoading = false;
-            })
-          }
-         
-        })
-      },
-    }
-  }
-</script>

+ 0 - 60
itdmWeb/src/views/module-iTDM/inventory/modules/ItdmInventoryBarcodeModal.vue

@@ -1,60 +0,0 @@
-<template>
-  <j-modal
-    :title="title"
-    :width="width"
-    :visible="visible"
-    switchFullscreen
-    @ok="handleOk"
-    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
-    @cancel="handleCancel"
-    cancelText="关闭">
-    <itdm-inventory-barcode-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></itdm-inventory-barcode-form>
-  </j-modal>
-</template>
-
-<script>
-
-  import ItdmInventoryBarcodeForm from './ItdmInventoryBarcodeForm'
-  export default {
-    name: 'ItdmInventoryBarcodeModal',
-    components: {
-      ItdmInventoryBarcodeForm
-    },
-    data () {
-      return {
-        title:'',
-        width:800,
-        visible: false,
-        disableSubmit: false
-      }
-    },
-    methods: {
-      add () {
-        this.visible=true
-        this.$nextTick(()=>{
-          this.$refs.realForm.add();
-        })
-      },
-      edit (record) {
-        this.visible=true
-        this.$nextTick(()=>{
-          this.$refs.realForm.edit(record);
-        })
-      },
-      close () {
-        this.$emit('close');
-        this.visible = false;
-      },
-      handleOk () {
-        this.$refs.realForm.submitForm();
-      },
-      submitCallback(){
-        this.$emit('ok');
-        this.visible = false;
-      },
-      handleCancel () {
-        this.close()
-      }
-    }
-  }
-</script>

+ 124 - 0
itdmWeb/src/views/module-iTDM/inventory/modules/ItdmInventoryLogForm.vue

@@ -0,0 +1,124 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="类型(入库、出库)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
+              <j-search-select-tag v-model="model.type" dict="inventory_type" :disabled="true" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="条码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="barCode">
+              <a-input v-model="model.barCode" placeholder="请输入条码"></a-input>
+            </a-form-model-item>
+          </a-col>
+
+
+          <a-col :span="24">
+            <a-form-model-item label="使用人员(入库借出和出库归还)" :labelCol="labelCol" :wrapperCol="wrapperCol"
+                               prop="useBy">
+              <j-select-user-by-dep v-model="model.useBy" :multi="true" />
+            </a-form-model-item>
+          </a-col>
+
+          <a-col :span="24">
+            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
+              <a-input v-model="model.remark" placeholder="请输入备注"></a-input>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+import { httpAction, getAction } from '@/api/manage'
+import { validateDuplicateValue } from '@/utils/util'
+
+export default {
+  name: 'ItdmInventoryLogForm',
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false
+    }
+  },
+  data() {
+    return {
+      model: {},
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 }
+      },
+      confirmLoading: false,
+      validatorRules: {},
+      url: {
+        add: '/inventory/itdmInventoryLog/add',
+        edit: '/inventory/itdmInventoryLog/edit',
+        queryById: '/inventory/itdmInventoryLog/queryById'
+      }
+    }
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled
+    }
+  },
+  created() {
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model))
+  },
+  methods: {
+    add() {
+      this.edit(this.modelDefault)
+    },
+    edit(record) {
+      this.model = Object.assign({}, record)
+      this.visible = true
+    },
+    initModel(type){
+      this.model.type = type
+      console.log(this.model)
+    },
+    submitForm() {
+      const that = this
+      // 触发表单验证
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          that.confirmLoading = true
+          let httpurl = ''
+          let method = ''
+          if (!this.model.id) {
+            httpurl += this.url.add
+            method = 'post'
+          } else {
+            httpurl += this.url.edit
+            method = 'put'
+          }
+          httpAction(httpurl, this.model, method).then((res) => {
+            if (res.success) {
+              that.$message.success(res.message)
+              that.$emit('ok')
+            } else {
+              that.$message.warning(res.message)
+            }
+          }).finally(() => {
+            that.confirmLoading = false
+          })
+        }
+
+      })
+    }
+  }
+}
+</script>

+ 4 - 4
itdmWeb/src/views/module-iTDM/inventory/modules/ItdmInventoryBarcodeModal.Style#Drawer.vue

@@ -7,7 +7,7 @@
     @close="close"
     destroyOnClose
     :visible="visible">
-    <itdm-inventory-barcode-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></itdm-inventory-barcode-form>
+    <itdm-inventory-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></itdm-inventory-log-form>
     <div class="drawer-footer">
       <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
       <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
@@ -17,12 +17,12 @@
 
 <script>
 
-  import ItdmInventoryBarcodeForm from './ItdmInventoryBarcodeForm'
+  import ItdmInventoryLogForm from './ItdmInventoryLogForm'
 
   export default {
-    name: 'ItdmInventoryBarcodeModal',
+    name: 'ItdmInventoryLogModal',
     components: {
-      ItdmInventoryBarcodeForm
+      ItdmInventoryLogForm
     },
     data () {
       return {

+ 66 - 0
itdmWeb/src/views/module-iTDM/inventory/modules/ItdmInventoryLogModal.vue

@@ -0,0 +1,66 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <itdm-inventory-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></itdm-inventory-log-form>
+  </j-modal>
+</template>
+
+<script>
+
+import ItdmInventoryLogForm from './ItdmInventoryLogForm'
+
+export default {
+  name: 'ItdmInventoryLogModal',
+  components: {
+    ItdmInventoryLogForm
+  },
+  data() {
+    return {
+      title: '',
+      width: 800,
+      visible: false,
+      disableSubmit: false
+    }
+  },
+  methods: {
+    add() {
+      this.visible = true
+      this.$nextTick(() => {
+        this.$refs.realForm.add()
+      })
+    },
+    edit(record) {
+      this.visible = true
+      this.$nextTick(() => {
+        this.$refs.realForm.edit(record)
+      })
+    },
+    initModel(type) {
+      this.$nextTick(() => {
+        this.$refs.realForm.initModel(type)
+      })
+    },
+    close() {
+      this.$emit('close')
+      this.visible = false
+    },
+    handleOk() {
+      this.$refs.realForm.submitForm()
+    },
+    submitCallback() {
+      this.$emit('ok')
+      this.visible = false
+    },
+    handleCancel() {
+      this.close()
+    }
+  }
+}
+</script>