2
0

7 Commits 82507ae171 ... a3143a0be9

Autor SHA1 Mensagem Data
  15102826049 a3143a0be9 Merge branch 'dev_ml_423' into xq há 3 semanas atrás
  maliang 9b584599de feat:4.23需求 há 3 semanas atrás
  maliang ff03d39a36 fix:bug[937] há 3 semanas atrás
  maliang c1187dfb9f feat:app版本管理 há 3 semanas atrás
  maliang 4594b14eda fix:bug[935] há 3 semanas atrás
  maliang 7b64139901 fix:bug[905] há 4 semanas atrás
  maliang 59d184ff11 fix:bug há 4 semanas atrás

+ 42 - 0
jshERP-web/src/components/jeecgbiz/JSelectList.vue

@@ -31,6 +31,37 @@
       </a-select>
       <a-button icon="search" @click="onSearch" />
     </a-input-group>
+    <a-input-group v-if="kind === 'material2'" compact style="width: 100%; top: 0px">
+      <a-select
+        placeholder="输入商品条码"
+        :dropdownMatchSelectWidth="false"
+        showSearch
+        :showArrow="false"
+        v-model="names"
+        optionFilterProp="children"
+        :style="searchWidth"
+        notFoundContent="需在商品管理先新增才能使用"
+        @search="handleSearch"
+        @change="handleChange"
+        style="width: 100%"
+      >
+        <div slot="dropdownRender" slot-scope="menu">
+          <v-nodes :vnodes="menu" />
+          <a-divider v-if="materialData.length === 20" style="margin: 4px 0" />
+          <div
+            v-if="materialData.length === 20"
+            style="padding: 4px 8px; cursor: pointer"
+            @mousedown="(e) => e.preventDefault()"
+          >
+            此处最多显示20条,如需更多请点击放大镜查询
+          </div>
+        </div>
+        <a-select-option v-for="item in materialData" :key="item.batchNumber">
+          {{ item.batchNumber }}
+        </a-select-option>
+      </a-select>
+      <a-button icon="search" @click="onSearch" />
+    </a-input-group>
     <a-input-search
       v-if="kind === 'batch' || kind === 'sn' || kind === 'snAdd'"
       v-model="names"
@@ -47,6 +78,15 @@
       @ok="selectOK"
       @initComp="initComp"
     />
+    <j-select-material-modal2
+      v-if="kind === 'material2'"
+      ref="selectModal"
+      :rows="rows"
+      :multi="multi"
+      :bar-code="value"
+      @ok="selectOK"
+      @initComp="initComp"
+    />
     <j-select-batch-modal
       v-if="kind === 'batch'"
       ref="selectModal"
@@ -79,6 +119,7 @@
 
 <script>
 import JSelectMaterialModal from './modal/JSelectMaterialModal'
+import JSelectMaterialModal2 from './modal/JSelectMaterialModal2'
 import JSelectBatchModal from './modal/JSelectBatchModal'
 import JSelectSnModal from './modal/JSelectSnModal'
 import JSelectSnAddModal from './modal/JSelectSnAddModal'
@@ -88,6 +129,7 @@ export default {
   name: 'JSelectList',
   components: {
     JSelectMaterialModal,
+    JSelectMaterialModal2,
     JSelectBatchModal,
     JSelectSnModal,
     JSelectSnAddModal,

+ 522 - 0
jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal2.vue

@@ -0,0 +1,522 @@
+<template>
+  <a-modal
+    :width="modalWidth"
+    :visible="visible"
+    :title="title"
+    :wrapClassName="wrapClassNameInfo()"
+    @ok="handleSubmit"
+    @cancel="close"
+    cancelText="关闭(ESC)"
+    style="top: 20px; height: 95%"
+  >
+    <a-row :gutter="10" style="padding: 10px; margin: -10px">
+      <a-col :md="24" :sm="24">
+        <!-- 查询区域 -->
+        <div class="table-page-search-wrapper">
+          <!-- 搜索区域 -->
+          <a-form layout="inline" @keyup.enter.native="onSearch">
+            <a-row :gutter="24">
+              <a-col :md="6" :sm="8">
+                <a-form-item label="关键词" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-input ref="material" placeholder="请输入条码、名称、助记码等查询" v-model="queryParam.q"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="8">
+                <a-form-item label="规格型号" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-input placeholder="请输入规格、型号" v-model="queryParam.standardOrModel"></a-input>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="8">
+                <a-form-item label="颜色" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
+                  <a-input placeholder="请输入颜色" v-model="queryParam.color"></a-input>
+                </a-form-item>
+              </a-col>
+              <!-- <a-col :md="6" :sm="8">
+                <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓库">
+                  <a-select
+                    placeholder="选择仓库"
+                    v-model="queryParam.depotId"
+                    @change="onDepotChange"
+                    :dropdownMatchSelectWidth="false"
+                    showSearch
+                    optionFilterProp="children"
+                    allow-clear
+                  >
+                    <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.id">
+                      {{ item.depotName }}
+                    </a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col> -->
+              <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
+                <a-col :md="6" :sm="8">
+                  <a-button type="primary" @click="loadMaterialData(1)">查询</a-button>
+                  <a-button style="margin-left: 8px" @click="searchReset(1)">重置</a-button>
+                  <a-tooltip title="没查询到,决定新增商品!">
+                    <a-button style="margin-left: 8px" @click="addMaterial">新增</a-button>
+                  </a-tooltip>
+                  <a @click="handleToggleSearch" style="margin-left: 8px">
+                    {{ toggleSearchStatus ? '收起' : '展开' }}
+                    <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
+                  </a>
+                </a-col>
+              </span>
+              <template v-if="toggleSearchStatus">
+          
+                <a-col :md="6" :sm="8">
+                  <a-form-item label="品牌" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
+                    <a-input placeholder="请输入品牌" v-model="queryParam.brand"></a-input>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="8">
+                  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="类别">
+                    <a-tree-select
+                      style="width: 100%"
+                      :dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
+                      allow-clear
+                      :treeData="categoryTree"
+                      v-model="queryParam.categoryId"
+                      placeholder="请选择类别"
+                    >
+                    </a-tree-select>
+                  </a-form-item>
+                </a-col>
+                <!-- <a-col :md="6" :sm="8">
+                  <a-form-item label="制造商" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
+                    <a-input placeholder="请输入制造商" v-model="queryParam.mfrs"></a-input>
+                  </a-form-item>
+                </a-col> -->
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="序列号" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                    <a-select placeholder="有无序列号" v-model="queryParam.enableSerialNumber">
+                      <a-select-option value="1">有</a-select-option>
+                      <a-select-option value="0">无</a-select-option>
+                    </a-select>
+                  </a-form-item>
+                </a-col>
+                <!-- <a-col :md="6" :sm="24">
+                  <a-form-item label="仓库货架" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                    <a-input placeholder="请输入仓库货架" v-model="queryParam.position"></a-input>
+                  </a-form-item>
+                </a-col> -->
+                <!-- <a-col :md="6" :sm="24">
+                  <a-form-item label="批号" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
+                    <a-select placeholder="有无批号" v-model="queryParam.enableBatchNumber">
+                      <a-select-option value="1">有</a-select-option>
+                      <a-select-option value="0">无</a-select-option>
+                    </a-select>
+                  </a-form-item>
+                </a-col> -->
+              </template>
+            </a-row>
+          </a-form>
+          <a-button v-if="isStock" type="primary" @click="findAllSelect">一键全选</a-button>
+          <a-table
+            ref="table"
+            :scroll="scrollTrigger"
+            size="middle"
+            rowKey="id"
+            :columns="columns"
+            :dataSource="dataSource"
+            :pagination="ipagination"
+            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: getType }"
+            :loading="loading"
+            :customRow="rowAction"
+            @change="handleTableChange"
+          >
+            <template slot="customBarCode" slot-scope="text, record">
+              <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">{{ record.mBarCode }}</div>
+              <a-popover placement="right" trigger="click">
+                <template slot="content">
+                  <img :src="getImgUrl(record.imgName, record.imgLarge)" width="500px" />
+                </template>
+                <div class="item-info" v-if="record.imgName">
+                  <img
+                    v-if="record.imgName"
+                    :src="getImgUrl(record.imgName, record.imgSmall)"
+                    class="item-img"
+                    title="查看大图"
+                  />
+                </div>
+              </a-popover>
+            </template>
+            <template slot="customName" slot-scope="text, record">
+              {{ record.name }}
+              <a-tag v-if="record.enableSerialNumber == 1" color="orange">序</a-tag>
+              <a-tag v-if="record.enableBatchNumber == 1" color="orange">批</a-tag>
+            </template>
+            <span slot="action" slot-scope="text, record">
+              <a @click.stop="handleEdit(record)">编辑</a>
+            </span>
+          </a-table>
+        </div>
+      </a-col>
+    </a-row>
+    <material-modal ref="modalForm" @ok="modalFormOk"></material-modal>
+  </a-modal>
+</template>
+
+<script>
+import { getAction, getFileAccessHttpUrl } from '@/api/manage'
+import { filterObj, getMpListShort } from '@/utils/util'
+import { getMaterialBySelect, queryMaterialCategoryTreeList, getMaterialById } from '@/api/api'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { mixinDevice } from '@/utils/mixin'
+import Vue from 'vue'
+
+export default {
+  name: 'JSelectMaterialModal',
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    MaterialModal: () => import('@/views/material/modules/MaterialModal'),
+  },
+  props: ['rows', 'multi', 'barCode', 'isStock'],
+  data() {
+    return {
+      modalWidth: 1450,
+      queryParam: {
+        q: '',
+        standardOrModel: '',
+        color: '',
+        brand: '',
+        categoryId: undefined,
+        mfrs: '',
+        enableSerialNumber: undefined,
+        enableBatchNumber: undefined,
+        position: '',
+      },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      categoryTree: [],
+      columns: [
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          width: 60,
+          scopedSlots: { customRender: 'action' },
+        },
+        // { dataIndex: 'mBarCode', title: '条码', scopedSlots: { customRender: 'customBarCode' } },
+        // { dataIndex: 'batchNumber', title: '批次号' },
+        { dataIndex: 'barCode', title: '商品条码' },
+        { dataIndex: 'name', title: '名称', scopedSlots: { customRender: 'customName' } },
+        { dataIndex: 'categoryName', title: '类别' },
+        // { dataIndex: 'standard', title: '规格' },
+        { dataIndex: 'model', title: '型号' },
+        { dataIndex: 'color', title: '颜色' },
+        { dataIndex: 'brand', title: '品牌' },
+        // { dataIndex: 'supplierName', title: '供应商' },
+        { dataIndex: 'unit', title: '单位' },
+        { dataIndex: 'sku', title: '多属性' },
+        { dataIndex: 'inventory', title: '库存' },
+        // { dataIndex: 'productionDate', title: '生产日期' },
+        // { dataIndex: 'expiryNum', title: '保质期' },
+        // { dataIndex: 'barCode', title: '商品条码' },
+        // { dataIndex: 'depotName', title: '仓库名称' },
+        // { dataIndex: 'position', title: '仓库货架' },
+
+        // { dataIndex: 'expand', title: '扩展信息' },
+      ],
+      scrollTrigger: {},
+      dataSource: [],
+      selectedRowKeys: [],
+      selectMaterialRows: [],
+      selectMaterialIds: [],
+      title: '选择商品',
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0,
+      },
+      isorter: {
+        column: 'createTime',
+        order: 'desc',
+      },
+      departTree: [],
+      depotList: [],
+      visible: false,
+      form: this.$form.createForm(this),
+      loading: false,
+      expandedKeys: [],
+      disableMixinCreated: true,
+    }
+  },
+  computed: {
+    // 计算属性的 getter
+    getType: function () {
+      return this.multi == true ? 'checkbox' : 'radio'
+    },
+  },
+  watch: {
+    barCode: {
+      immediate: true,
+      handler() {
+        this.initBarCode()
+      },
+    },
+  },
+  created() {
+    // 该方法触发屏幕自适应
+    this.resetScreenSize()
+  },
+  methods: {
+    initBarCode() {
+      if (this.barCode) {
+        this.$emit('initComp', this.barCode)
+      } else {
+        // JSelectUserByDep组件bug issues/I16634
+        this.$emit('initComp', '')
+      }
+    },
+    loadMaterialData(arg) {
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      this.loading = true
+      let params = this.getQueryParams() //查询条件
+      getMaterialBySelect(params).then((res) => {
+        if (res) {
+          this.dataSource = res.rows
+          this.ipagination.total = res.total
+          if (res.total === 1) {
+            if (
+              this.queryParam.q === this.dataSource[0].barCode ||
+              this.queryParam.q === this.dataSource[0].name ||
+              this.queryParam.q === this.dataSource[0].mnemonic
+            ) {
+              this.title = '选择商品【再次回车可以直接选中】'
+              this.$nextTick(() => this.$refs.material.focus())
+            } else {
+              this.title = '选择商品'
+            }
+          } else {
+            this.title = '选择商品'
+          }
+        }
+        this.loading = false
+        this.onClearSelected()
+      })
+    },
+    loadTreeData() {
+      let that = this
+      let params = {}
+      params.id = ''
+      queryMaterialCategoryTreeList(params).then((res) => {
+        if (res) {
+          that.categoryTree = []
+          for (let i = 0; i < res.length; i++) {
+            let temp = res[i]
+            that.categoryTree.push(temp)
+          }
+        }
+      })
+    },
+    // 触发屏幕自适应
+    resetScreenSize() {
+      let realScreenWidth = window.screen.width
+      this.modalWidth = realScreenWidth < 1600 ? '1300px' : '1550px'
+      let screenWidth = document.body.clientWidth
+      if (screenWidth < 500) {
+        this.scrollTrigger = { x: 800 }
+      } else {
+        this.scrollTrigger = {}
+      }
+    },
+    showModal(barCode) {
+      this.visible = true
+      this.title = '选择商品'
+      this.queryParam.q = barCode
+      this.$nextTick(() => this.$refs.material.focus())
+      this.loadTreeData()
+      // this.getDepotList()
+      // this.initDepotSelect()
+      this.loadMaterialData()
+      this.form.resetFields()
+    },
+    getQueryParams() {
+      let param = Object.assign({}, this.queryParam, this.isorter)
+      param.mpList = getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
+      param.page = this.ipagination.current
+      param.rows = this.ipagination.pageSize
+      return filterObj(param)
+    },
+    getQueryField() {
+      let str = 'id,'
+      for (let a = 0; a < this.columns.length; a++) {
+        str += ',' + this.columns[a].dataIndex
+      }
+      return str
+    },
+    searchReset(num) {
+      let that = this
+      if (num !== 0) {
+        that.queryParam = {}
+        that.loadMaterialData(1)
+      }
+      that.selectedRowKeys = []
+      that.selectMaterialIds = []
+    },
+    addMaterial() {
+      this.$refs.modalForm.add()
+      this.$refs.modalForm.title = '新增商品'
+    },
+    handleEdit(record) {
+      getMaterialById({ mid: record.mid }).then((res) => {
+        this.$refs.modalForm.edit(res.data)
+        this.$refs.modalForm.title = '编辑'
+        this.$refs.modalForm.disableSubmit = false
+        this.$refs.modalForm.showOkFlag = true
+      })
+    },
+    getImgUrl(imgName, type) {
+      if (imgName && imgName.split(',')) {
+        type = type ? type + '/' : ''
+        return getFileAccessHttpUrl('systemConfig/static/' + type + imgName.split(',')[0])
+      } else {
+        return ''
+      }
+    },
+    close() {
+      this.searchReset(0)
+      this.visible = false
+    },
+    handleTableChange(pagination, filters, sorter) {
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
+      }
+      this.ipagination = pagination
+      this.loadMaterialData()
+    },
+    handleSubmit() {
+      let that = this
+      this.getSelectMaterialRows()
+      that.$emit('ok', that.selectMaterialRows, that.selectMaterialIds)
+      that.searchReset(0)
+      that.close()
+    },
+    //获取选择信息
+    getSelectMaterialRows(rowId) {
+      let dataSource = this.dataSource
+      let materialIds = ''
+      this.selectMaterialRows = []
+      console.log('getSelectMaterialRows', this.selectedRowKeys)
+      for (let i = 0, len = dataSource.length; i < len; i++) {
+        if (this.selectedRowKeys.includes(dataSource[i].id)) {
+          this.selectMaterialRows.push(dataSource[i])
+          materialIds = materialIds + ',' + dataSource[i].barCode
+        }
+      }
+      console.log('materialIds=====',materialIds)
+      this.selectMaterialIds = materialIds.substring(1)
+    },
+    getDepotList() {
+      let that = this
+      getAction('/depot/findDepotByCurrentUser').then((res) => {
+        if (res.code === 200) {
+          that.depotList = res.data
+        }
+      })
+    },
+    // initDepotSelect() {
+    //   if (this.rows) {
+    //     if (JSON.parse(this.rows).depotId) {
+    //       const id = JSON.parse(this.rows).depotId - 0
+    //       this.queryParam.depotId = id + ''
+    //     }
+    //   }
+    // },
+    // onDepotChange(value) {
+    //   this.queryParam.depotId = value
+    // },
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectionRows = selectionRows
+      console.log('onSelectChange', selectedRowKeys, selectionRows)
+    },
+    onSearch() {
+      if (this.dataSource && this.dataSource.length === 1) {
+        if (
+          this.queryParam.q === this.dataSource[0].mBarCode ||
+          this.queryParam.q === this.dataSource[0].name ||
+          this.queryParam.q === this.dataSource[0].mnemonic
+        ) {
+          let arr = []
+          arr.push(this.dataSource[0].id)
+          this.selectedRowKeys = arr
+          this.handleSubmit()
+        } else {
+          this.loadMaterialData(1)
+        }
+      } else {
+        this.loadMaterialData(1)
+      }
+    },
+    modalFormOk() {
+      this.loadMaterialData()
+    },
+    rowAction(record, index) {
+      return {
+        on: {
+          click: () => {
+            let arr = []
+            arr.push(record.id)
+            this.selectedRowKeys = arr
+          },
+          dblclick: () => {
+            let arr = []
+            arr.push(record.id)
+            this.selectedRowKeys = arr
+            this.handleSubmit()
+          },
+        },
+      }
+    },
+    findAllSelect() {
+      this.$emit('all', this.queryParam)
+    },
+  },
+}
+</script>
+
+<style scoped>
+.ant-table-tbody .ant-table-row td {
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
+
+#components-layout-demo-custom-trigger .trigger {
+  font-size: 18px;
+  line-height: 64px;
+  padding: 0 24px;
+  cursor: pointer;
+  transition: color 0.3s;
+}
+
+.item-info {
+  float: left;
+  width: 30px;
+  height: 30px;
+  margin-left: 8px;
+}
+.item-img {
+  cursor: pointer;
+  position: static;
+  display: block;
+  width: 100%;
+  height: 100%;
+  object-fit: cover;
+}
+</style>

+ 1 - 0
jshERP-web/src/utils/JEditableTableUtil.js

@@ -63,6 +63,7 @@ export function validateFormAndTables(form, cases) {
     })
   })
     .then((values) => {
+      console.log(11111,values)
       Object.assign(options, { formValue: values })
       // 验证所有子表的表单
       return validateTables(cases)

+ 17 - 1
jshERP-web/src/views/bill/dialog/BillDetail.vue

@@ -1471,6 +1471,20 @@
           <a-col :span="14"></a-col>
         </a-row>
       </template>
+      <template v-if="fileList && fileList.length > 0">
+        <a-row class="form-row" :gutter="24">
+          <a-col :span="10">
+            <a-form-item
+              :labelCol="{ xs: { span: 24 }, sm: { span: 3 } }"
+              :wrapperCol="{ xs: { span: 24 }, sm: { span: 21 } }"
+              label="凭证图片"
+            >
+              <j-upload v-model="voucherPictureList" bizPath="bill" :disabled="true" :buttonVisible="false"></j-upload>
+            </a-form-item>
+          </a-col>
+          <a-col :span="14"></a-col>
+        </a-row>
+      </template>
     </a-form>
     <bill-print-iframe ref="modalDetail"></bill-print-iframe>
     <financial-detail ref="financialDetailModal"></financial-detail>
@@ -1515,6 +1529,7 @@ export default {
       billType: '',
       billPrintFlag: false,
       fileList: [],
+      voucherPictureList: [],
       purchaseBySaleFlag: false,
       linkNumberList: [],
       financialBillNoList: [],
@@ -1680,7 +1695,7 @@ export default {
         { title: '实际入库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '入库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '入库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '入库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '入库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '入库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },
@@ -2194,6 +2209,7 @@ export default {
           this.prefixNo = prefixNo
           //附件下载
           this.fileList = item.fileName
+          this.voucherPictureList = item.voucherPicture?item.voucherPicture.split(','):[] //凭证图片
           this.visible = true
           this.modalStyle = 'top:20px;height: 95%;'
           this.model = Object.assign({}, item)

+ 126 - 1
jshERP-web/src/views/bill/mixins/BillModalMixin.js

@@ -8,6 +8,8 @@ import {
   getBatchNumberList,
   getCurrentSystemConfig,
   getMaterialByBatchNumber,
+  getMaterialByBarCode,
+  getMaterialBySelect,
   getPersonByNumType,
   getPlatformConfigByKey,
   getUnitInfo,
@@ -80,6 +82,14 @@ export const BillModalMixin = {
     this.width = realScreenWidth < 1500 ? '1200px' : '1550px'
     this.minWidth = realScreenWidth < 1500 ? 1150 : 1500
   },
+  watch:{
+    $route(to, from) {
+      if(this.handleCancel){
+        this.handleCancel()
+      }
+      this.visible = false
+    }
+  },
   mounted() {
     document.getElementById(this.prefixNo).addEventListener('keydown', this.handleOkKey)
     this.getCreatorSpinnerList()
@@ -464,7 +474,26 @@ export const BillModalMixin = {
         })
       }
     },
-
+    //根据【仓库名】带出对应的【仓位货架】
+    async setProPosition(barCode, depotId){
+      const res = await getMaterialBySelect({
+        q: barCode,
+        page: 1,
+        rows: 20
+      })
+      debugger
+      let proDetail
+      if (res && res.rows) {
+        proDetail = res.rows[0]? res.rows[0] : {}
+      }
+      // 商品id
+      if(proDetail.mid){
+        const res2 = await getAction('/material/getPositionByDidAndMid', { mid: proDetail.mid, did: depotId })
+        console.log('getPositionByDidAndMid======',res2)
+        if (res2 && res2.code === 200) {
+        }
+      }
+    },
     //单元值改变一个字符就触发一次
     onValueChange(event) {
       let that = this
@@ -476,6 +505,16 @@ export const BillModalMixin = {
           if (row.barCode) {
             that.getStockByDepotBarCode(row, target)
           }
+          console.log('row========', row)
+          // // 选择商品自动带出barCode、商品ID
+          if(row.depotId&&row.barCode){
+            // console.log('row.depotId========', row.depotId)
+            // // 根据仓库id自动带出仓位货架(若有)参数:商品id、仓库id
+            // getAction('/material/getPositionByDidAndMid',{mid:row.mid,did:row.depotId}).then((res) => {
+            //   console.log('res========', res)
+            // })
+            this.setProPosition(row.barCode, row.depotId)
+          }
           break
         case 'batchNumber':
           param = {
@@ -502,6 +541,7 @@ export const BillModalMixin = {
                     let mObj = this.parseInfoToObj(mInfo)
                     mObj.depotId = mInfo.depotId
                     mObj.stock = mInfo.stock
+                    mObj.inventory = mInfo.inventory
                     mArr.push(mObj)
                   }
                   let allPriceTotal = 0
@@ -540,6 +580,91 @@ export const BillModalMixin = {
                     this.changeColumnShow(mInfo)
                     let mInfoEx = this.parseInfoToObj(mInfo)
                     mInfoEx.stock = res.data.stock
+                    mInfoEx.inventory = mInfo.inventory
+                    let mObj = {
+                      rowKey: row.id,
+                      values: mInfoEx,
+                    }
+                    mArr.push(mObj)
+                    target.setValues(mArr)
+                    target.recalcAllStatisticsColumns()
+                    that.autoChangePrice(target)
+                    target.autoSelectBySpecialKey('operNumber', row.orderNum)
+                    //强制渲染
+                    target.$forceUpdate()
+                  }
+                })
+              }
+            }
+          })
+          break
+        case 'barCode':
+          param = {
+            barCode: value,
+            organId: this.form.getFieldValue('organId'),
+            mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
+            prefixNo: this.prefixNo,
+          }
+          getMaterialByBarCode(param).then((res) => {
+            if (res && res.code === 200) {
+              let mList = res.data
+
+              if (value.indexOf(',') > -1) {
+                //多个条码
+                this.$refs.materialDataTable.getValues((error, values) => {
+                  values.pop() //移除最后一行数据
+                  let mArr = values
+                  console.log('values========', values)
+                  for (let i = 0; i < mList.length; i++) {
+                    let mInfo = mList[i]
+                    if (mInfo.unitId) {
+                      mInfo.unitList = JSON.stringify(mInfo.unitList)
+                    }
+                    this.changeColumnShow(mInfo)
+                    let mObj = this.parseInfoToObj(mInfo)
+                    mObj.depotId = mInfo.depotId
+                    mObj.stock = mInfo.stock
+                    mObj.mid = mInfo.id
+                    mObj.inventory = mInfo.inventory
+                    mArr.push(mObj)
+                  }
+                  let allPriceTotal = 0
+                  let taxLastMoneyTotal = 0
+                  for (let j = 0; j < mArr.length; j++) {
+                    allPriceTotal += mArr[j].allPrice - 0
+                    taxLastMoneyTotal += mArr[j].taxLastMoney - 0
+                    //组合和拆分单据给商品类型进行重新赋值
+                    if (j === 0) {
+                      mArr[0].mType = '组合件'
+                    } else {
+                      mArr[j].mType = '普通子件'
+                    }
+                  }
+
+                  this.materialTable.dataSource = mArr
+                  if (this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') {
+                    target.statisticsColumns.allPrice = allPriceTotal
+                  } else {
+                    target.statisticsColumns.taxLastMoney = taxLastMoneyTotal
+                  }
+                  that.autoChangePrice(target)
+                  //强制渲染
+                  target.$forceUpdate()
+                })
+              } else {
+                //单个条码
+                let depotIdSelected = row.depotId || ''
+                findStockByDepotAndBarCode({ depotId: depotIdSelected, barCode: row.barCode }).then((res) => {
+                  if (res && res.code === 200) {
+                    let mArr = []
+                    let mInfo = mList[0]
+                    if (mInfo.unitId) {
+                      mInfo.unitList = JSON.stringify(mInfo.unitList)
+                    }
+                    this.changeColumnShow(mInfo)
+                    let mInfoEx = this.parseInfoToObj(mInfo)
+                    mInfoEx.stock = res.data.stock
+                    mInfoEx.inventory = mInfo.inventory
                     let mObj = {
                       rowKey: row.id,
                       values: mInfoEx,

+ 52 - 39
jshERP-web/src/views/bill/modules/OtherInModal.vue

@@ -283,76 +283,89 @@ export default {
           // },
           // { title: '批次号', key: 'batchNumber', width: '9%', type: FormTypes.normal },
           {
-            title: '批次号',
-            key: 'batchNumber',
-            width: '12%',
+            title: '商品条码',
+            key: 'barCode',
+            width: '200px',
             type: FormTypes.popupJsh,
-            kind: 'material',
+            kind: 'material2',
             multi: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '名称', key: 'name', width: '9%', type: FormTypes.normal },
+          { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
           // { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
 
-          { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal },
-          { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
-          { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotId', width: '9%', type: FormTypes.normal },
-          { title: '仓库货架', key: 'position', width: '6%', type: FormTypes.normal },
-          { title: '包装规格', key: 'unitName', width: '7%', type: FormTypes.normal },
+          {
+            title: '生产日期',
+            key: 'productionDate',
+            width: '200px',
+            type: FormTypes.datetime,
+            validateRules: [{ required: true, message: '${title}不能为空' }],
+          },
+          { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.inputNumber },
+          // { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
+          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.select },
+          { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
+          { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
-          { title: '型号', key: 'model', width: '9%', type: FormTypes.normal },
-          { title: '颜色', key: 'color', width: '9%', type: FormTypes.normal },
-          { title: '品牌', key: 'brand', width: '9%', type: FormTypes.normal },
-          { title: '制造商', key: 'mfrs', width: '6%', type: FormTypes.normal },
-          { title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
-          { title: '库存', key: 'inventory', width: '5%', type: FormTypes.normal },
+          { title: '型号', key: 'model', width: '120px', type: FormTypes.normal },
+          { title: '颜色', key: 'color', width: '120px', type: FormTypes.normal },
+          { title: '品牌', key: 'brand', width: '120px', type: FormTypes.normal },
+          { title: '制造商', key: 'mfrs', width: '120px', type: FormTypes.normal },
+          { title: '扩展信息', key: 'materialOther', width: '120px', type: FormTypes.normal },
+          { title: '库存', key: 'stock', width: '120px', type: FormTypes.normal },
           {
             title: '单位',
             key: 'unit',
-            width: '6%',
-            type: FormTypes.slot,
-            options: [],
-            allowClear: false,
-            slotName: 'unit',
+            width: '120px',
+            type: FormTypes.normal,
+            // options: [],
+            // allowClear: false,
+            // slotName: 'unit',
+          },
+          {
+            title: '销售价',
+            key: 'wholesaleDecimal',
+            width: '120px',
+            type: FormTypes.input,
+            validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单位id', key: 'unitId', width: '4%', type: FormTypes.hidden },
-          { title: '单位列表', key: 'unitList', width: '5%', type: FormTypes.hidden },
-          { title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'snAdd', multi: true },
-          { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.date },
-          { title: '多属性', key: 'sku', width: '9%', type: FormTypes.normal },
-          { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
-          { title: '已入库', key: 'finishNumber', width: '4%', type: FormTypes.normal },
+          { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
+          { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
+          { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'snAdd', multi: true },
+          { title: '有效期', key: 'expirationDate', width: '120px', type: FormTypes.date },
+          { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
+          { title: '原数量', key: 'preNumber', width: '120px', type: FormTypes.normal },
+          { title: '已入库', key: 'finishNumber', width: '120px', type: FormTypes.normal },
           {
             title: '入库数量',
             key: 'operNumber',
-            width: '5%',
+            width: '120px',
             type: FormTypes.inputNumber,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber },
-          { title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.inputNumber },
+          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, statistics: true },
           {
             title: '实际入库数量',
             key: 'actualQuantityInStorage',
-            width: '9%',
+            width: '120px',
             type: FormTypes.inputNumber,
             validateRules: [{ required: true, message: '实际入库数量不能为空' }],
           },
-          { title: '入库差异', key: 'warehousingVariance', width: '9%', type: FormTypes.input },
-          { title: '入库差异原因', key: 'reasonOfDifference', width: '9%', type: FormTypes.input },
+          { title: '入库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.input },
+          { title: '入库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           {
             title: '入库人',
             key: 'warehousingUser',
-            width: '9%',
+            width: '120px',
             type: FormTypes.slot,
             slotName: 'warehousingUser',
             validateRules: [{ required: true, message: '入库人不能为空' }],
           },
-          { title: '入库时间', key: 'warehousingTime', width: '9%', type: FormTypes.date },
-          { title: '备注', key: 'remark', width: '5%', type: FormTypes.input },
-          { title: '关联id', key: 'linkId', width: '5%', type: FormTypes.hidden },
+          { title: '入库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
+          { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
+          { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
         ],
       },
       confirmLoading: false,

+ 40 - 39
jshERP-web/src/views/bill/modules/OtherOutModal.vue

@@ -282,78 +282,79 @@ export default {
           //   validateRules: [{ required: true, message: '${title}不能为空' }],
           // },
           {
-            title: '批次号',
-            key: 'batchNumber',
-            width: '12%',
+            title: '商品条码',
+            key: 'barCode',
+            width: '200px',
             type: FormTypes.popupJsh,
-            kind: 'material',
+            kind: 'material2',
             multi: true,
             newBatch: true,
 
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '名称', key: 'name', width: '9%', type: FormTypes.normal },
+          { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
           // { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
 
-          { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal, disabled: true },
-          { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
-          { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotId', width: '9%', type: FormTypes.select, disabled: true },
-          { title: '仓库货架', key: 'position', width: '6%', type: FormTypes.normal },
-          { title: '包装规格', key: 'unitName', width: '7%', type: FormTypes.normal },
+          // { title: '生产日期', key: 'productionDate', width: '200px', type: FormTypes.normal, disabled: true },
+          // { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.normal },
+          // { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
+          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.select },
+          { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.normal },
+          { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
-          { title: '型号', key: 'model', width: '9%', type: FormTypes.normal },
-          { title: '颜色', key: 'color', width: '9%', type: FormTypes.normal },
-          { title: '品牌', key: 'brand', width: '9%', type: FormTypes.normal },
-          { title: '制造商', key: 'mfrs', width: '6%', type: FormTypes.normal },
-          { title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
-          { title: '库存', key: 'inventory', width: '5%', type: FormTypes.normal },
+          { title: '型号', key: 'model', width: '120px', type: FormTypes.normal },
+          { title: '颜色', key: 'color', width: '120px', type: FormTypes.normal },
+          { title: '品牌', key: 'brand', width: '120px', type: FormTypes.normal },
+          { title: '制造商', key: 'mfrs', width: '120px', type: FormTypes.normal },
+          { title: '扩展信息', key: 'materialOther', width: '120px', type: FormTypes.normal },
+          { title: '库存', key: 'stock', width: '120px', type: FormTypes.normal },
           {
             title: '单位',
             key: 'unit',
-            width: '6%',
-            type: FormTypes.slot,
-            options: [],
-            allowClear: false,
-            slotName: 'unit',
+            width: '120px',
+            type: FormTypes.normal,
+            // options: [],
+            // allowClear: false,
+            // slotName: 'unit',
           },
-          { title: '单位id', key: 'unitId', width: '4%', type: FormTypes.hidden },
-          { title: '单位列表', key: 'unitList', width: '5%', type: FormTypes.hidden },
-          { title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'sn', multi: true },
-          { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.input, readonly: true },
-          { title: '多属性', key: 'sku', width: '9%', type: FormTypes.normal },
-          { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
-          { title: '已入库', key: 'finishNumber', width: '4%', type: FormTypes.normal },
+          { title: '销售价', key: 'feild1', width: '120px', type: FormTypes.input },
+          { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
+          { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
+          { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'sn', multi: true },
+          // { title: '有效期', key: 'expirationDate', width: '120px', type: FormTypes.date, readonly: true },
+          { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
+          { title: '原数量', key: 'preNumber', width: '120px', type: FormTypes.normal },
+          { title: '已入库', key: 'finishNumber', width: '120px', type: FormTypes.normal },
           {
             title: '出库数量',
             key: 'operNumber',
-            width: '5%',
+            width: '120px',
             type: FormTypes.inputNumber,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber },
-          { title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.inputNumber },
+          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, statistics: true },
           {
             title: '实际出库数量',
             key: 'actualQuantityInStorage',
-            width: '9%',
+            width: '120px',
             type: FormTypes.inputNumber,
             validateRules: [{ required: true, message: '实际入库数量不能为空' }],
           },
-          { title: '出库差异', key: 'warehousingVariance', width: '9%', type: FormTypes.input },
-          { title: '出库差异原因', key: 'reasonOfDifference', width: '9%', type: FormTypes.input },
+          { title: '出库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.input },
+          { title: '出库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           {
             title: '出库人',
             key: 'warehousingUser',
-            width: '9%',
+            width: '120px',
             type: FormTypes.slot,
             slotName: 'warehousingUser',
             validateRules: [{ required: true, message: '出库人不能为空' }],
           },
-          { title: '出库时间', key: 'warehousingTime', width: '9%', type: FormTypes.date },
-          { title: '备注', key: 'remark', width: '5%', type: FormTypes.input },
-          { title: '关联id', key: 'linkId', width: '5%', type: FormTypes.hidden },
+          { title: '出库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
+          { title: '备注', key: 'remark', width: '120px', type: FormTypes.input },
+          { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
         ],
       },
       confirmLoading: false,

+ 57 - 44
jshERP-web/src/views/bill/modules/PurchaseInModal.vue

@@ -102,7 +102,7 @@
           :loading="materialTable.loading"
           :columns="materialTable.columns"
           :dataSource="materialTable.dataSource"
-          :minWidth="minWidth"
+          :minWidth="1200"
           :maxHeight="300"
           :rowNumber="false"
           :rowSelection="rowCanEdit"
@@ -461,90 +461,103 @@ export default {
           //   validateRules: [{ required: true, message: '${title}不能为空' }],
           // },
           {
-            title: '批次号',
-            key: 'batchNumber',
-            width: '12%',
+            title: '商品条码',
+            key: 'barCode',
+            width: '200px',
             type: FormTypes.popupJsh,
-            kind: 'material',
+            kind: 'material2',
             multi: true,
             newBatch: true,
 
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '名称', key: 'name', width: '9%', type: FormTypes.normal },
-          { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
+          { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
+          { title: '规格', key: 'standard', width: '120px', type: FormTypes.normal },
 
-          { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal, disabled: true },
-          { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
-          { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotId', width: '9%', type: FormTypes.select, disabled: true },
-          { title: '仓库货架', key: 'position', width: '6%', type: FormTypes.normal },
-          { title: '包装规格', key: 'unitName', width: '7%', type: FormTypes.normal },
+          {
+            title: '生产日期',
+            key: 'productionDate',
+            width: '200px',
+            type: FormTypes.datetime,
+            validateRules: [{ required: true, message: '${title}不能为空' }],
+          },
+          { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.inputNumber },
+          // { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
+          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.select },
+          { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
+          { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
-          { title: '型号', key: 'model', width: '9%', type: FormTypes.normal },
-          { title: '颜色', key: 'color', width: '9%', type: FormTypes.normal },
-          { title: '品牌', key: 'brand', width: '9%', type: FormTypes.normal },
-          { title: '制造商', key: 'mfrs', width: '6%', type: FormTypes.normal },
-          { title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
-          { title: '库存', key: 'inventory', width: '5%', type: FormTypes.normal },
+          { title: '型号', key: 'model', width: '120px', type: FormTypes.normal },
+          { title: '颜色', key: 'color', width: '120px', type: FormTypes.normal },
+          { title: '品牌', key: 'brand', width: '120px', type: FormTypes.normal },
+          { title: '制造商', key: 'mfrs', width: '120px', type: FormTypes.normal },
+          { title: '扩展信息', key: 'materialOther', width: '120px', type: FormTypes.normal },
+          { title: '库存', key: 'inventory', width: '120px', type: FormTypes.normal },
           {
             title: '单位',
             key: 'unit',
-            width: '6%',
-            type: FormTypes.slot,
-            options: [],
-            allowClear: false,
-            slotName: 'unit',
+            width: '120px',
+            type: FormTypes.normal,
+            // options: [],
+            // allowClear: false,
+            // slotName: 'unit',
+          },
+          {
+            title: '销售价',
+            key: 'wholesaleDecima',
+            width: '120px',
+            type: FormTypes.input,
+            validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单位id', key: 'unitId', width: '4%', type: FormTypes.hidden },
-          { title: '单位列表', key: 'unitList', width: '5%', type: FormTypes.hidden },
-          { title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'snAdd', multi: true },
-          { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.date },
-          { title: '多属性', key: 'sku', width: '9%', type: FormTypes.normal },
-          { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
-          { title: '已入库', key: 'finishNumber', width: '4%', type: FormTypes.normal },
+          { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
+          { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
+          { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'snAdd', multi: true },
+          { title: '有效期', key: 'expirationDate', width: '120px', type: FormTypes.date },
+          { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
+          { title: '原数量', key: 'preNumber', width: '120px', type: FormTypes.normal },
+          { title: '已入库', key: 'finishNumber', width: '120px', type: FormTypes.normal },
           {
             title: '入库数量',
             key: 'operNumber',
-            width: '5%',
+            width: '120px',
             type: FormTypes.inputNumber,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单价', key: 'unitPrice', width: '4%', type: FormTypes.inputNumber },
-          { title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
-          { title: '税率', key: 'taxRate', width: '4%', type: FormTypes.inputNumber, placeholder: '%' },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.inputNumber },
+          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, statistics: true },
+          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.inputNumber, placeholder: '%' },
           {
             title: '税额',
             key: 'taxMoney',
-            width: '5%',
+            width: '120px',
             type: FormTypes.inputNumber,
             readonly: true,
             statistics: true,
           },
-          { title: '价税合计', key: 'taxLastMoney', width: '7%', type: FormTypes.inputNumber, statistics: true },
+          { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber, statistics: true },
 
           {
             title: '实际入库数量',
             key: 'actualQuantityInStorage',
-            width: '9%',
+            width: '120px',
             type: FormTypes.inputNumber,
             validateRules: [{ required: true, message: '实际入库数量不能为空' }],
           },
-          { title: '入库差异', key: 'warehousingVariance', width: '9%', type: FormTypes.input },
-          { title: '入库差异原因', key: 'reasonOfDifference', width: '9%', type: FormTypes.input },
+          { title: '入库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.input },
+          { title: '入库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           {
             title: '入库人',
             key: 'warehousingUser',
-            width: '9%',
+            width: '120px',
             type: FormTypes.slot,
             slotName: 'warehousingUser',
             validateRules: [{ required: true, message: '入库人不能为空' }],
           },
-          { title: '入库时间', key: 'warehousingTime', width: '9%', type: FormTypes.date },
+          { title: '入库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
 
-          { title: '备注', key: 'remark', width: '6%', type: FormTypes.input },
-          { title: '关联id', key: 'linkId', width: '5%', type: FormTypes.hidden },
+          { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
+          { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
         ],
       },
       confirmLoading: false,

+ 54 - 42
jshERP-web/src/views/bill/modules/PurchaseOrderModal.vue

@@ -115,12 +115,11 @@
           </a-col>
         </a-row>
         <j-editable-table
-          id="billModal"
           :ref="refKeys[0]"
           :loading="materialTable.loading"
           :columns="materialTable.columns"
           :dataSource="materialTable.dataSource"
-          :minWidth="minWidth"
+          :minWidth="1200"
           :maxHeight="300"
           :rowNumber="false"
           :rowSelection="rowCanEdit"
@@ -166,7 +165,7 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
           </template>
-          <template #unit="{ handleChange, handleFocus, value }">
+          <!-- <template #unit="{ handleChange, handleFocus, value }">
             <a-select
               placeholder="请选择"
               v-decorator="['unit']"
@@ -182,7 +181,7 @@
                 {{ item.name }}
               </a-select-option>
             </a-select>
-          </template>
+          </template> -->
         </j-editable-table>
         <a-row class="form-row" :gutter="24">
           <a-col :lg="24" :md="24" :sm="24">
@@ -387,6 +386,7 @@ export default {
     },
   },
   data() {
+    const that = this
     return {
       title: '操作',
       width: '1600px',
@@ -419,56 +419,68 @@ export default {
         loading: false,
         dataSource: [],
         columns: [
-          { title: '', key: 'hiddenKey', width: '1%', type: FormTypes.hidden },
           {
-            title: '批次号',
-            key: 'batchNumber',
-            width: '12%',
+            title: '商品条码',
+            key: 'barCode',
+            width: '200px',
             type: FormTypes.popupJsh,
-            kind: 'material',
+            kind: 'material2',
             multi: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '名称', key: 'name', width: '10%', type: FormTypes.normal },
-          { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
+          { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
+          { title: '规格', key: 'standard', width: '120px', type: FormTypes.normal },
 
-          { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal },
-          { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
-          { title: '商品条码', key: 'barCode', width: '6%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotId', width: '9%', type: FormTypes.select, disabled: true },
-          { title: '仓库货架', key: 'position', width: '6%', type: FormTypes.normal },
-          { title: '包装规格', key: 'unitName', width: '6%', type: FormTypes.normal },
+          {
+            title: '生产日期',
+            key: 'productionDate',
+            width: '200px',
+            type: FormTypes.datetime,
+            validateRules: [{ required: true, message: '${title}不能为空' }],
+          },
+          { title: '保质期', key: 'expiryNum', width: '120px', type: FormTypes.inputNumber },
+          // { title: '商品条码', key: 'barCode', width: '120px', type: FormTypes.normal },
+          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.select },
+          { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
+          { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
-          { title: '型号', key: 'model', width: '9%', type: FormTypes.normal },
-          { title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
-          { title: '品牌', key: 'brand', width: '6%', type: FormTypes.normal },
-          { title: '制造商', key: 'mfrs', width: '6%', type: FormTypes.normal },
-          { title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
-          { title: '库存', key: 'inventory', width: '5%', type: FormTypes.normal },
+          { title: '型号', key: 'model', width: '120px', type: FormTypes.normal },
+          { title: '颜色', key: 'color', width: '120px', type: FormTypes.normal },
+          { title: '品牌', key: 'brand', width: '120px', type: FormTypes.normal },
+          { title: '制造商', key: 'mfrs', width: '120px', type: FormTypes.normal },
+          { title: '扩展信息', key: 'materialOther', width: '120px', type: FormTypes.normal },
+          { title: '库存', key: 'inventory', width: '120px', type: FormTypes.normal },
           {
             title: '单位',
             key: 'unit',
-            width: '6%',
-            type: FormTypes.slot,
-            options: [],
-            allowClear: false,
-            slotName: 'unit',
+            width: '120px',
+            type: FormTypes.normal,
+            // options: [],
+            // allowClear: false,
+            // slotName: 'unit',
+          },
+          {
+            title: '销售价',
+            key: 'wholesaleDecima',
+            width: '120px',
+            type: FormTypes.input,
+            validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单位id', key: 'unitId', width: '4%', type: FormTypes.hidden },
-          { title: '单位列表', key: 'unitList', width: '5%', type: FormTypes.hidden },
-          { title: '多属性', key: 'sku', width: '9%', type: FormTypes.normal },
-          { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
-          { title: '已采购', key: 'finishNumber', width: '4%', type: FormTypes.normal },
+          { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
+          { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
+          { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
+          { title: '原数量', key: 'preNumber', width: '120px', type: FormTypes.normal },
+          { title: '已采购', key: 'finishNumber', width: '120px', type: FormTypes.normal },
           {
             title: '数量',
             key: 'operNumber',
-            width: '5%',
+            width: '120px',
             type: FormTypes.inputNumber,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单价', key: 'unitPrice', width: '5%', type: FormTypes.inputNumber },
-          { title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.inputNumber },
+          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, statistics: true },
 
           // {
           //   title: '实际入库数量',
@@ -488,18 +500,18 @@ export default {
           // },
           // { title: '入库时间', key: 'warehousingTime', width: '9%', type: FormTypes.date },
 
-          { title: '税率', key: 'taxRate', width: '4%', type: FormTypes.inputNumber, placeholder: '%' },
+          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.inputNumber, placeholder: '%' },
           {
             title: '税额',
             key: 'taxMoney',
-            width: '5%',
+            width: '120px',
             type: FormTypes.inputNumber,
             readonly: true,
             statistics: true,
           },
-          { title: '价税合计', key: 'taxLastMoney', width: '7%', type: FormTypes.inputNumber, statistics: true },
-          { title: '备注', key: 'remark', width: '6%', type: FormTypes.input },
-          { title: '关联id', key: 'linkId', width: '5%', type: FormTypes.hidden },
+          { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber, statistics: true },
+          { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
+          { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
         ],
       },
       confirmLoading: false,
@@ -527,7 +539,7 @@ export default {
       this.billStatus = '0'
       this.currentSelectDepotId = ''
       this.rowCanEdit = true
-      this.materialTable.columns[1].type = FormTypes.popupJsh
+      // this.materialTable.columns[1].type = FormTypes.popupJsh
       this.changeColumnHide()
       this.changeFormTypes(this.materialTable.columns, 'preNumber', 0)
       this.changeFormTypes(this.materialTable.columns, 'finishNumber', 0)

+ 38 - 38
jshERP-web/src/views/bill/modules/SaleOrderModal.vue

@@ -146,7 +146,7 @@
               <a-button icon="import" @click="onImport(prefixNo)">导入明细</a-button>
             </a-row>
           </template>
-          <template #unit="{ handleChange, handleFocus, value }">
+          <!-- <template #unit="{ handleChange, handleFocus, value }">
             <a-select
               placeholder="请选择"
               v-decorator="['unit']"
@@ -162,7 +162,7 @@
                 {{ item.name }}
               </a-select-option>
             </a-select>
-          </template>
+          </template> -->
         </j-editable-table>
         <a-row class="form-row" :gutter="24">
           <a-col :lg="24" :md="24" :sm="24">
@@ -385,68 +385,68 @@ export default {
         loading: false,
         dataSource: [],
         columns: [
-          { title: '', key: 'hiddenKey', width: '1%', type: FormTypes.hidden },
+          // { title: '', key: 'hiddenKey', width: '1%', type: FormTypes.hidden },
           {
-            title: '批次号',
-            key: 'batchNumber',
-            width: '12%',
+            title: '商品条码',
+            key: 'barCode',
+            width: '200px',
             type: FormTypes.popupJsh,
-            kind: 'material',
+            kind: 'material2',
             multi: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '名称', key: 'name', width: '9%', type: FormTypes.normal },
+          { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
           // { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
 
-          { title: '生产日期', key: 'productionDate', width: '6%', type: FormTypes.normal },
-          { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
-          { title: '商品条码', key: 'barCode', width: '6%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotId', width: '9%', type: FormTypes.select, disabled: true },
-          { title: '仓库货架', key: 'position', width: '6%', type: FormTypes.normal },
-          { title: '包装规格', key: 'unitName', width: '6%', type: FormTypes.normal },
+          // { title: '生产日期', key: 'productionDate', width: '6%', type: FormTypes.normal },
+          // { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
+          // { title: '商品条码', key: 'barCode', width: '6%', type: FormTypes.normal },
+          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.select },
+          { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
+          { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
-          { title: '型号', key: 'model', width: '9%', type: FormTypes.normal },
-          { title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
-          { title: '品牌', key: 'brand', width: '6%', type: FormTypes.normal },
-          { title: '制造商', key: 'mfrs', width: '6%', type: FormTypes.normal },
-          { title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
-          { title: '库存', key: 'inventory', width: '5%', type: FormTypes.normal },
+          { title: '型号', key: 'model', width: '120px', type: FormTypes.normal },
+          { title: '颜色', key: 'color', width: '120px', type: FormTypes.normal },
+          { title: '品牌', key: 'brand', width: '120px', type: FormTypes.normal },
+          { title: '制造商', key: 'mfrs', width: '120px', type: FormTypes.normal },
+          { title: '扩展信息', key: 'materialOther', width: '120px', type: FormTypes.normal },
+          { title: '库存', key: 'stock', width: '120px', type: FormTypes.normal },
           {
             title: '单位',
             key: 'unit',
-            width: '6%',
-            type: FormTypes.slot,
-            options: [],
-            allowClear: false,
-            slotName: 'unit',
+            width: '120px',
+            type: FormTypes.normal,
+            // options: [],
+            // allowClear: false,
+            // slotName: 'unit',
           },
-          { title: '单位id', key: 'unitId', width: '4%', type: FormTypes.hidden },
-          { title: '单位列表', key: 'unitList', width: '5%', type: FormTypes.hidden },
-          { title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'sn', multi: true },
-          { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.input, readonly: true },
-          { title: '多属性', key: 'sku', width: '9%', type: FormTypes.normal },
+          { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
+          { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
+          { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'sn', multi: true },
+          // { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.input, readonly: true },
+          { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
           // { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
           // { title: '已出库', key: 'finishNumber', width: '4%', type: FormTypes.normal },
           {
             title: '出库数量',
             key: 'operNumber',
-            width: '5%',
+            width: '120px',
             type: FormTypes.inputNumber,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单价', key: 'unitPrice', width: '4%', type: FormTypes.inputNumber },
-          { title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
-          { title: '税率', key: 'taxRate', width: '4%', type: FormTypes.inputNumber, placeholder: '%' },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.inputNumber },
+          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, statistics: true },
+          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.inputNumber, placeholder: '%' },
           {
             title: '税额',
             key: 'taxMoney',
-            width: '5%',
+            width: '120px',
             type: FormTypes.inputNumber,
             readonly: true,
             statistics: true,
           },
-          { title: '价税合计', key: 'taxLastMoney', width: '7%', type: FormTypes.inputNumber, statistics: true },
+          { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber, statistics: true },
 
           // {
           //   title: '实际出库数量',
@@ -466,8 +466,8 @@ export default {
           // },
           // { title: '出库时间', key: 'warehousingTime', width: '9%', type: FormTypes.date },
 
-          { title: '备注', key: 'remark', width: '6%', type: FormTypes.input },
-          { title: '关联id', key: 'linkId', width: '5%', type: FormTypes.hidden },
+          { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
+          { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
         ],
       },
       confirmLoading: false,

+ 42 - 42
jshERP-web/src/views/bill/modules/SaleOutModal.vue

@@ -486,90 +486,90 @@ export default {
         dataSource: [],
         columns: [
           {
-            title: '批次号',
-            key: 'batchNumber',
-            width: '12%',
+            title: '商品条码',
+            key: 'barCode',
+            width: '200px',
             type: FormTypes.popupJsh,
-            kind: 'material',
+            kind: 'material2',
             multi: true,
             newBatch: true,
 
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '名称', key: 'name', width: '9%', type: FormTypes.normal },
+          { title: '名称', key: 'name', width: '120px', type: FormTypes.normal },
           // { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
 
-          { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal, disabled: true },
-          { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
-          { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotId', width: '9%', type: FormTypes.select, disabled: true },
-          { title: '仓库货架', key: 'position', width: '6%', type: FormTypes.normal },
-          { title: '包装规格', key: 'unitName', width: '7%', type: FormTypes.normal },
+          // { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal, disabled: true },
+          // { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
+          // { title: '商品条码', key: 'barCode', width: '9%', type: FormTypes.normal },
+          { title: '仓库名', key: 'depotId', width: '120px', type: FormTypes.select },
+          { title: '仓库货架', key: 'position', width: '120px', type: FormTypes.input },
+          { title: '包装规格', key: 'unitName', width: '120px', type: FormTypes.normal },
 
-          { title: '型号', key: 'model', width: '9%', type: FormTypes.normal },
-          { title: '颜色', key: 'color', width: '9%', type: FormTypes.normal },
-          { title: '品牌', key: 'brand', width: '9%', type: FormTypes.normal },
-          { title: '制造商', key: 'mfrs', width: '6%', type: FormTypes.normal },
-          { title: '扩展信息', key: 'materialOther', width: '5%', type: FormTypes.normal },
-          { title: '库存', key: 'inventory', width: '5%', type: FormTypes.normal },
+          { title: '型号', key: 'model', width: '120px', type: FormTypes.normal },
+          { title: '颜色', key: 'color', width: '120px', type: FormTypes.normal },
+          { title: '品牌', key: 'brand', width: '120px', type: FormTypes.normal },
+          { title: '制造商', key: 'mfrs', width: '120px', type: FormTypes.normal },
+          { title: '扩展信息', key: 'materialOther', width: '120px', type: FormTypes.normal },
+          { title: '库存', key: 'stock', width: '120px', type: FormTypes.normal },
           {
             title: '单位',
             key: 'unit',
-            width: '6%',
-            type: FormTypes.slot,
-            options: [],
-            allowClear: false,
-            slotName: 'unit',
+            width: '120px',
+            type: FormTypes.normal,
+            // options: [],
+            // allowClear: false,
+            // slotName: 'unit',
           },
-          { title: '单位id', key: 'unitId', width: '4%', type: FormTypes.hidden },
-          { title: '单位列表', key: 'unitList', width: '5%', type: FormTypes.hidden },
-          { title: '序列号', key: 'snList', width: '12%', type: FormTypes.popupJsh, kind: 'sn', multi: true },
-          { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.input, readonly: true },
-          { title: '多属性', key: 'sku', width: '9%', type: FormTypes.normal },
-          { title: '原数量', key: 'preNumber', width: '4%', type: FormTypes.normal },
-          { title: '已出库', key: 'finishNumber', width: '4%', type: FormTypes.normal },
+          { title: '单位id', key: 'unitId', width: '120px', type: FormTypes.hidden },
+          { title: '单位列表', key: 'unitList', width: '120px', type: FormTypes.hidden },
+          { title: '序列号', key: 'snList', width: '120px', type: FormTypes.popupJsh, kind: 'sn', multi: true },
+          // { title: '有效期', key: 'expirationDate', width: '7%', type: FormTypes.input, readonly: true },
+          { title: '多属性', key: 'sku', width: '120px', type: FormTypes.normal },
+          { title: '原数量', key: 'preNumber', width: '120px', type: FormTypes.normal },
+          { title: '已出库', key: 'finishNumber', width: '120px', type: FormTypes.normal },
           {
             title: '出库数量',
             key: 'operNumber',
-            width: '5%',
+            width: '120px',
             type: FormTypes.inputNumber,
             statistics: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单价', key: 'unitPrice', width: '4%', type: FormTypes.inputNumber },
-          { title: '金额', key: 'allPrice', width: '5%', type: FormTypes.inputNumber, statistics: true },
-          { title: '税率', key: 'taxRate', width: '4%', type: FormTypes.inputNumber, placeholder: '%' },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.inputNumber },
+          { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, statistics: true },
+          { title: '税率', key: 'taxRate', width: '120px', type: FormTypes.inputNumber, placeholder: '%' },
           {
             title: '税额',
             key: 'taxMoney',
-            width: '5%',
+            width: '120px',
             type: FormTypes.inputNumber,
             readonly: true,
             statistics: true,
           },
-          { title: '价税合计', key: 'taxLastMoney', width: '7%', type: FormTypes.inputNumber, statistics: true },
+          { title: '价税合计', key: 'taxLastMoney', width: '120px', type: FormTypes.inputNumber, statistics: true },
 
           {
             title: '实际出库数量',
             key: 'actualQuantityInStorage',
-            width: '9%',
+            width: '120px',
             type: FormTypes.inputNumber,
             validateRules: [{ required: true, message: '实际入库数量不能为空' }],
           },
-          { title: '出库差异', key: 'warehousingVariance', width: '9%', type: FormTypes.input },
-          { title: '出库差异原因', key: 'reasonOfDifference', width: '9%', type: FormTypes.input },
+          { title: '出库差异', key: 'warehousingVariance', width: '120px', type: FormTypes.input },
+          { title: '出库差异原因', key: 'reasonOfDifference', width: '120px', type: FormTypes.input },
           {
             title: '出库人',
             key: 'warehousingUser',
-            width: '9%',
+            width: '120px',
             type: FormTypes.slot,
             slotName: 'warehousingUser',
             validateRules: [{ required: true, message: '出库人不能为空' }],
           },
-          { title: '出库时间', key: 'warehousingTime', width: '9%', type: FormTypes.date },
+          { title: '出库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
 
-          { title: '备注', key: 'remark', width: '6%', type: FormTypes.input },
-          { title: '关联id', key: 'linkId', width: '5%', type: FormTypes.hidden },
+          { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
+          { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
         ],
       },
       confirmLoading: false,

+ 2 - 2
jshERP-web/src/views/material/MaterialList.vue

@@ -151,9 +151,9 @@
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="batchSetMaterialCurrentStock()" icon="stock"
             >修正库存</a-button
           >
-          <a-button v-if="btnEnableList.indexOf(1) > -1" @click="batchSetMaterialCurrentUnitPrice()" icon="fund"
+          <!-- <a-button v-if="btnEnableList.indexOf(1) > -1" @click="batchSetMaterialCurrentUnitPrice()" icon="fund"
             >修正成本</a-button
-          >
+          > -->
           <a-popover trigger="click" placement="right">
             <template slot="content">
               <a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">

+ 1 - 1
jshERP-web/src/views/material/modules/BatchSetStockModal.vue

@@ -63,7 +63,7 @@ export default {
   methods: {
     add(type) {
       this.batchType = type
-      if (type === 'initStock') {
+      if (type === 'currentStock') {
         this.title = '期初库存-批量设置'
       } else if (type === 'lowSafeStock') {
         this.title = '最低安全库存-批量设置'

+ 206 - 527
jshERP-web/src/views/material/modules/MaterialModal.vue

@@ -265,94 +265,7 @@
                   </a-tooltip>
                 </a-form-item>
               </a-col>
-              <!-- <a-col :md="6" :sm="24">
-                <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
-                  label="保质期"
-                  data-step="10"
-                  data-title="保质期"
-                  data-intro="保质期指的是商品的保质期(天),主要针对带生产日期的,此类商品一般有批号"
-                >
-                  <a-input-number style="width: 100%" placeholder="请输入保质期(天)" v-decorator.trim="['expiryNum']" />
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
-                  label="仓位货架"
-                  data-step="11"
-                  data-title="仓位货架"
-                  data-intro="仓位货架指的是仓库中的仓位和货架号,主要适用于仓库较大的场景,方便查找商品的准确位置"
-                >
-                  <a-input style="width: 100%" placeholder="请输入仓位货架" v-decorator.trim="['position']" />
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
-                  label="制造商"
-                  data-step="12"
-                  data-title="制造商"
-                  data-intro="请填写商品的制造商,一般适用于制造行业"
-                >
-                  <a-input placeholder="请输入制造商" v-decorator.trim="['mfrs']" />
-                </a-form-item>
-              </a-col> -->
             </a-row>
-            <!-- <a-row class="form-row" :gutter="24">
-              <a-col :md="6" :sm="24">
-                <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
-                  label="批号"
-                  data-step="14"
-                  data-title="批号"
-                  data-intro="此处是商品的批号开关,如果选择了有,则在采购入库单据需要录入该商品的批号和有效期,在销售出库单据需要选择该商品的批号进行出库"
-                >
-                  <a-tooltip title="如果选择为有,则在采购入库单需要录入该商品的批号和有效期">
-                    <a-select placeholder="有无批号" v-decorator="['enableBatchNumber']">
-                      <a-select-option value="1">有</a-select-option>
-                      <a-select-option value="0">无</a-select-option>
-                    </a-select>
-                  </a-tooltip>
-                </a-form-item>
-              </a-col>
-              <a-col :md="6" :sm="24" v-if="!model.id">
-                <a-form-item
-                  :labelCol="labelCol"
-                  :wrapperCol="wrapperCol"
-                  label="多属性"
-                  data-step="13"
-                  data-title="多属性"
-                  data-intro="多属性是针对的sku商品(比如服装、鞋帽行业),此处开关如果启用就可以在下方进行多sku的配置,配置具体的颜色、尺码之类的组合"
-                >
-                  <a-tooltip title="多属性针对服装、鞋帽等行业,需要先录入单位才能激活此处输入框">
-                    <a-tag class="tag-info" v-if="!manySkuStatus">需要先录入单位才能激活</a-tag>
-                    <a-select
-                      mode="multiple"
-                      v-decorator="['manySku']"
-                      showSearch
-                      optionFilterProp="children"
-                      placeholder="请选择多属性(可多选)"
-                      @change="onManySkuChange"
-                      v-show="manySkuStatus"
-                    >
-                      <a-select-option
-                        v-for="(item, index) in materialAttributeList"
-                        :key="index"
-                        :value="item.value"
-                        :disabled="item.disabled"
-                      >
-                        {{ item.name }}
-                      </a-select-option>
-                    </a-select>
-                  </a-tooltip>
-                </a-form-item>
-              </a-col>
-            </a-row> -->
             <a-row class="form-row" :gutter="24">
               <a-col :md="12" :sm="24" v-if="manySkuSelected >= 1">
                 <a-form-item
@@ -419,82 +332,18 @@
               </a-col>
             </a-row>
             <div style="margin-top: 8px" id="materialDetailModal">
-              <j-editable-table
-                ref="editableMeTable"
+              <a-table
+                size="middle"
+                rowKey="id"
                 :loading="meTable.loading"
                 :columns="meTable.columns"
                 :dataSource="meTable.dataSource"
-                :height="300"
-                :minWidth="1000"
-                :maxHeight="300"
-                :rowNumber="false"
-                :rowSelection="true"
-                :actionButton="true"
-                @valueChange="onValueChange"
-                @added="onAdded"
-                @deleted="onDeleted"
+                :pagination="meTable.pagination"
+                :scroll="meTable.scroll"
+                bordered
+                @change="handleMeTableChange"
               >
-                <template #supplierId="{ handleChange, value }">
-                  <a-select
-                    placeholder="请选择供应商"
-                    v-decorator="['supplierId']"
-                    :dropdownMatchSelectWidth="false"
-                    showSearch
-                    optionFilterProp="children"
-                    :value="value"
-                    @change="($event) => handleChange($event)"
-                  >
-                    <div slot="dropdownRender" slot-scope="menu">
-                      <v-nodes :vnodes="menu" />
-                      <a-divider style="margin: 4px 0" />
-                      <div
-                        style="padding: 4px 8px; cursor: pointer"
-                        @mousedown="(e) => e.preventDefault()"
-                        @click="addVendor"
-                      >
-                        <a-icon type="plus" /> 新增供应商
-                      </div>
-                    </div>
-                    <a-select-option v-for="(item, index) in supList" :key="index" :value="item.id">
-                      {{ item.supplier }}
-                    </a-select-option>
-                  </a-select>
-                </template>
-                <template #depotId="{ handleChange, value }">
-                  <a-select
-                    placeholder="请选择仓库名称"
-                    v-decorator="['depotId']"
-                    :dropdownMatchSelectWidth="false"
-                    showSearch
-                    optionFilterProp="children"
-                    :value="value"
-                    @change="($event) => handleChange($event)"
-                  >
-                    <div slot="dropdownRender" slot-scope="menu">
-                      <v-nodes :vnodes="menu" />
-                      <a-divider style="margin: 4px 0" />
-                      <div
-                        style="padding: 4px 8px; cursor: pointer"
-                        @mousedown="(e) => e.preventDefault()"
-                        @click="addDepot"
-                      >
-                        <a-icon type="plus" /> 新增仓库
-                      </div>
-                    </div>
-                    <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.value">
-                      {{ item.text }}
-                    </a-select-option>
-                  </a-select>
-                </template>
-                <template #buttonAfter>
-                  <a-button @click="batchSetPrice('purchase')">采购价-批量</a-button>
-                  <a-button style="margin-left: 8px" @click="batchSetPrice('commodity')">零售价-批量</a-button>
-                  <a-button style="margin-left: 8px" @click="batchSetPrice('wholesale')">销售价-批量</a-button>
-                  <a-button style="margin-left: 8px" @click="batchSetPrice('low')">最低售价-批量</a-button>
-                </template>
-              </j-editable-table>
-              <!-- 表单区域 -->
-              <batch-set-price-modal ref="priceModalForm" @ok="batchSetPriceModalFormOk"></batch-set-price-modal>
+              </a-table>
             </div>
             <a-row class="form-row" :gutter="24">
               <a-col :lg="24" :md="24" :sm="24">
@@ -504,7 +353,39 @@
               </a-col>
             </a-row>
           </a-tab-pane>
-          <a-tab-pane key="2" tab="扩展信息" forceRender>
+          <a-tab-pane key="2" tab="商品条码" forceRender>
+            <j-editable-table
+              ref="editableProBarCodeTable"
+              :loading="mbTable.loading"
+              :columns="mbTable.columns"
+              :dataSource="mbTable.dataSource"
+              :height="300"
+              :minWidth="1000"
+              :maxHeight="300"
+              :rowNumber="false"
+              :rowSelection="true"
+              :actionButton="true"
+              @added="onAdded"
+              @deleted="onDeleted"
+            >
+            <template #ratio="{ handleChange, value }">
+              <a-select
+                  v-if="unitChecked"
+                  placeholder="请选择"
+                  :dropdownMatchSelectWidth="false"
+                  showSearch
+                  :value="value"
+                  @change="($event) => handleChange($event)"
+                >
+                <a-select-option v-for="(item, index) in barCodeUnitList" :key="index" :value="item.ratio">
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+              <a-input v-else :value="value" disabled @change="($event) => handleChange($event)"></a-input>
+            </template>
+            </j-editable-table>
+          </a-tab-pane>
+          <a-tab-pane key="3" tab="扩展信息" forceRender>
             <a-row v-if="mpShort.otherField1.enabled" class="form-row" :gutter="24">
               <a-col :lg="6" :md="6" :sm="6">
                 <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="mpShort.otherField1.name">
@@ -527,7 +408,7 @@
               </a-col>
             </a-row>
           </a-tab-pane>
-          <a-tab-pane key="3" tab="库存数量" forceRender>
+          <a-tab-pane key="4" tab="库存数量" forceRender>
             <j-editable-table
               ref="editableDepotTable"
               :loading="depotTable.loading"
@@ -540,7 +421,7 @@
               :actionButton="false"
             >
               <template #buttonAfter>
-                <!-- <a-button style="margin: 0px 0px 8px 0px" @click="batchSetStock('initStock')">期初库存-批量</a-button> -->
+                <!-- <a-button style="margin: 0px 0px 8px 0px" @click="batchSetStock('currentStock')">期初库存-批量</a-button> -->
                 <a-button style="margin: 0px 0px 8px 0px" @click="batchSetStock('lowSafeStock')">最低安全库存-批量</a-button>
                 <a-button style="margin-left: 8px" @click="batchSetStock('highSafeStock')">最高安全库存-批量</a-button>
               </template>
@@ -548,7 +429,7 @@
             <!-- 表单区域 -->
             <batch-set-stock-modal ref="stockModalForm" @ok="batchSetStockModalFormOk"></batch-set-stock-modal>
           </a-tab-pane>
-          <a-tab-pane key="4" tab="图片信息" forceRender>
+          <a-tab-pane key="5" tab="图片信息" forceRender>
             <a-row class="form-row" :gutter="24" style="padding-top: 20px">
               <a-col :lg="18" :md="18" :sm="24">
                 <a-form-item
@@ -608,10 +489,11 @@ import JImageUpload from '@/components/jeecg/JImageUpload'
 import JDate from '@/components/jeecg/JDate'
 import Vue from 'vue'
 import { MaterialModalMixins } from '../mixins/MaterialModalMixins'
+import { mixinDevice } from '@/utils/mixin.js'
 
 export default {
   name: 'MaterialModal',
-  mixins: [MaterialModalMixins],
+  mixins: [MaterialModalMixins,mixinDevice],
   components: {
     BatchSetPriceModal,
     BatchSetStockModal,
@@ -697,16 +579,6 @@ export default {
             disabled: true,
             defaultValue: '',
             placeholder: '请输入${title}',
-            // validateRules: [{ required: true, message: '${title}不能为空' }],
-          },
-          {
-            title: '多属性',
-            key: 'sku',
-            width: '25%',
-            type: FormTypes.input,
-            defaultValue: '',
-            readonly: true,
-            placeholder: '请输入${title}',
           },
           {
             title: '采购价',
@@ -766,14 +638,6 @@ export default {
             placeholder: '请选择${title}',
           },
           {
-            title: '商品条码',
-            key: 'barCode',
-            width: '12%',
-            type: FormTypes.input,
-            defaultValue: '',
-            placeholder: '请输入${title}',
-          },
-          {
             title: '库存(最小单位)',
             key: 'inventory',
             width: '9%',
@@ -790,15 +654,40 @@ export default {
             defaultValue: '',
             placeholder: '请选择${title}',
           },
+         
+        ],
+        pagination: {
+          current: 1,
+          pageSize: 10,
+          pageSizeOptions: ['10', '20', '30', '50', '100'],
+          showTotal: (total, range) => {
+            return range[0] + '-' + range[1] + ' 共' + total + '条'
+          },
+          showQuickJumper: true,
+          showSizeChanger: true,
+          total: 0,
+        },
+        scroll: {}
+      },
+      mbTable:{
+        loading: false,
+        dataSource: [],
+        columns: [
           {
-            title: '仓位货架',
-            key: 'position',
-            width: '9%',
+            title: '商品条码',
+            key: 'barCode',
+            width: '15%',
             type: FormTypes.input,
-            defaultValue: '',
             placeholder: '请输入${title}',
           },
-        ],
+          {
+            title: '单位',
+            key: 'ratio',
+            width: '15%',
+            type: FormTypes.slot,
+            placeholder: '请输入${title}',
+          },
+        ]
       },
       depotTable: {
         loading: false,
@@ -835,6 +724,14 @@ export default {
             defaultValue: '',
             placeholder: '请输入${title}',
           },
+          {
+            title: '仓位货架',
+            key: 'position',
+            width: '9%',
+            type: FormTypes.input,
+            defaultValue: '',
+            placeholder: '请输入${title}',
+          },
         ],
       },
       confirmLoading: false,
@@ -867,7 +764,9 @@ export default {
         edit: '/material/update',
         materialsExtendList: '/materialsExtend/getDetailList',
         depotWithStock: '/depot/getAllListWithStock',
+        batchList: '/materialBatch/getDetailList',
       },
+      barCodeUnitList: [],
     }
   },
   created() {
@@ -883,6 +782,15 @@ export default {
     document.getElementById(this.prefixNo).removeEventListener('keydown', this.handleOkKey)
   },
   methods: {
+    initScroll() {
+      if (this.isMobile()) {
+        this.meTable.scroll.y = ''
+      } else {
+        let basicWidth = 150
+        this.meTable.scroll.x = document.documentElement.clientWidth - basicWidth - 64
+        this.meTable.scroll.y = '100%'
+      }
+    },
     // 快捷键
     handleOkKey(e) {
       const key = window.event.keyCode ? window.event.keyCode : window.event.which
@@ -894,11 +802,9 @@ export default {
     },
     // 获取所有的editableTable实例
     getAllTable() {
-      return Promise.all([getRefPromise(this, 'editableMeTable'), getRefPromise(this, 'editableDepotTable')])
+      return Promise.all([getRefPromise(this, 'editableProBarCodeTable'),getRefPromise(this, 'editableDepotTable')])
     },
     add() {
-      //隐藏多属性
-      this.meTable.columns[2].type = FormTypes.hidden
       // 默认新增一条数据
       this.getAllTable().then((editableTables) => {
         editableTables[0].add()
@@ -908,7 +814,7 @@ export default {
         handleIntroJs('material', 11)
       })
     },
-    edit(record) {
+    async edit(record) {
       this.form.resetFields()
       this.model = Object.assign({}, record)
       this.activeKey = '1'
@@ -968,31 +874,50 @@ export default {
           this.unitChecked = true
           this.unitStatus = true
           this.manyUnitStatus = false
+          console.log('多单位-----', record)
+          await this.getUnitListByID(record.unitId)
         }
         let params = { materialId: this.model.id }
-        //编辑商品的时候多属性字段可以修改
-        this.meTable.columns[2].readonly = false
-        this.requestMeTableData(this.url.materialsExtendList, params, this.meTable)
+        this.requestProMbTableData(this.url.materialsExtendList, params, this.mbTable)
+        this.requestMeTableData()
         this.requestDepotTableData(this.url.depotWithStock, { mId: this.model.id }, this.depotTable)
       } else {
         this.switchDisabled = false
-        this.meTable.columns[2].readonly = true
         this.requestDepotTableData(this.url.depotWithStock, { mId: 0 }, this.depotTable)
       }
+      this.$nextTick(() => {
+        this.initScroll()
+      })
+    },
+    requestMeTableData(){
+      const params = {
+        materialId: this.model.id,
+        currentPage: this.meTable.pagination.current,
+        pageSize: this.meTable.pagination.pageSize,
+      }
+      this.meTable.loading = true
+      getAction(this.url.batchList, params)
+        .then((res) => {
+          this.meTable.dataSource = res.data.rows
+          this.meTable.pagination.total = Number(res.data.total)
+        })
+        .finally(() => {
+          this.meTable.loading = false
+        })
     },
     /** 查询条码tab的数据 */
-    requestMeTableData(url, params, tab) {
+    requestProMbTableData(url, params, tab) {
       tab.loading = true
       getAction(url, params)
         .then((res) => {
-          for (let i = 0; i < res.data.rows.length; i++) {
-            if (res.data.rows[i].sku) {
-              this.meTable.columns[2].type = FormTypes.input
-            } else {
-              this.meTable.columns[2].type = FormTypes.hidden
+          const rows = (res.data.rows || []).map(item => {
+            if(this.unitChecked&&item.ratio){
+              const target = this.barCodeUnitList.find(unit => unit.ratio == item.ratio)
+              item.commodityUnit = target?target.name : ''
             }
-          }
-          tab.dataSource = res.data.rows || []
+            return item
+          })
+          tab.dataSource = rows
           console.log('tab.dataSource-----', tab.dataSource)
         })
         .finally(() => {
@@ -1033,10 +958,12 @@ export default {
     validateFields() {
       this.getAllTable()
         .then((tables) => {
+          console.log('tables========', tables)
           /** 一次性验证主表和所有的次表 */
           return validateFormAndTables(this.form, tables)
         })
         .then((allValues) => {
+          console.log('allValues========',allValues)
           let formData = this.classifyIntoFormData(allValues)
           formData.sortList = []
           if (formData.unit === undefined) {
@@ -1062,22 +989,56 @@ export default {
           }
         })
     },
+    async getUnitListByID(id){
+      await getAction('/unit/getUnitListByID', { id}).then(res => {
+        this.barCodeUnitList = res.data || []
+      })
+    },
     /** 整理成formData */
     classifyIntoFormData(allValues) {
+      
+      const that = this
       let materialMain = Object.assign(this.model, allValues.formValue)
+      console.log('materialMain------mbList------', allValues.tablesValue[0].values)
       return {
         ...materialMain, // 展开
-        meList: allValues.tablesValue[0].values,
+        meList:[],
         stock: allValues.tablesValue[1].values,
+        mbList: allValues.tablesValue[0].values.map(item => {
+          let commodityUnit = ''
+          // 多单位
+          if(that.unitChecked){
+            const target = that.barCodeUnitList.find(unit => unit.ratio == item.ratio)
+            commodityUnit = target?target.name : ''
+          }else{
+            commodityUnit = item.ratio
+          }
+          return {
+            barCode: item.barCode,
+            ratio: item.ratio,
+            commodityUnit: commodityUnit,
+            id: item.id.length > 19 ? null : item.id, // 后端接收不了大于19位id
+          }
+        }),
       }
     },
     /** 发起新增或修改的请求 */
     requestAddOrEdit(formData) {
       console.log('formData------------', formData)
-      if (formData.meList.length === 0) {
+      if (formData.mbList.length === 0) {
         this.$message.warning('抱歉,请输入条码信息!')
         return
       }
+      for (const item of formData.mbList){
+        if(item.barCode === ''){
+          this.$message.warning('抱歉,请输入条码信息!')
+          return
+        }
+        if(item.ratio === ''){
+          this.$message.warning('抱歉,条码信息中列表单位不能为空!')
+          return
+        }
+      }
       if (formData.enableSerialNumber === '1' && formData.enableBatchNumber === '1') {
         this.$message.warning('抱歉,序列号和批号只能选择一项!')
         return
@@ -1122,80 +1083,9 @@ export default {
                 }
               }
             }
-            // if (!formData.unit) {
-            //   // 此时为多单位
-            //   if (formData.meList.length < 2) {
-            //     this.$message.warning('多单位的商品条码行数至少要有两行,请再新增一行条码信息!')
-            //     return
-            //   }
-            //   if (formData.meList[0].commodityUnit != basicUnit) {
-            //     this.$message.warning(
-            //       '条码之后的单位填写有误,单位【' +
-            //         formData.meList[0].commodityUnit +
-            //         '】请修改为【' +
-            //         basicUnit +
-            //         '】!'
-            //     )
-            //     return
-            //   }
-            //   if (formData.meList[1].commodityUnit != otherUnit) {
-            //     this.$message.warning(
-            //       '条码之后的单位填写有误,单位【' +
-            //         formData.meList[1].commodityUnit +
-            //         '】请修改为【' +
-            //         otherUnit +
-            //         '】!'
-            //     )
-            //     return
-            //   }
-            // }
-            let skuCount = 0
-            for (let i = 0; i < formData.meList.length; i++) {
-              // let commodityUnit = formData.meList[i].commodityUnit
-              // if (formData.unit) {
-              //   if (commodityUnit != formData.unit) {
-              //     this.$message.warning(
-              //       '条码之后的单位填写有误,单位【' + commodityUnit + '】请修改为【' + formData.unit + '】!'
-              //     )
-              //     return
-              //   }
-              // } else if (formData.unitId) {
-              //   if (
-              //     commodityUnit != basicUnit &&
-              //     commodityUnit != otherUnit &&
-              //     commodityUnit != otherUnitTwo &&
-              //     commodityUnit != otherUnitThree
-              //   ) {
-              //     let warnInfo =
-              //       '条码之后的单位填写有误,单位【' +
-              //       commodityUnit +
-              //       '】请修改为【' +
-              //       basicUnit +
-              //       '】或【' +
-              //       otherUnit +
-              //       '】'
-              //     if (otherUnitTwo) {
-              //       warnInfo += '或【' + otherUnitTwo + '】'
-              //     }
-              //     if (otherUnitThree) {
-              //       warnInfo += '或【' + otherUnitThree + '】'
-              //     }
-              //     warnInfo += '!'
-              //     this.$message.warning(warnInfo)
-              //     return
-              //   }
-              // }
-              if (formData.sku) {
-                skuCount++
-              }
-            }
             //对最低和最高安全库存进行校验
             for (let i = 0; i < formData.stock.length; i++) {
               let depotStockObj = formData.stock[i]
-              if (skuCount && depotStockObj.initStock && depotStockObj.initStock - 0) {
-                this.$message.warning('抱歉,多属性商品不能录入期初库存,建议进行盘点录入!')
-                return
-              }
               if (formData.enableSerialNumber === '1' && depotStockObj.initStock && depotStockObj.initStock - 0) {
                 this.$message.warning('抱歉,序列号商品不能录入期初库存,建议进行入库单据录入!')
                 return
@@ -1337,12 +1227,6 @@ export default {
           })
         }
       }
-      //控制条码列表中的多属性列
-      if (value.length > 0) {
-        this.meTable.columns[2].type = FormTypes.input
-      } else {
-        this.meTable.columns[2].type = FormTypes.hidden
-      }
       this.barCodeSwitch = false
       this.meTable.dataSource = []
     },
@@ -1446,178 +1330,41 @@ export default {
     },
     onAdded(event) {
       const { row, target } = event
-      let formUnit = ''
-      // 勾选多单位
-      if(this.unitChecked){
-        const obj = this.unitList.find(item => item.id === this.form.getFieldValue('unitId'))
-        if(obj){
-          formUnit = obj.basicUnit
-        }
-      }else{
-        formUnit = this.form.getFieldValue('unit')||''
+      // 不勾选多单位
+      if(!this.unitChecked){
+        let formUnit = this.form.getFieldValue('unit')||''
+        target.setValues([{rowKey:row.id, values:{barCode: '', commodityUnit: formUnit}}])
       }
-      target.setValues([{ rowKey: row.id, values: { barCode: '', commodityUnit: formUnit, supplierId: undefined, depotId: undefined } }])
+      console.log('onAdded', event)
     },
     onDeleted(value) {
-      this.meDeleteIdList = value
-    },
-    //单元值改变一个字符就触发一次
-    onValueChange(event) {
-      console.log('onValueChange--------table-change', event)
-      // const { type, row, column, value, target } = event
-      // switch (column.key) {
-      //   case 'purchaseDecimal':
-      //   case 'commodityDecimal':
-      //   case 'wholesaleDecimal':
-      //   case 'lowDecimal':
-      //     this.changeDecimalByValue(row)
-      //     break
-      // }
-    },
-    //修改商品明细中的价格触发计算
-    changeDecimalByValue(row) {
-      let unitArr = this.unitList
-      let basicUnit = '',
-        otherUnit = '',
-        ratio = 1,
-        otherUnitTwo = '',
-        ratioTwo = 1,
-        otherUnitThree = '',
-        ratioThree = 1
-      for (let i = 0; i < unitArr.length; i++) {
-        if (unitArr[i].id === this.form.getFieldValue('unitId')) {
-          basicUnit = unitArr[i].basicUnit
-          otherUnit = unitArr[i].otherUnit
-          ratio = unitArr[i].ratio
-          if (unitArr[i].otherUnitTwo) {
-            otherUnitTwo = unitArr[i].otherUnitTwo
-            ratioTwo = unitArr[i].ratioTwo
-          }
-          if (unitArr[i].otherUnitThree) {
-            otherUnitThree = unitArr[i].otherUnitThree
-            ratioThree = unitArr[i].ratioThree
-          }
-        }
-      }
-      if (row.commodityUnit === basicUnit) {
-        this.$refs.editableMeTable.getValues((error, values) => {
-          let mArr = values,
-            basicPurchaseDecimal = '',
-            basicCommodityDecimal = '',
-            basicWholesaleDecimal = '',
-            basicLowDecimal = ''
-          for (let i = 0; i < mArr.length; i++) {
-            let mInfo = mArr[i]
-            if (i === 0) {
-              basicPurchaseDecimal = mInfo.purchaseDecimal
-              basicCommodityDecimal = mInfo.commodityDecimal
-              basicWholesaleDecimal = mInfo.wholesaleDecimal
-              basicLowDecimal = mInfo.lowDecimal
-            } else {
-              //副单位进行换算
-              if (basicPurchaseDecimal) {
-                mInfo.purchaseDecimal = (basicPurchaseDecimal * ratio).toFixed(2)
-              }
-              if (basicCommodityDecimal) {
-                mInfo.commodityDecimal = (basicCommodityDecimal * ratio).toFixed(2)
-              }
-              if (basicWholesaleDecimal) {
-                mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratio).toFixed(2)
-              }
-              if (basicLowDecimal) {
-                mInfo.lowDecimal = (basicLowDecimal * ratio).toFixed(2)
-              }
-              if (otherUnitTwo && i === 2) {
-                if (basicPurchaseDecimal) {
-                  mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioTwo).toFixed(2)
-                }
-                if (basicCommodityDecimal) {
-                  mInfo.commodityDecimal = (basicCommodityDecimal * ratioTwo).toFixed(2)
-                }
-                if (basicWholesaleDecimal) {
-                  mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioTwo).toFixed(2)
-                }
-                if (basicLowDecimal) {
-                  mInfo.lowDecimal = (basicLowDecimal * ratioTwo).toFixed(2)
-                }
-              }
-              if (otherUnitThree && i === 3) {
-                if (basicPurchaseDecimal) {
-                  mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioThree).toFixed(2)
-                }
-                if (basicCommodityDecimal) {
-                  mInfo.commodityDecimal = (basicCommodityDecimal * ratioThree).toFixed(2)
-                }
-                if (basicWholesaleDecimal) {
-                  mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioThree).toFixed(2)
-                }
-                if (basicLowDecimal) {
-                  mInfo.lowDecimal = (basicLowDecimal * ratioThree).toFixed(2)
-                }
-              }
-            }
-          }
-          this.meTable.dataSource = mArr
-        })
-      }
-    },
-    batchSetPrice(type) {
-      if (this.manySkuSelected > 0 || this.model.id) {
-        this.$refs.priceModalForm.add(type)
-        this.$refs.priceModalForm.disableSubmit = false
-      } else {
-        this.$message.warning('抱歉,只有开启多属性才能进行批量操作!')
-      }
+      // this.meDeleteIdList = value
+      console.log('onDeleted', value)
     },
+    // batchSetPrice(type) {
+    //   if (this.manySkuSelected > 0 || this.model.id) {
+    //     this.$refs.priceModalForm.add(type)
+    //     this.$refs.priceModalForm.disableSubmit = false
+    //   } else {
+    //     this.$message.warning('抱歉,只有开启多属性才能进行批量操作!')
+    //   }
+    // },
     batchSetStock(type) {
       this.$refs.stockModalForm.add(type)
       this.$refs.stockModalForm.disableSubmit = false
     },
-    batchSetPriceModalFormOk(price, batchType) {
-      let arr = this.meTable.dataSource
-      if (arr.length === 0) {
-        this.$message.warning('请先录入条码、单位等信息!')
-      } else {
-        let meTableData = []
-        for (let i = 0; i < arr.length; i++) {
-          let meInfo = {
-            barCode: arr[i].barCode,
-            commodityUnit: arr[i].commodityUnit,
-            sku: arr[i].sku,
-            purchaseDecimal: arr[i].purchaseDecimal,
-            commodityDecimal: arr[i].commodityDecimal,
-            wholesaleDecimal: arr[i].wholesaleDecimal,
-            lowDecimal: arr[i].lowDecimal,
-          }
-          if (batchType === 'purchase') {
-            meInfo.purchaseDecimal = price - 0
-          } else if (batchType === 'commodity') {
-            meInfo.commodityDecimal = price - 0
-          } else if (batchType === 'wholesale') {
-            meInfo.wholesaleDecimal = price - 0
-          } else if (batchType === 'low') {
-            meInfo.lowDecimal = price - 0
-          }
-          if (arr[i].id) {
-            meInfo.id = arr[i].id
-          }
-          meTableData.push(meInfo)
-        }
-        this.meTable.dataSource = meTableData
-      }
-    },
     batchSetStockModalFormOk(stock, batchType) {
       let arr = this.depotTable.dataSource
       let depotTableData = []
       for (let i = 0; i < arr.length; i++) {
         let depotInfo = {
           name: arr[i].name,
-          initStock: arr[i].initStock,
+          currentStock: arr[i].currentStock,
           lowSafeStock: arr[i].lowSafeStock,
           highSafeStock: arr[i].highSafeStock,
         }
-        if (batchType === 'initStock') {
-          depotInfo.initStock = stock - 0
+        if (batchType === 'currentStock') {
+          depotInfo.currentStock = stock - 0
         } else if (batchType === 'lowSafeStock') {
           depotInfo.lowSafeStock = stock - 0
         } else if (batchType === 'highSafeStock') {
@@ -1684,103 +1431,18 @@ export default {
       } else {
         this.manySkuStatus = false
       }
-      this.$refs.editableMeTable.getValues((error, values) => {
+      this.$refs.editableProBarCodeTable.getValues((error, values) => {
         let mArr = values
         for (let i = 0; i < mArr.length; i++) {
           let mInfo = mArr[i]
           mInfo.commodityUnit = e.target.value
         }
-        this.meTable.dataSource = mArr
+        this.mbTable.dataSource = mArr
       })
     },
     manyUnitOnChange(value) {
-      let unitArr = this.unitList
-      let basicUnit = '',
-        otherUnit = '',
-        ratio = 1,
-        otherUnitTwo = '',
-        ratioTwo = 1,
-        otherUnitThree = '',
-        ratioThree = 1
-      for (let i = 0; i < unitArr.length; i++) {
-        if (unitArr[i].id === value) {
-          basicUnit = unitArr[i].basicUnit
-          otherUnit = unitArr[i].otherUnit
-          ratio = unitArr[i].ratio
-          if (unitArr[i].otherUnitTwo) {
-            otherUnitTwo = unitArr[i].otherUnitTwo
-            ratioTwo = unitArr[i].ratioTwo
-          }
-          if (unitArr[i].otherUnitThree) {
-            otherUnitThree = unitArr[i].otherUnitThree
-            ratioThree = unitArr[i].ratioThree
-          }
-        }
-      }
-      this.$refs.editableMeTable.getValues((error, values) => {
-        let mArr = values,
-          basicPurchaseDecimal = '',
-          basicCommodityDecimal = '',
-          basicWholesaleDecimal = '',
-          basicLowDecimal = ''
-        for (let i = 0; i < mArr.length; i++) {
-          let mInfo = mArr[i]
-          mInfo.commodityUnit = basicUnit
-          // if (i === 0) {
-          //   // mInfo.commodityUnit = basicUnit
-          //   basicPurchaseDecimal = mInfo.purchaseDecimal
-          //   basicCommodityDecimal = mInfo.commodityDecimal
-          //   basicWholesaleDecimal = mInfo.wholesaleDecimal
-          //   basicLowDecimal = mInfo.lowDecimal
-          // } else {
-          //   //副单位进行换算
-          //   // mInfo.commodityUnit = otherUnit
-          //   if (basicPurchaseDecimal) {
-          //     mInfo.purchaseDecimal = (basicPurchaseDecimal * ratio).toFixed(2)
-          //   }
-          //   if (basicCommodityDecimal) {
-          //     mInfo.commodityDecimal = (basicCommodityDecimal * ratio).toFixed(2)
-          //   }
-          //   if (basicWholesaleDecimal) {
-          //     mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratio).toFixed(2)
-          //   }
-          //   if (basicLowDecimal) {
-          //     mInfo.lowDecimal = (basicLowDecimal * ratio).toFixed(2)
-          //   }
-          //   if (otherUnitTwo && i === 2) {
-          //     // mInfo.commodityUnit = otherUnitTwo
-          //     if (basicPurchaseDecimal) {
-          //       mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioTwo).toFixed(2)
-          //     }
-          //     if (basicCommodityDecimal) {
-          //       mInfo.commodityDecimal = (basicCommodityDecimal * ratioTwo).toFixed(2)
-          //     }
-          //     if (basicWholesaleDecimal) {
-          //       mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioTwo).toFixed(2)
-          //     }
-          //     if (basicLowDecimal) {
-          //       mInfo.lowDecimal = (basicLowDecimal * ratioTwo).toFixed(2)
-          //     }
-          //   }
-          //   if (otherUnitThree && i === 3) {
-          //     // mInfo.commodityUnit = otherUnitThree
-          //     if (basicPurchaseDecimal) {
-          //       mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioThree).toFixed(2)
-          //     }
-          //     if (basicCommodityDecimal) {
-          //       mInfo.commodityDecimal = (basicCommodityDecimal * ratioThree).toFixed(2)
-          //     }
-          //     if (basicWholesaleDecimal) {
-          //       mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioThree).toFixed(2)
-          //     }
-          //     if (basicLowDecimal) {
-          //       mInfo.lowDecimal = (basicLowDecimal * ratioThree).toFixed(2)
-          //     }
-          //   }
-          // }
-        }
-        this.meTable.dataSource = mArr
-      })
+      console.log('manyUnitOnChange', value)
+      this.getUnitListByID(value)
     },
     unitOnChange(e) {
       let isChecked = e.target.checked
@@ -1793,6 +1455,16 @@ export default {
         this.manyUnitStatus = true
         this.unitChecked = false
       }
+
+      this.barCodeUnitList = []
+      this.$refs.editableProBarCodeTable.getValues((error, values) => {
+        let mArr = values
+        for (let i = 0; i < mArr.length; i++) {
+          let mInfo = mArr[i]
+          mInfo.commodityUnit = undefined
+        }
+        this.mbTable.dataSource = mArr
+      })
     },
     addUnit() {
       this.$refs.unitModalForm.add()
@@ -1802,10 +1474,16 @@ export default {
     unitModalFormOk() {
       this.loadUnitListData()
     },
+    handleMeTableChange(pagination) {
+      if (pagination && pagination.current) {
+        this.meTable.pagination = pagination
+      }
+      this.requestMeTableData()
+    },
   },
 }
 </script>
-<style scoped>
+<style lang="less" scoped>
 .input-table {
   max-width: 100%;
   min-width: 1200px;
@@ -1819,4 +1497,5 @@ export default {
   color: #bbb;
   background-color: #ffffff;
 }
+/deep/ .ant-table td { white-space: nowrap; }
 </style>

+ 3 - 3
jshERP-web/src/views/stock/TaskList.vue

@@ -96,10 +96,10 @@ export default {
       // 权限按钮集合
       btnEnableList: [1, 1, 1],
       queryParam: {
-        taskStatus: '',
+        taskStatus: undefined,
         number: '',
-        depotId: '',
-        createBy: '',
+        depotId: undefined,
+        createBy: undefined,
       },
       // stockTable: {
       //   loading: false,

+ 1 - 1
jshERP-web/src/views/stock/components/FilterForm.vue

@@ -5,7 +5,7 @@
       <a-row :gutter="24">
         <a-col :md="4" :sm="24">
           <a-form-item label="盘点状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
-            <a-select placeholder="请选择供应商" showSearch :options="taskStatusList" v-model="queryParam.taskStatus">
+            <a-select placeholder="请选择盘点状态" showSearch :options="taskStatusList" v-model="queryParam.taskStatus">
             </a-select>
           </a-form-item>
         </a-col>

+ 53 - 20
jshERP-web/src/views/stock/components/checkModal.vue

@@ -105,26 +105,37 @@
       :isStock="true"
     ></j-select-material-modal>
     <a-modal @cancel="editVisible = false" @ok="onSubmitGoods" :visible="editVisible" title="编辑" width="50%">
-      <a-form :form="editForm">
-        <a-form-item label="盘点任务名称" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }">
+      <a-form-model :model="editForm" :rules="editFormRules" ref="editFormModel">
+        <a-form-model-item label="盘点任务名称" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }" prop="name">
           <a-input disabled v-model="editForm.name" placeholder="请输入"></a-input>
-        </a-form-item>
-        <a-form-item label="批次号" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }">
+        </a-form-model-item>
+        <a-form-model-item label="批次号" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }" prop="batchNumber">
           <a-input disabled v-model="editForm.batchNumber" placeholder="请输入"></a-input>
-        </a-form-item>
-        <a-form-item label="实际库存" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }">
-          <a-input v-model="editForm.newInventory" placeholder="请输入"></a-input>
-        </a-form-item>
-        <a-form-item label="实际仓位货架" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }">
+        </a-form-model-item>
+        <a-form-model-item label="实际库存" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }" prop="newInventory">
+          <a-input-number placeholder="请输入" v-model="editForm.newInventory" @change="handleChangeNewInventory" :min="0" style="width:100%" />
+        </a-form-model-item>
+        <a-form-model-item label="实际仓位货架" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }" prop="newPosition">
           <a-input v-model="editForm.newPosition" placeholder="请输入"></a-input>
-        </a-form-item>
-        <a-form-item label="差异数量" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }">
-          <a-input v-model="editForm.differenceCount" placeholder="请输入"></a-input>
-        </a-form-item>
-        <a-form-item label="差异原因" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }">
+        </a-form-model-item>
+        <a-form-model-item :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }" prop="differenceCount">
+          <template slot="label">
+            差异数量
+            <span>
+              <a-tooltip>
+                <template slot="title">
+                  盘盈是正数,盘亏是负数
+                </template>
+                <a-icon type="question-circle" />
+              </a-tooltip>
+            </span>
+          </template>
+          <span :class="editForm.differenceCount!==0?'red-num':''">{{editForm.differenceCount}}</span>
+        </a-form-model-item>
+        <a-form-model-item label="差异原因" :labelCol="{ span: 4 }" :wrapperCol="{ span: 14 }" prop="differenceReason">
           <a-input v-model="editForm.differenceReason" placeholder="请输入"></a-input>
-        </a-form-item>
-      </a-form>
+        </a-form-model-item>
+      </a-form-model>
     </a-modal>
   </div>
 </template>
@@ -221,6 +232,12 @@ export default {
       },
       editForm: {},
       editVisible: false,
+      editFormRules:{
+        newInventory:[
+          { required: true, message: '请输入实际库存' },
+          { pattern: /^[0-9]*$/, message: '只能输入数字' }
+        ]
+      }
     }
   },
   watch: {
@@ -261,11 +278,18 @@ export default {
     handleEdit(data) {
       this.editForm = { ...data }
       this.editVisible = true
+      this.handleChangeNewInventory(data.newInventory)
     },
     onSubmitGoods() {
-      postAction(this.url.edit, this.editForm).then((res) => {
-        this.$message.success('操作成功')
-        this.editVisible = false
+      this.$refs.editFormModel.validate((valid) => {
+        if (valid) {
+          postAction(this.url.edit, this.editForm).then((res) => {
+            this.$message.success('操作成功')
+            this.editVisible = false
+          })
+        } else {
+          return false
+        }
       })
     },
     loadCategoryTreeData() {
@@ -425,8 +449,17 @@ export default {
         this.findAllSelect()
       }
     },
+
+    handleChangeNewInventory(val){
+      const inventory = this.editForm.inventory? Number(this.editForm.inventory):0
+      this.editForm.differenceCount = val - inventory
+    }
   },
 }
 </script>
 
-<style></style>
+<style>
+.red-num{
+  color: #f5222d;
+}
+</style>

+ 87 - 0
jshERP-web/src/views/system/AppVersionList.vue

@@ -0,0 +1,87 @@
+<template>
+  <a-row :gutter="24">
+    <a-col :md="24">
+      <a-card :style="cardStyle" :bordered="false">
+        <!-- 操作按钮区域 -->
+        <div class="table-operator" style="margin-top: 5px">
+          <a-button @click="handleAdd" type="primary" icon="plus">发布新版本</a-button>
+        </div>
+        <!-- table区域-begin -->
+        <div>
+          <a-table
+            ref="table"
+            size="middle"
+            bordered
+            rowKey="id"
+            :columns="columns"
+            :dataSource="dataSource"
+            :pagination="ipagination"
+            :scroll="scroll"
+            :loading="loading"
+            @change="handleTableChange"
+          >
+          </a-table>
+        </div>
+        <!-- table区域-end -->
+        <!-- 表单区域 -->
+        <app-version-modal ref="modalForm" @ok="modalFormOk"></app-version-modal>
+      </a-card>
+    </a-col>
+  </a-row>
+</template>
+<script>
+import AppVersionModal from './modules/AppVersionModal'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { postAction } from '@/api/manage'
+
+export default {
+  name: 'AppVersionList',
+  mixins: [JeecgListMixin],
+  components: {
+    AppVersionModal,
+  },
+  data() {
+    return {
+      // 表头
+      columns: [
+        { title: '版本号', dataIndex: 'version', },
+        { title: '发布时间', dataIndex: 'createTime', },
+        { title: '文件路径', dataIndex: 'url',},
+      ],
+      url: {
+        list: '/apkVersion/list',
+      },
+    }
+  },
+  computed: {},
+  methods: {
+    loadData(arg) {
+      if (!this.url.list) {
+        this.$message.error('请设置url.list属性!')
+        return
+      }
+      //加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      this.loading = true
+      postAction(this.url.list, {}).then((res) => {
+        if (res.code === 200) {
+          this.dataSource = res.data.rows
+          this.ipagination.total = Number(res.data.total)
+          this.tableAddTotalRow(this.columns, this.dataSource)
+        } else if (res.code === 510) {
+          this.$message.warning(res.data)
+        } else {
+          this.$message.warning(res.data.message)
+        }
+        this.loading = false
+        this.onClearSelected()
+      })
+    },
+  },
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 293 - 0
jshERP-web/src/views/system/modules/AppVersionModal.vue

@@ -0,0 +1,293 @@
+<template>
+  <div ref="container">
+    <a-modal
+      title="发布新版本"
+      :visible="visible"
+      :confirmLoading="confirmLoading"
+      :getContainer="() => $refs.container"
+      :maskStyle="{ top: '93px', left: '154px' }"
+      :wrapClassName="wrapClassNameInfo()"
+      :mask="isDesktop()"
+      :maskClosable="false"
+      @cancel="handleCancel"
+      :footer="null"
+      width="500px"
+      style="top: 5%"
+    >
+      <a-spin :spinning="confirmLoading">
+        <a-form :form="form" class="form-content" id="appVersionModal">
+          <a-form-item label="版本号" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-input placeholder="请输入" allowClear v-decorator="['version', validatorRules.version]" />
+          </a-form-item>
+          
+          <a-form-item label="上传文件" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <div class="upload-container">
+              <a-upload
+                name="file"
+                :data="uploadOpts.data"
+                :showUploadList="true"
+                :multiple="false"
+                :headers="uploadOpts.headers"
+                :action="uploadOpts.action"
+                :method="uploadOpts.method"
+                :accept="uploadOpts.accept"
+                :fileList="fileList"
+                @change="handleChange"
+                :beforeUpload="beforeUpload"
+                @reject="handleReject"
+              >
+                <div class="upload-content">
+                  <div class="upload-icon">
+                    <a-icon type="folder-open" style="color: #4e73f8; font-size: 32px;" />
+                  </div>
+                  <a-button type="primary" class="upload-button">上传文件</a-button>
+                </div>
+              </a-upload>
+            </div>
+          </a-form-item>
+          
+          <div class="form-actions">
+            <a-button @click="handleCancel" class="cancel-button">取消</a-button>
+            <a-button type="primary" @click="handleOk" :loading="confirmLoading" class="confirm-button">确定发布新版本</a-button>
+          </div>
+        </a-form>
+      </a-spin>
+    </a-modal>
+  </div>
+</template>
+<script>
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import pick from 'lodash.pick'
+import { autoJumpNextInput } from '@/utils/util'
+import { mixinDevice } from '@/utils/mixin'
+import { postAction } from '@/api/manage'
+
+export default {
+  name: 'AppVersionModal',
+  mixins: [mixinDevice],
+  data() {
+    return {
+      visible: false,
+      confirmLoading: false,
+      labelCol: { span: 4 },
+      wrapperCol: { span: 20 },
+      fileList: [],
+      validatorRules: {
+        version: {
+          rules: [
+            { required: true, message: '请输入版本号!' },
+            { pattern: /^\d+\.\d+\.\d+$/, message: '版本号格式不正确!' }
+          ]
+        },
+        url: {
+          rules: [
+            { required: true, message: '请上传.apk文件!' }
+          ]
+        }
+      },
+      form: this.$form.createForm(this),
+      model: {},
+      uploadOpts:{
+        headers: {
+          'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)
+        },
+        method: 'POST',
+        action: window._CONFIG['domianURL'] + '/apkVersion/upload',
+        accept: '.apk',
+        data:{
+          biz: 'bill' 
+        }
+      },
+    }
+  },
+  methods: {
+    add() {
+      this.edit({})
+    },
+    edit(record) {
+      this.form.resetFields()
+      this.model = Object.assign({}, record)
+      this.fileList = []
+      this.visible = true
+      this.$nextTick(() => {
+        this.form.setFieldsValue(
+          pick(
+            this.model,
+            'url',
+            'version'
+          )
+        )
+        autoJumpNextInput('appVersionModal')
+      })
+    },
+    beforeUpload(file) {
+      // 检查文件类型
+      const isAPK = file.type === 'application/vnd.android.package-archive' || file.name.endsWith('.apk')
+      if (!isAPK) {
+        this.$message.error('只能上传APK文件!')
+        return false
+      }
+      
+      // 阻止自动上传
+      return true
+    },
+    handleChange(info) {
+      this.fileList = [info.file]
+      console.log('文件列表:', this.fileList)
+      if (info.file.status === 'uploading') {
+        console.log(info.file, info.fileList)
+        this.confirmLoading = true
+      }else if(info.file.status === 'removed'){
+        this.fileList = []
+        this.model.url = ''
+      }else if (info.file.status === 'done') {
+        this.confirmLoading = false
+        console.log('model=====', this.model)
+        if (info.file.response) {
+          if (info.file.response.code === 200) {
+            info.file.name = info.file.response.data
+            this.model.url = info.file.response.data
+          } else {
+            this.$message.warning(info.file.response.data, 8)
+          }
+        } else {
+          this.$message.error(`${info.file.name} ${info.file.response.data}.`)
+        }
+      } else if (info.file.status === 'error') {
+        this.confirmLoading = false
+        this.$message.error(`文件上传失败: ${info.file.msg} `)
+      }
+    },
+    handleReject(file) {
+      console.log('文件类型不正确:', file)
+      this.$message.error('文件类型不正确,请上传.apk文件!')
+    },
+    handleOk() {
+      this.form.validateFields((err, values) => {
+        if (err) return
+        console.log('values======',values)
+        if (this.fileList.length === 0) {
+          this.$message.error('请上传.apk类型文件!')
+          return
+        }
+        
+        const formData = {
+          version: values.version,
+          url: this.fileList[0].name // 实际应用中这里应该是上传后的URL
+        }
+        
+        this.confirmLoading = true
+        
+        postAction('/apkVersion/add', formData).then(res => {
+          if (res.code === 200) {
+            this.$message.success(res.msg)
+            this.visible = false
+            this.$emit('ok', formData)
+          } else {
+            this.$message.error(res.data||'操作失败')
+          }
+        }).catch(err => {
+          console.error(err)
+        }).finally(() => {
+          this.confirmLoading = false
+        })
+      })
+    },
+    handleCancel() {
+      this.visible = false
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+.form-content {
+  padding: 0 10px;
+}
+
+.upload-container {
+  border: 1px dashed #d9d9d9;
+  border-radius: 4px;
+  padding: 24px;
+  background-color: #fafafa;
+}
+
+.upload-content {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  padding: 10px 0;
+}
+
+.upload-icon {
+  margin-bottom: 16px;
+}
+
+.upload-button {
+  height: 32px;
+  font-size: 14px;
+  border-radius: 4px;
+  background-color: #4e73f8;
+  border-color: #4e73f8;
+}
+
+.reupload-button {
+  background-color: #4e73f8;
+  border-color: #4e73f8;
+}
+
+.form-actions {
+  display: flex;
+  justify-content: flex-end;
+  margin-top: 24px;
+  
+  .cancel-button {
+    margin-right: 12px;
+    min-width: 80px;
+    height: 32px;
+  }
+  
+  .confirm-button {
+    background-color: #4e73f8;
+    border-color: #4e73f8;
+    min-width: 120px;
+    height: 32px;
+  }
+}
+
+/deep/ .ant-upload.ant-upload-select {
+  display: block;
+}
+
+/deep/ .ant-upload-list-item {
+  margin-top: 8px;
+}
+
+/deep/ .ant-form-item-label {
+  text-align: left;
+  line-height: 32px;
+}
+
+/deep/ .ant-form-item {
+  margin-bottom: 24px;
+}
+
+/deep/ .ant-modal-close-x {
+  width: 46px;
+  height: 46px;
+  line-height: 46px;
+}
+
+/deep/ .ant-modal-body {
+  padding: 16px 24px 24px;
+}
+
+/deep/ .ant-form-item-control {
+  line-height: 32px;
+}
+
+/deep/ .ant-input {
+  height: 32px;
+}
+</style>

+ 2 - 1
jshERP-web/vue.config.js

@@ -54,7 +54,8 @@ module.exports = {
     open: true,
     proxy: {
       [process.env.VUE_APP_BASE_API]: {
-        target: 'http://localhost:8080', // 请求本地 需要jshERP-boot后台项目
+        // target: 'https://test-erp.xianglitech.com.cn/stage-api', // 请求本地 需要jshERP-boot后台项目
+        target: 'http://192.168.2.112:8080', // 请求本地 需要jshERP-boot后台项目
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: '',