cuilei
17 小时以前 6c6b811b2a5267764c8aa5c7b7ed2d6094f65061
Merge remote-tracking branch 'origin/master'
已修改17个文件
997 ■■■■■ 文件已修改
src/views/base/FactoryManager.vue 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/WarehouseList.vue 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/modules/factoryManager/FactoryModal.vue 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/modules/factoryManager/SelectUserModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/modules/group/SelectUserModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/modules/warehouse/WarehouseModel.vue 137 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingInboundList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingInventoryList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/CuttingToolList.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/ToolStocktakingList.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/ToolStocktakingForm.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/cms/modules/ToolStocktakingModal.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/LswMateriaView.vue 208 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/modules/LswMaterialForm.vue 325 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/modules/LswMaterialModal.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/DictList.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/SelectUserModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/base/FactoryManager.vue
@@ -5,8 +5,8 @@
        <!-- 按钮操作区域 -->
        <a-row style="margin-left: 14px">
          <a-button @click="handleAdd(1)" type="primary">添加车间</a-button>
          <a-button @click="handleAdd(2)" type="primary">添加下级</a-button>
          <a-button @click="handleAdd(1)" type="primary">添加工厂</a-button>
          <a-button v-if="this.factoryCategory == '1' || this.factoryCategory == '2'" @click="handleAdd(2)" type="primary">添加下级</a-button>
          <!-- <a-button type="primary" icon="download" @click="handleExportXls('车间信息')">导出</a-button>
          <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
                    :action="importExcelUrl" @change="handleImportExcel">
@@ -66,13 +66,16 @@
        <a-tab-pane tab="基本信息" key="1">
          <a-card :bordered="false" v-if="selectedKeys.length>0">
            <a-form-model ref="form" :model="model" :rules="validatorRules">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryCode" label="车间编号">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryCode" :label="codeLabel">
                <a-input placeholder="请输入产线/车间编号" v-model="model.factoryCode"/>
              </a-form-model-item>
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryName" label="车间名称">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryName" :label="nameLabel">
                <a-input placeholder="请输入产线/车间名称" v-model="model.factoryName"/>
              </a-form-model-item>
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级车间">
              <a-form-model-item v-if="this.factoryCategory == '3'" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionType" :label="nameLabel">
                <j-dict-select-tag type="list" placeholder="请选择产线类型" v-model="model.productionType" dictCode="production_type"/>
              </a-form-model-item>
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="父节点">
                <a-tree-select
                  style="width:100%"
                  :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
@@ -83,7 +86,7 @@
                </a-tree-select>
              </a-form-model-item>
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
                <a-input-number v-model="model.sorter"/>
                <a-input-number v-model="model.sorter" style="width:100%"/>
              </a-form-model-item>
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
                <a-textarea placeholder="请输入备注" v-model="model.remark"/>
@@ -163,7 +166,9 @@
          edges: []
        },
        validatorRules: {
          factoryName: [{ required: true, message: '请输入产线/车间名称!' }]
          factoryCode:[{ required: true, message: '请输入工厂/车间/产线编号!' }],
          factoryName:[{ required: true, message: '请输入工厂/车间/产线名称!' }],
          productionType:[{ required: false, message: '请选择产线类型!' }],
        },
        url: {
          delete: '/base/factory/delete',
@@ -180,7 +185,27 @@
    computed: {
      importExcelUrl: function() {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
      },
      // 新增计算属性:动态编号标签
    codeLabel() {
      if (!this.currSelected.factoryCategory) return "车间编号";
      const typeMap = {
        '1': '工厂编号',
        '2': '车间编号',
        '3': '产线编号'
      };
      return typeMap[this.currSelected.factoryCategory] || "车间编号";
    },
    // 新增计算属性:动态名称标签
    nameLabel() {
      if (!this.currSelected.factoryCategory) return "车间名称";
      const typeMap = {
        '1': '工厂名称',
        '2': '车间名称',
        '3': '产线名称'
      };
      return typeMap[this.currSelected.factoryCategory] || "车间名称";
    }
    },
    methods: {
      loadData() {
@@ -325,6 +350,7 @@
        this.setValuesToForm(record)
        if(record.factoryCategory == '3'){
          this.$refs.userFactory.show(record.id)
          this.validatorRules.productionType[0].required = true
        }else{
          this.$refs.userFactory.factoryId = ''
        }
@@ -396,7 +422,7 @@
            })
            return false
          }
          this.$refs.departModal.add(this.selectedKeys)
          this.$refs.departModal.add(this.selectedKeys,this.factoryCategory)
          this.$refs.departModal.title = '新增'
        } else {
          this.$refs.departModal.add(this.currSelected)
src/views/base/WarehouseList.vue
@@ -11,18 +11,18 @@
        <a-row :gutter="30">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="仓库编号">
            <a-form-item label="线边库编号">
              <j-input
                placeholder="请输入仓库编号检索"
                placeholder="请输入线边库编号检索"
                v-model="queryParam.warehouseCode"
              ></j-input>
            </a-form-item>
          </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="仓库名称">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="线边库名称">
              <j-input
                placeholder="请输入仓库名称检索"
                placeholder="请输入线边库名称检索"
                v-model="queryParam.warehouseName"
              ></j-input>
            </a-form-item>
@@ -44,7 +44,8 @@
        @click="handleAdd"
        type="primary"
        icon="plus"
      >新增</a-button>
      >新增
      </a-button>
    </div>
    <!-- table区域-begin -->
@@ -60,6 +61,7 @@
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
        <!--状态栏个性展示-->
        <span
@@ -89,8 +91,8 @@
        >
          <a
            href="javascript:;"
            @click="handleDetail(record)"
          >详情</a>
            @click="handleEdit(record)"
          >编辑</a>
          <a-divider type="vertical" />
          <a-dropdown>
@@ -98,19 +100,10 @@
              <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item v-if="record.warehouseStatus==1">
                <a @click="handleEdit(record)">编辑</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm
                  title="确定删除吗?"
                  @confirm="() => handleDelete(record.id)"
                >
                  <a>删除</a>
                </a-popconfirm>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item v-if="record.warehouseStatus == 0">
               <a-menu-item v-if="record.warehouseStatus == 0">
                <a-popconfirm
                  title="确定启用吗?"
                  @confirm="() => handleActive(record.id)"
@@ -126,6 +119,16 @@
                  <a>禁用</a>
                </a-popconfirm>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm
                  title="确定删除吗?"
                  @confirm="() => handleDelete(record.id)"
                >
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
@@ -146,7 +149,7 @@
//按需引入 组件
import WarehouseModel from './modules/warehouse/WarehouseModel'
import { deleteAction, requestPut, getAction } from '@/api/manage'
import { getAction, requestPut } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'
import JInput from '@/components/jeecg/JInput'
@@ -157,7 +160,7 @@
  components: {
    WarehouseModel,
    JEllipsis,
    JInput,
    JInput
  },
  data() {
    return {
@@ -165,12 +168,19 @@
      /* 分页参数 */
      ipagination: {
        current: 1,
        pageSize: 5,
        pageSizeOptions: ['5', '10', '20'],
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + "-" + range[1] + " 共" + total + "条"
          return range[0] + '-' + range[1] + ' 共' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      /* 排序参数 */
      isorter:{
        column: 'warehouseCode',
        order: 'asc',
      },
      // 表头
      columns: [
@@ -179,19 +189,19 @@
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: "center",
          customRender: function (t, r, index) {
            return parseInt(index) + 1;
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '线边库编号',
          align: "center",
          align: 'center',
          dataIndex: 'warehouseCode'
        },
        {
          title: '线边库名称',
          align: "center",
          align: 'center',
          dataIndex: 'warehouseName'
        },
        {
@@ -204,7 +214,7 @@
          title: '状态',
          align: 'center',
          scopedSlots: {
            customRender: 'status',
            customRender: 'status'
          },
          dataIndex: 'warehouseStatus'
        },
@@ -213,78 +223,83 @@
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/base/lineSideWarehouse/list',
        delete: '/base/lineSideWarehouse/delete',
        active: '/base/lineSideWarehouse/active',
      },
        active: '/base/lineSideWarehouse/active'
      }
    }
  },
  mounted() {
  },
  methods: {
    loadData(arg) {
      if (arg === 1) {
        this.ipagination.current = 1;
        this.ipagination.current = 1
      }
      var params = this.getQueryParams();//查询条件
      this.loading = true;
      var params = this.getQueryParams()//查询条件
      this.loading = true
      getAction(this.url.list, params).then((res) => {
        if (res.success) {
          this.dataSource = res.result.records;
          this.ipagination.total = res.result.total;
          this.dataSource = res.result.records
          this.ipagination.total = res.result.total
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false;
        this.loading = false
      })
    },
    //禁用状态样式
    tableRowClass(record, index) {
      if (record.warehouseStatus != "1") {
        return "frozenRowClass";
      if (record.warehouseStatus != '1') {
        return 'frozenRowClass'
      }
      return "";
      return ''
    },
    //启用禁用
    handleActive(id) {
      if (!this.url.active) {
        this.$message.error("请设置url.active!")
        this.$message.error('请设置url.active!')
        return
      }
      let that = this;
      let that = this
      requestPut(that.url.active, {}, { id: id }).then((res) => {
        if (res.success) {
          that.$message.success(res.message);
          that.loadData();
          that.$message.success(res.message)
          that.loadData()
        } else {
          that.$message.warning(res.message);
          that.$message.warning(res.message)
        }
      });
    },
  },
      })
    }
  }
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.frozenRowClass {
  color: #c9c9c9;
}
.success {
  color: green;
}
.error {
  color: red;
}
.fontweight {
  font-weight: bold;
}
.ant-card-body .table-operator {
  margin-bottom: 18px;
}
@@ -298,7 +313,7 @@
  margin: 0 5px;
}
/deep/.ant-btn-danger {
/deep/ .ant-btn-danger {
  background-color: #ffffff;
}
src/views/base/modules/factoryManager/FactoryModal.vue
@@ -16,28 +16,38 @@
        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="车间编码"
          :label="codeLabel"
          prop="factoryCode"
          :hidden="false"
          hasFeedback >
          <a-input id="factoryCode" placeholder="请输入产线/车间编号" v-model="model.factoryCode"/>
          <a-input id="factoryCode" placeholder="请输入工厂/产线/车间编号" v-model="model.factoryCode"/>
        </a-form-model-item>
        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="车间名称"
          :label="nameLabel"
          prop="factoryName"
          :hidden="false"
          hasFeedback >
          <a-input id="factoryName" placeholder="请输入产线/车间名称" v-model="model.factoryName"/>
          <a-input id="factoryName" placeholder="请输入工厂/产线/车间名称" v-model="model.factoryName"/>
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :hidden="seen" label="上级车间" hasFeedback>
        <a-form-model-item
          v-if="this.factoryCategory == '2'"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="产线类型"
          prop="productionType"
          :hidden="false"
          hasFeedback >
          <j-dict-select-tag type="list" placeholder="请选择产线类型" v-model="model.productionType" dictCode="production_type"/>
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :hidden="seen" label="父节点" hasFeedback>
          <a-tree-select
            style="width:100%"
            :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
            :treeData="factoryTree"
            v-model="model.parentId"
            placeholder="请选择上级车间"
            placeholder="请选择父节点"
            :disabled="condition">
          </a-tree-select>
        </a-form-model-item>
@@ -45,7 +55,7 @@
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序">
          <a-input-number v-model="model.sorter"/>
          <a-input-number v-model="model.sorter" style="width:100%"/>
        </a-form-model-item>
        <a-form-model-item
          :labelCol="labelCol"
@@ -63,12 +73,14 @@
  import { httpAction } from '@/api/manage'
  import { queryById } from '@/api/api'
  import pick from 'lodash.pick'
import JDictSelectTag from '../../../../components/dict/JDictSelectTag.vue'
  export default {
    name: "FactoryModal",
    components: {  },
    components: {JDictSelectTag  },
    data () {
      return {
        factoryTree:[],
        factoryCategory:'',
        title:"操作",
        seen:false,
        visible: false,
@@ -86,7 +98,9 @@
        confirmLoading: false,
        validatorRules:{
          factoryName:[{ required: true, message: '请输入产线/车间名称!' }],
          factoryCode:[{ required: true, message: '请输入工厂/车间/产线编号!' }],
          factoryName:[{ required: true, message: '请输入工厂/车间/产线名称!' }],
          productionType:[{ required: false, message: '请选择产线类型!' }],
        },
        url: {
          add: "/base/factory/add",
@@ -95,6 +109,28 @@
      }
    },
    created () {
    },
    computed: {
      // 新增计算属性:动态编号标签
    codeLabel() {
      if (!this.factoryCategory) return "工厂编号";
      const typeMap = {
        '1': '车间编号',
        '2': '产线编号',
        '3': '产线编号'
      };
      return typeMap[this.factoryCategory] || "工厂编号";
    },
    // 新增计算属性:动态名称标签
    nameLabel() {
      if (!this.factoryCategory) return "工厂名称";
      const typeMap = {
        '1': '车间名称',
        '2': '产线名称',
        '3': '产线名称'
      };
      return typeMap[this.factoryCategory] || "工厂名称";
    }
    },
    methods: {
      loadTreeData(){
@@ -110,7 +146,7 @@
        })
      },
      add (factory) {
      add (factory,factoryCategory) {
        if(factory){
          this.seen = false;
          this.dictDisabled = false;
@@ -118,13 +154,17 @@
          this.seen = true;
          this.dictDisabled = true;
        }
        this.edit(factory);
        this.edit(factory,factoryCategory);
      },
      edit (record) {
      edit (record,factoryCategory) {
        this.visible = true;
        this.model = Object.assign({}, this.defaultModel, record)
        if(factoryCategory == '2'){
          this.validatorRules.productionType[0].required = true
        }
        this.loadTreeData();
        this.model.parentId = record!=null?record.toString():null;
        this.factoryCategory = factoryCategory
      },
      close () {
        this.$emit('close');
src/views/base/modules/factoryManager/SelectUserModal.vue
@@ -34,7 +34,7 @@
      <!-- table区域-begin -->
      <div>
        <a-table
          size="small"
          size="middle"
          bordered
          rowKey="id"
          :columns="columns1"
src/views/base/modules/group/SelectUserModal.vue
@@ -34,7 +34,7 @@
      <!-- table区域-begin -->
      <div>
        <a-table
          size="small"
          size="middle"
          bordered
          rowKey="id"
          :columns="columns1"
src/views/base/modules/warehouse/WarehouseModel.vue
@@ -16,7 +16,7 @@
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              :labelCol="labelCol"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="线边库编号"
            >
@@ -33,7 +33,7 @@
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              :labelCol="labelCol"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="线边库名称"
            >
@@ -53,14 +53,9 @@
              :wrapperCol="wrapperCol"
              label="产线"
            >
            <j-select-factory
            :disabled="disableSubmit"
            v-model="model.factoryId"
            :multi="true"
            @back="backFactoryInfo"
            :backProduction="true"
            :treeProductOpera="true"
          ></j-select-factory>
              <j-dict-select-tag :disabled="disableSubmit" type="list" placeholder="请选择产线"
                                 v-model="model.factoryId"
                                 dictCode="base_factory,factory_name,id,del_flag='0' and factory_category='3'" />
            </a-form-item>
          </a-col>
        </a-row>
@@ -70,37 +65,29 @@
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import JDate from '@/components/jeecg/JDate'
import { httpAction } from '@/api/manage'
import pick from 'lodash.pick'
import moment from 'moment'
import { duplicateCheck } from '@/api/api'//重复校验
import JTreeDict from '@/components/jeecg/JTreeDict'//分类字典树形下拉组件
import JSelectFactory from '../../../../components/jeecgbiz/JSelectFactory'
import { duplicateCheck } from '@/api/api' //重复校验
export default {
  name: "WarehouseModal",
  components: {
    JDate,
    JTreeDict,
    JSelectFactory
  },
  name: 'WarehouseModal',
  components: {},
  data() {
    return {
      title: "操作",
      title: '操作',
      visible: false,
      disableSubmit: false,
      model: {},
      treeData: [],
      warehouseId: "", //保存线边库id
      warehouseId: '', //保存线边库id
      labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      confirmLoading: false,
      form: this.$form.createForm(this),
@@ -109,71 +96,71 @@
          rules: [
            { required: true, message: '请输入线边库编号' },
            { min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
            { validator: this.validateNum },
            { validator: this.validateNum }
          ]
        },
        warehouseName: {
          rules: [
            { required: true, message: '请输入线边库名称' },
            { min: 0, max: 64, message: '长度不超过 64 个字符', trigger: 'blur' },
            { validator: this.validateName },
            { validator: this.validateName }
          ]
        },
        }
      },
      url: {
        add: "/base/lineSideWarehouse/add",
        edit: "/base/lineSideWarehouse/edit",
        add: '/base/lineSideWarehouse/add',
        edit: '/base/lineSideWarehouse/edit'
      },
      nextFactoryOptions: [],
      nextFactoryOptions: []
    }
  },
  created() {
  },
  methods: {
    add() {
      this.edit({});
      this.edit({})
    },
    edit(record) {
      this.form.resetFields();
      this.model = Object.assign({}, record);
      this.warehouseId = record.id;
      this.visible = true;
      this.form.resetFields()
      this.model = Object.assign({}, record)
      this.warehouseId = record.id
      this.visible = true
      this.$nextTick(() => {
        this.form.setFieldsValue(
          pick(this.model, 'warehouseCode', 'warehouseName', 'factoryId')
        )
      });
      })
    },
    close() {
      this.$emit('close');
      this.visible = false;
      this.$emit('close')
      this.visible = false
    },
    handleOk() {
      const that = this;
      const that = this
      // 触发表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let httpurl = '';
          let method = '';
          that.confirmLoading = true
          let httpurl = ''
          let method = ''
          if (!this.model.id) {
            httpurl += this.url.add;
            method = 'post';
            httpurl += this.url.add
            method = 'post'
          } else {
            httpurl += this.url.edit;
            method = 'put';
            httpurl += this.url.edit
            method = 'put'
          }
          let formData = Object.assign(this.model, values);
          let formData = Object.assign(this.model, values)
          httpAction(httpurl, formData, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message);
              that.$emit('ok');
              that.$message.success(res.message)
              that.$emit('ok')
            } else {
              that.$message.warning(res.message);
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false;
            that.close();
            that.confirmLoading = false
            that.close()
          })
        }
      })
@@ -189,13 +176,13 @@
        fieldVal: value,
        dataId: this.warehouseId,
        //数据库中存在字段del_flag并使用该字段作为未删除策略,真删除:false 假删除:true
        delFlag: 'true',
      };
        delFlag: 'true'
      }
      duplicateCheck(params).then((res) => {
        if (res.success) {
          callback();
          callback()
        } else {
          callback("线边库编号已存在!");
          callback('线边库编号已存在!')
        }
      })
    },
@@ -207,24 +194,24 @@
        fieldVal: value,
        dataId: this.warehouseId,
        //数据库中存在字段del_flag并使用该字段作为未删除策略,真删除:false 假删除:true
        delFlag: 'true',
      };
        delFlag: 'true'
      }
      duplicateCheck(params).then((res) => {
        if (res.success) {
          callback();
          callback()
        } else {
          callback("线边库名称已存在!");
          callback('线边库名称已存在!')
        }
      })
    },
     backFactoryInfo(info) {
        this.model.factoryIds = this.model.factoryId
        this.nextFactoryOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
      },
      // 关闭弹窗时清除表单校验
    backFactoryInfo(info) {
      this.model.factoryIds = this.model.factoryId
      this.nextFactoryOptions = info.map((item, index, arr) => {
        let c = { label: item.text, value: item.value + '' }
        return c
      })
    },
    // 关闭弹窗时清除表单校验
    removeValidate() {
      if (this.$refs.form) this.$refs.form.clearValidate()
    }
src/views/cms/CuttingInboundList.vue
@@ -1,7 +1,7 @@
<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
   <div class="table-page-search-wrapper">
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
src/views/cms/CuttingInventoryList.vue
@@ -1,7 +1,7 @@
<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
   <div class="table-page-search-wrapper">
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
src/views/cms/CuttingToolList.vue
@@ -52,10 +52,11 @@
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <!-- <a-button type="primary" icon="download" @click="handleExportXls('刀具信息')">导出</a-button>
      <!-- 导入、导出功能 -->
      <a-button type="primary" icon="download" @click="handleExportXls('刀具信息')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload> -->
      </a-upload>
    </div>
    <!-- table区域-begin -->
src/views/cms/ToolStocktakingList.vue
@@ -4,6 +4,51 @@
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
                    <a-col :md="6" :sm="8">
            <a-form-item label="盘点单号">
              <a-input placeholder="请输入盘点单号" v-model="queryParam.orderCode" />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="盘点状态">
                <a-input placeholder="请输入盘点状态" v-model="queryParam.orderStatus" />
              </a-form-item>
          </a-col>
          <!-- <a-col :md="6" :sm="8">
              <a-form-item label="盘点人">
                <a-input placeholder="请选择盘点人" v-model="queryParam.operator" />
              </a-form-item>
          </a-col> -->
          <a-col :md="6" :sm="8">
              <a-form-item label="盘点人">
                <j-search-select-tag
                  placeholder="请选择盘点人"
                  v-model="queryParam.operator"
                  dict="sys_user,realname,id,del_flag=0"
                />
              </a-form-item>
          </a-col>
          <a-col
            :md="6"
            :sm="8"
          >
            <span
              style="float: left;overflow: hidden;"
              class="table-page-search-submitButtons"
            >
              <a-button
                type="primary"
                @click="searchQuery"
                icon="search"
              >查询</a-button>
              <a-button
                type="primary"
                @click="searchReset"
                icon="reload"
                style="margin-left: 8px"
              >重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
@@ -121,11 +166,11 @@
              return parseInt(index)+1;
            }
          },
          {
            title:'删除标记',
            align:"center",
            dataIndex: 'delFlag'
          },
          // {
          //   title:'删除标记',
          //   align:"center",
          //   dataIndex: 'delFlag'
          // },
          {
            title:'盘点单号',
            align:"center",
@@ -186,6 +231,11 @@
    methods: {
      initDictConfig(){
      },
      handleAdd(){
      this.$refs.modalForm.add()
      this.$refs.modalForm.title = '新增'
      this.$refs.modalForm.disableSubmit = false
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'int',value:'delFlag',text:'删除标记'})
src/views/cms/modules/ToolStocktakingForm.vue
@@ -3,11 +3,12 @@
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="24">
          <!-- 注释的是del_flag默认是0不需要输入 -->
          <!-- <a-col :span="24">
            <a-form-model-item label="删除标记" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag">
              <a-input-number v-model="model.delFlag" placeholder="请输入删除标记" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          </a-col> -->
          <a-col :span="24">
            <a-form-model-item label="盘点单号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCode">
              <a-input v-model="model.orderCode" placeholder="请输入盘点单号"  ></a-input>
@@ -20,7 +21,12 @@
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="盘点人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator">
              <a-input v-model="model.operator" placeholder="请输入盘点人"  ></a-input>
              <!-- <a-input v-model="model.operator" placeholder="请输入盘点人"  ></a-input> -->
              <j-search-select-tag
                placeholder="请选择盘点人"
                v-model="model.operator"
                dict="sys_user,realname,id,del_flag=0"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
@@ -43,10 +49,11 @@
  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  export default {
    name: 'ToolStocktakingForm',
    components: {
      JSearchSelectTag,
    },
    props: {
      //表单禁用
src/views/cms/modules/ToolStocktakingModal.vue
@@ -47,6 +47,7 @@
      },
      handleOk () {
        this.$refs.realForm.submitForm();
        this.loadData()
      },
      submitCallback(){
        this.$emit('ok');
src/views/lsw/LswMateriaView.vue
@@ -1,12 +1,10 @@
<template>
  <a-card
    :bordered="false"
    title="线边库物料信息"
  >
    :bordered="false">
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <a-form-item label="物料编码">
              <j-input placeholder="请输入物料编码" v-model="queryParam.materialNumber"></j-input>
            </a-form-item>
@@ -16,26 +14,33 @@
              <j-input placeholder="请输入物料名称" v-model="queryParam.materialName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="物料型号">
              <j-input placeholder="请输入物料型号" v-model="queryParam.materialModel"></j-input>
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <a-form-item label="状态">
              <j-dict-select-tag placeholder="请选择状态" dictCode="dict_item_status"
                                 v-model="queryParam.materialStatus"></j-dict-select-tag>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <a-form-item label="物料类型">
              <j-dict-select-tag placeholder="请输入物料类型"  dictCode="material_category" v-model="queryParam.materialCategory"></j-dict-select-tag>
              <j-dict-select-tag placeholder="请选择物料类型" dictCode="material_category"
                                 v-model="queryParam.materialCategory"></j-dict-select-tag>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
          <a-col :xl="2" :lg="7" :md="8" :sm="24">
            <a-form-item label="空类型">
              <a-switch v-model="queryParam.materialCategoryNull"></a-switch>
            </a-form-item>
          </a-col>
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
<!--    <a-button @click="handleAdd" type="primary" icon="plus">新增物料信息-测试</a-button>-->
    <!--    <a-button @click="handleAdd" type="primary" icon="plus">新增物料信息-测试</a-button>-->
    <a-spin :spinning="confirmLoading">
      <div>
        <!-- 主表单区域 -->
@@ -44,19 +49,77 @@
          size="middle"
          bordered
          rowKey="id"
          :rowClassName="tableRowClass"
          :columns="columns"
          :dataSource="dataSource"
          :pagination="ipagination"
          :loading="loading"
          :rowSelection="{ selectedRowKeys: selectedRowKeys,
  onChange: onSelectChange,
  type: 'radio'}"
          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio'}"
          @change="handleTableChange">
          <!--状态栏个性展示-->
          <span
            slot="status"
            slot-scope="text,record"
          >
          <a-badge
            v-if="record.materialStatus==='1'"
            status="success"
          />
          <span
            v-if="record.materialStatus==='1'"
            class="success"
          >启用</span>
          <a-badge
            v-if="record.materialStatus==='0'"
            status="error"
          />
          <span
            v-if="record.materialStatus==='0'"
            class="error"
          >禁用</span>
        </span>
          <span
            slot="action"
            slot-scope="text, record"
          >
          <a
            href="javascript:;"
            @click="handleEdit(record)"
          >编辑</a>
          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多
              <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item v-if="record.materialStatus === '1'">
                <a-popconfirm
                  title="确定禁用吗?"
                  @confirm="() => handleActive(record)"
                >
                  <a>禁用</a>
                </a-popconfirm>
              </a-menu-item>
              <a-menu-item v-else>
                <a-popconfirm
                  title="确定启用吗?"
                  @confirm="() => handleActive(record)"
                >
                  <a>启用</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
        </a-table>
      </div>
      <!-- 子表单区域 -->
      <a-tabs v-model="activeKey" @change="handleChangeTabs">
        <a-tab-pane tab="物料库存信息" :key="refKeys[0]" :forceRender="true">
        <a-tab-pane tab="库存明细" :key="refKeys[0]" :forceRender="true">
          <div style="display: flex; align-items: center; margin-bottom: 10px;">
            <a-tag color="green" style="font-weight: bold;">
              库存总量:{{ totalInventoryQuantity }}
@@ -85,8 +148,6 @@
import { getAction } from '@/api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@/components/jeecg/JVxeTable'
import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
import { validateDuplicateValue } from '@/utils/util'
import JFormContainer from '@/components/jeecg/JFormContainer'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import LswMaterialModal from '@views/lsw/modules/LswMaterialModal.vue'
@@ -140,9 +201,12 @@
          dataIndex: 'materialName'
        },
        {
          title: '物料型号',
          title: '物料状态',
          align: 'center',
          dataIndex: 'materialModel'
          scopedSlots: {
            customRender: 'status'
          },
          dataIndex: 'materialStatus'
        },
        {
          title: '物料类型',
@@ -150,9 +214,16 @@
          dataIndex: 'materialCategory_dictText'
        },
        {
          title: '单位',
          title: '基本计量单位',
          align: 'center',
          dataIndex: 'materialUnit'
        },
        {
          width: 150,
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' }
        }
      ],
      // 物料库存信息
@@ -204,10 +275,13 @@
      },
      url: {
        //searchlikeQuery
        list: '/lswmaterial/lswMaterial/list',
        queryById: '/lswmaterial/lswMaterial/queryById',
        list: '/lsw/lswMaterial/list',
        edit: '/lsw/lswMaterial/edit',
        active: '/lsw/lswMaterial/active',
        inactive: '/lsw/lswMaterial/inactive',
        queryById: '/lsw/lswMaterial/queryById',
        lswMaterialInventory: {
          list: '/lswmaterial/lswMaterial/queryLswMaterialInventoryByMainId'
          list: '/lsw/lswMaterial/queryLswMaterialInventoryByMainId'
        }
      }
    }
@@ -226,29 +300,30 @@
    },
    totalInventoryQuantity() {
      if (!this.lswMaterialInventoryTable.dataSource || this.lswMaterialInventoryTable.dataSource.length === 0) {
        return '0';
        return '0'
      }
      return this.lswMaterialInventoryTable.dataSource.reduce((sum, item) => {
        const quantity = Number(item.quantity) || 0;
        return sum + quantity;
      }, 0);
        const quantity = Number(item.quantity) || 0
        return sum + quantity
      }, 0)
    },
  },
  created() {
  },
  methods: {
    handleCustomAdd(){
      console.log('点击新增了')
    },
    handleTableChange() {
      console.log('test---->', this.selectedRowKeys[0])
    //禁用状态样式
    tableRowClass(record, index) {
      if (record.warehouseStatus != '1') {
        return 'frozenRowClass'
      }
      return ''
    },
    async onSelectChange(selectedRowKeys) {
      this.lswMaterialInventoryTable.loading = true
      // 单选模式下,selectedRowKeys 是数组,但长度最多为1
      console.log('点击了---->')
      this.selectedRowKeys = selectedRowKeys
      this.lswMaterialInventoryTable.dataSource=[]
      this.lswMaterialInventoryTable.dataSource = []
      // 获取选中行的完整数据
      if (selectedRowKeys.length > 0) {
        const selectedId = selectedRowKeys[0] // 选中行的id
@@ -256,11 +331,74 @@
        this.lswMaterialInventoryTable.dataSource = lswMaterialInventoryResult.result
        this.lswMaterialInventoryTable.loading = false
      }
    },
    handleActive(record) {
      let url = this.url.active;
      if (record.materialStatus === '1') {
        url = this.url.inactive
      }
      let that = this
      getAction(url, { id: record.id }).then((res) => {
        if (res.success) {
          that.$message.success(res.message)
          that.loadData()
        } else {
          that.$message.warning(res.message)
        }
      })
    }
  }
}
</script>
<style scoped>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.frozenRowClass {
  color: #c9c9c9;
}
.success {
  color: green;
}
.error {
  color: red;
}
.fontweight {
  font-weight: bold;
}
.ant-card-body .table-operator {
  margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td {
  padding-top: 15px;
  padding-bottom: 15px;
}
.anty-row-operator button {
  margin: 0 5px;
}
/deep/ .ant-btn-danger {
  background-color: #ffffff;
}
.ant-modal-cust-warp {
  height: 100%;
}
.ant-modal-cust-warp .ant-modal-body {
  height: calc(100% - 110px) !important;
  overflow-y: auto;
}
.ant-modal-cust-warp .ant-modal-content {
  height: 90% !important;
  overflow-y: hidden;
}
</style>
src/views/lsw/modules/LswMaterialForm.vue
@@ -1,260 +1,129 @@
<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
    <j-form-container :disabled="true">
      <!-- 主表单区域 -->
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
      <a-form-model ref="form1" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="12" >
          <a-col :span="24">
            <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber">
              <a-input v-model="model.materialNumber" placeholder="请输入物料编码" ></a-input>
              <a-input v-model="model.materialNumber"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12" >
          <a-col :span="24">
            <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName">
              <a-input v-model="model.materialName" placeholder="请输入物料名称" ></a-input>
              <a-input v-model="model.materialName"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12" >
            <a-form-model-item label="物料型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialModel">
              <a-input v-model="model.materialModel" placeholder="请输入物料型号" ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12" >
            <a-form-model-item label="物料类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialCategory">
              <j-dict-select-tag type="list" v-model="model.materialCategory" dictCode="material_category" placeholder="请选择物料类型" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12" >
            <a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialUnit">
              <a-input v-model="model.materialUnit" placeholder="请输入单位" ></a-input>
          <a-col :span="24">
            <a-form-model-item label="基本计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialUnit">
              <a-input v-model="model.materialUnit"></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
      <!-- 子表单区域 -->
    <a-tabs v-model="activeKey" @change="handleChangeTabs">
      <a-tab-pane tab="物料库存信息" :key="refKeys[0]" :forceRender="true">
        <j-vxe-table
          keep-source
          :ref="refKeys[0]"
          :loading="lswMaterialInventoryTable.loading"
          :columns="lswMaterialInventoryTable.columns"
          :dataSource="lswMaterialInventoryTable.dataSource"
          :maxHeight="300"
          :disabled="formDisabled"
          :rowNumber="true"
          :rowSelection="true"
          :toolbar="true"
          />
      </a-tab-pane>
    </a-tabs>
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="24">
            <a-form-model-item label="物料类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialCategory">
              <j-dict-select-tag type="list" v-model="model.materialCategory" dictCode="material_category" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
  </a-spin>
</template>
<script>
  import { getAction } from '@/api/manage'
  import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  import { JVXETypes } from '@/components/jeecg/JVxeTable'
  import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
  import { validateDuplicateValue } from '@/utils/util'
  import JFormContainer from '@/components/jeecg/JFormContainer'
import { httpAction } from '@/api/manage'
  export default {
    name: 'LswMaterialForm',
    mixins: [JVxeTableModelMixin],
    components: {
      JFormContainer,
    },
    data() {
      return {
        warehouseColOptions: [],
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        model:{
         },
        // 新增时子表默认添加几行空数据
        addDefaultRowNum: 1,
        refKeys: ['lswMaterialInventory', ],
        tableKeys:['lswMaterialInventory', ],
        activeKey: 'lswMaterialInventory',
        // 物料库存信息
        lswMaterialInventoryTable: {
          loading: false,
          dataSource: [],
          columns: [
            {
              title: '批次号',
              key: 'batchNumber',
               type: JVXETypes.input,
              width:"200px",
              placeholder: '请输入${title}',
              defaultValue:'',
            },
            {
              title: '库存类型',
              key: 'inventoryCategory',
               type: JVXETypes.select,
              width:"200px",
              placeholder: '请选择${title}',
              defaultValue:'',
              options:[],
              dictCode: 'inventoryCategory'
            },
            {
              title: '数量',
              key: 'quantity',
               type: JVXETypes.input,
              width:"200px",
              placeholder: '请输入${title}',
              defaultValue:'',
            },
            {
              title: '库存地',
              key: 'warehouseId',
              type: JVXETypes.select,
              width: "200px",
              options: this.warehouseColOptions,
            },
            {
              title: '库存状态',
              key: 'inventoryStatus',
               type: JVXETypes.select,
              width:"200px",
              placeholder: '请输入${title}',
              defaultValue:'',
              options:[],
              dictCode: 'inventory_status'
            },
          ]
        },
        validatorRules: {
          materialNumber: [
            { required: true, message: '物料编码是必选项', trigger: 'change' }
          ],
          materialName: [
            { required: true, message: '物料名称是必选项', trigger: 'change' }
          ],
          materialModel: [
            { required: true, message: '物料型号是必选项', trigger: 'change' }
          ],
          materialCategory: [
            { required: true, message: '物料类型是必选项', trigger: 'change' }
          ],
          materialUnit: [
            { required: true, message: '单位是必选项', trigger: 'change' }
          ],
        },
        url: {
          add: "/lswmaterial/lswMaterial/add",
          edit: "/lswmaterial/lswMaterial/edit",
          queryById: "/lswmaterial/lswMaterial/queryById",
          warehouseList:"/base/lineSideWarehouse/list",
          lswMaterialInventory: {
            list: '/lswmaterial/lswMaterial/queryLswMaterialInventoryByMainId'
          },
        }
      }
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
export default {
  name: 'LswMaterialForm',
  components: {
  },
  data() {
    return {
      confirmLoading: false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      model: {},
      validatorRules: {
        materialCategory: [
          { required: true, message: '物料类型必选', trigger: 'change' }
        ]
      },
      url: {
        add: '',
        edit: '/lsw/lswMaterial/edit'
      }
    }
  },
  props: {
    //表单禁用
    disabled: {
      type: Boolean,
      default: false,
      required: false
    }
  },
  computed: {
    formDisabled() {
      return this.disabled
    }
  },
  created() {
    //备份model原始值
    this.modelDefault = JSON.parse(JSON.stringify(this.model))
    console.log('formDisabled' + this.formDisabled)
  },
  methods: {
    add() {
      this.edit(this.modelDefault)
    },
    created () {
      this.loadWarehouseOptions();
    edit(record) {
      this.model = Object.assign({}, record)
      this.visible = true
    },
    methods: {
      async loadWarehouseOptions() {
        try {
          const res = await getAction(this.url.warehouseList);
          console.log("仓库API响应:", res);
          let data = [];
          data = res.result.records;
          console.log("处理后的仓库数据:", data);
          const options = data.map(item => ({
            text: item.warehouseName || `仓库(${item.id})`, // 显示文本
            value: item.id // 实际值
          }));
          console.log("格式化后的选项:", options);
          const warehouseCol = this.lswMaterialInventoryTable.columns.find(
            col => col.key === 'warehouseId'
          );
          if (warehouseCol) {
            this.$set(warehouseCol, 'options', options);
            this.warehouseColOptions = warehouseCol.options
            console.log("更新后的列选项:", warehouseCol.options);
    submitForm() {
      const that = this
      // 触发表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          that.confirmLoading = true
          let httpurl = ''
          let method = ''
          if (!this.model.id) {
            httpurl += this.url.add
            method = 'post'
          } else {
            httpurl += this.url.edit
            method = 'put'
          }
          this.$nextTick(() => {
            this.$forceUpdate();
            console.log("已强制更新视图");
          });
        } catch (error) {
          console.error('加载仓库列表失败:', error);
          httpAction(httpurl, this.model, method).then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('ok')
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false
          })
        }
      },
      addBefore(){
        this.lswMaterialInventoryTable.dataSource=[]
      },
      getAllTable() {
        let values = this.tableKeys.map(key => getRefPromise(this, key))
        return Promise.all(values)
      },
      /** 调用完edit()方法之后会自动调用此方法 */
      editAfter() {
        this.$nextTick(() => {
        })
        // 加载子表数据
        if (this.model.id) {
          let params = { id: this.model.id }
          this.requestSubTableData(this.url.lswMaterialInventory.list, params, this.lswMaterialInventoryTable)
        }
      },
      //校验所有一对一子表表单
        validateSubForm(allValues){
            return new Promise((resolve,reject)=>{
              Promise.all([
              ]).then(() => {
                resolve(allValues)
              }).catch(e => {
                if (e.error === VALIDATE_FAILED) {
                  // 如果有未通过表单验证的子表,就自动跳转到它所在的tab
                  this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
                } else {
                  console.error(e)
                }
              })
            })
        },
      /** 整理成formData */
      classifyIntoFormData(allValues) {
        let main = Object.assign(this.model, allValues.formValue)
        return {
          ...main, // 展开
          lswMaterialInventoryList: allValues.tablesValue[0].tableData,
        }
      },
      validateError(msg){
        this.$message.error(msg)
      },
      })
    }
  }
}
</script>
<style scoped>
src/views/lsw/modules/LswMaterialModal.vue
@@ -1,7 +1,7 @@
<template>
  <j-modal
    :title="title"
    :width="1200"
    :width="800"
    :visible="visible"
    :maskClosable="false"
    switchFullscreen
@@ -13,7 +13,6 @@
</template>
<script>
  import LswMaterialForm from './LswMaterialForm'
  export default {
@@ -47,7 +46,7 @@
        this.visible = false;
      },
      handleOk () {
        this.$refs.realForm.handleOk();
        this.$refs.realForm.submitForm();
      },
      submitCallback(){
        this.$emit('ok');
src/views/system/DictList.vue
@@ -7,12 +7,12 @@
        <a-row :gutter="12">
          <a-col :md="7" :sm="8">
            <a-form-item label="字典名称" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
              <a-input placeholder="请输入字典名称" v-model="queryParam.dictName"></a-input>
              <j-input placeholder="请输入字典名称" v-model="queryParam.dictName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :md="7" :sm="8">
            <a-form-item label="字典编号" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
              <a-input placeholder="请输入字典编号" v-model="queryParam.dictCode"></a-input>
              <j-input placeholder="请输入字典编号" v-model="queryParam.dictCode"></j-input>
            </a-form-item>
          </a-col>
          <a-col :md="7" :sm="8">
src/views/system/modules/SelectUserModal.vue
@@ -33,7 +33,7 @@
      <!-- table区域-begin -->
      <div>
        <a-table
          size="small"
          size="middle"
          bordered
          rowKey="id"
          :columns="columns1"