瀏覽代碼

fix: 样品库存

32197351@qq.com 1 年之前
父節點
當前提交
7e6b027e41

+ 220 - 0
itdmWeb/src/views/module-iTDM/inventory/ItdmInventoryBarcodeList.vue

@@ -0,0 +1,220 @@
+<template>
+  <a-modal
+    ref="modal"
+    :visible="visible"
+    v-bind="_attrs"
+    v-on="$listeners"
+    @ok="handleOk"
+    @cancel="handleCancel"
+    :destroyOnClose="destroyOnClose"
+  >
+
+    <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="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>
+
+        <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-barcode-modal ref="modalForm" @ok="modalFormOk"></itdm-inventory-barcode-modal>
+    </a-card>
+  </a-modal>
+</template>
+
+
+<script>
+
+import '@/assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import ItdmInventoryBarcodeModal from './modules/ItdmInventoryBarcodeModal'
+
+export default {
+  name: 'ItdmInventoryBarcodeList',
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    ItdmInventoryBarcodeModal
+  },
+  props: {
+    //表单禁用
+    id: { type: String }
+  },
+  data() {
+    return {
+      description: '库存条码管理页面',
+      // 表头
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function(t, r, index) {
+            return parseInt(index) + 1
+          }
+        },
+        {
+          title: '库存id',
+          align: 'center',
+          dataIndex: 'inventoryId'
+        },
+        {
+          title: '条码',
+          align: 'center',
+          dataIndex: 'barCode'
+        },
+        {
+          title: '状态',
+          align: 'center',
+          dataIndex: 'disableStatus'
+        },
+        {
+          title: '数量',
+          align: 'center',
+          dataIndex: 'num'
+        },
+        {
+          title: '当前使用状态(未使用、入库、出库)',
+          align: 'center',
+          dataIndex: 'useStatus'
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          fixed: 'right',
+          width: 147,
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      url: {
+        list: '/inventory/itdmInventoryBarcode/list',
+        delete: '/inventory/itdmInventoryBarcode/delete',
+        deleteBatch: '/inventory/itdmInventoryBarcode/deleteBatch',
+        exportXlsUrl: '/inventory/itdmInventoryBarcode/exportXls',
+        importExcelUrl: 'inventory/itdmInventoryBarcode/importExcel'
+
+      },
+      dictOptions: {},
+      superFieldList: []
+    }
+  },
+  created() {
+    this.getSuperFieldList()
+  },
+  computed: {
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+    }
+  },
+  methods: {
+    initDictConfig() {
+    },
+    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
+    }
+  }
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 247 - 0
itdmWeb/src/views/module-iTDM/inventory/ItdmSampleInventoryList.vue

@@ -0,0 +1,247 @@
+<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="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>
+
+      <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 @click="handletiaoma(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-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>
+  </a-card>
+</template>
+
+<script>
+
+import '@/assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import ItdmSampleInventoryModal from './modules/ItdmSampleInventoryModal'
+import ItdmInventoryBarcodeList from './ItdmInventoryBarcodeList'
+
+export default {
+  name: 'ItdmSampleInventoryList',
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    ItdmSampleInventoryModal, ItdmInventoryBarcodeList
+  },
+  data() {
+    return {
+      description: '样品库存管理页面',
+      barcodeShow: false,
+      // 表头
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function(t, r, index) {
+            return parseInt(index) + 1
+          }
+        },
+        {
+          title: '样品名称',
+          align: 'center',
+          dataIndex: 'sampleName'
+        },
+        {
+          title: '样品规格',
+          align: 'center',
+          dataIndex: 'sampleSpecifications'
+        },
+        {
+          title: '样品数量',
+          align: 'center',
+          dataIndex: 'sampleNum'
+        },
+        {
+          title: '生产厂家',
+          align: 'center',
+          dataIndex: 'sampleManufacturer'
+        },
+        {
+          title: '批次号',
+          align: 'center',
+          dataIndex: 'batchNumber'
+        },
+        {
+          title: '样品分类',
+          align: 'center',
+          dataIndex: 'sampleClassifications'
+        },
+        {
+          title: '样品单位',
+          align: 'center',
+          dataIndex: 'sampleUnit'
+        },
+        {
+          title: '样品状态(是否损坏)',
+          align: 'center',
+          dataIndex: 'sampleStatus'
+        },
+
+        {
+          title: '样品存放位置',
+          align: 'center',
+          dataIndex: 'samplePosition'
+        },
+        {
+          title: '备注',
+          align: 'center',
+          dataIndex: 'remark'
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          fixed: 'right',
+          width: 147,
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      url: {
+        list: '/inventory/itdmSampleInventory/list',
+        delete: '/inventory/itdmSampleInventory/delete',
+        deleteBatch: '/inventory/itdmSampleInventory/deleteBatch',
+        exportXlsUrl: '/inventory/itdmSampleInventory/exportXls',
+        importExcelUrl: 'inventory/itdmSampleInventory/importExcel'
+
+      },
+      dictOptions: {},
+      superFieldList: []
+    }
+  },
+  created() {
+    this.getSuperFieldList()
+  },
+  computed: {
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+    }
+  },
+  methods: {
+    vShow() {
+      this.barcodeShow = false
+    },
+    handletiaoma(){
+      this.barcodeShow=true
+    },
+    initDictConfig() {
+    },
+    getSuperFieldList() {
+      let fieldList = []
+      fieldList.push({ type: 'string', value: 'sampleName', text: '样品名称', dictCode: '' })
+      fieldList.push({ type: 'string', value: 'sampleSpecifications', text: '样品规格', dictCode: '' })
+      fieldList.push({ type: 'int', value: 'sampleNum', text: '样品数量', dictCode: '' })
+      fieldList.push({ type: 'string', value: 'sampleManufacturer', text: '生产厂家', dictCode: '' })
+      fieldList.push({ type: 'string', value: 'batchNumber', text: '批次号', dictCode: '' })
+      fieldList.push({ type: 'string', value: 'sampleClassifications', text: '样品分类', dictCode: '' })
+      fieldList.push({ type: 'string', value: 'sampleUnit', text: '样品单位', dictCode: '' })
+      fieldList.push({ type: 'string', value: 'sampleStatus', text: '样品状态(是否损坏)', dictCode: '' })
+      fieldList.push({ type: 'string', value: 'samplePosition', text: '样品存放位置', dictCode: '' })
+      fieldList.push({ type: 'Text', value: 'remark', text: '备注', dictCode: '' })
+      this.superFieldList = fieldList
+    }
+  }
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 124 - 0
itdmWeb/src/views/module-iTDM/inventory/modules/ItdmInventoryBarcodeForm.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="库存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>

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

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <itdm-inventory-barcode-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></itdm-inventory-barcode-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>
+    </div>
+  </a-drawer>
+</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;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

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

@@ -0,0 +1,60 @@
+<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>

+ 166 - 0
itdmWeb/src/views/module-iTDM/inventory/modules/ItdmSampleInventoryForm.vue

@@ -0,0 +1,166 @@
+<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="sampleName">
+              <a-input v-model="model.sampleName" placeholder="请输入样品名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="样品规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sampleSpecifications">
+              <a-input v-model="model.sampleSpecifications" placeholder="请输入样品规格"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="生产厂家" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sampleManufacturer">
+              <a-input v-model="model.sampleManufacturer" placeholder="请输入生产厂家"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+
+          <a-col :span="24">
+            <a-form-model-item label="样品分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sampleClassifications">
+              <a-input v-model="model.sampleClassifications" placeholder="请输入样品分类"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="样品单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sampleUnit">
+              <a-input v-model="model.sampleUnit" placeholder="请输入样品单位"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="样品状态(是否损坏)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sampleStatus">
+              <a-input v-model="model.sampleStatus" placeholder="请输入样品状态(是否损坏)"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+
+          <a-col :span="24">
+            <a-form-model-item label="样品存放位置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="samplePosition">
+              <a-input v-model="model.samplePosition" placeholder="请输入样品存放位置"  ></a-input>
+            </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: 'ItdmSampleInventoryForm',
+    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: {
+           sampleName: [
+              { required: true, message: '请输入样品名称!'},
+           ],
+           sampleSpecifications: [
+              { required: true, message: '请输入样品规格!'},
+           ],
+           sampleNum: [
+              { required: true, message: '请输入样品数量!'},
+           ],
+           sampleManufacturer: [
+              { required: true, message: '请输入生产厂家!'},
+           ],
+           sampleClassifications: [
+              { required: true, message: '请输入样品分类!'},
+           ],
+           sampleUnit: [
+              { required: true, message: '请输入样品单位!'},
+           ],
+           sampleStatus: [
+              { required: true, message: '请输入样品状态(是否损坏)!'},
+           ],
+           samplePosition: [
+              { required: true, message: '请输入样品存放位置!'},
+           ],
+        },
+        url: {
+          add: "/inventory/itdmSampleInventory/add",
+          edit: "/inventory/itdmSampleInventory/edit",
+          queryById: "/inventory/itdmSampleInventory/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>

+ 84 - 0
itdmWeb/src/views/module-iTDM/inventory/modules/ItdmSampleInventoryModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <itdm-sample-inventory-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></itdm-sample-inventory-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>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import ItdmSampleInventoryForm from './ItdmSampleInventoryForm'
+
+  export default {
+    name: 'ItdmSampleInventoryModal',
+    components: {
+      ItdmSampleInventoryForm
+    },
+    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;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

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

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <itdm-sample-inventory-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></itdm-sample-inventory-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import ItdmSampleInventoryForm from './ItdmSampleInventoryForm'
+  export default {
+    name: 'ItdmSampleInventoryModal',
+    components: {
+      ItdmSampleInventoryForm
+    },
+    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>