houjie
2023-08-29 cb72d2778e1e6e783e0a96b4d154c289357b26aa
备件模块/添加编码规则
已修改9个文件
304 ■■■■■ 文件已修改
src/views/spare/modules/sparePart/SparePart2List.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePartCancellingStocks/SparePartCancellingStocksModal.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePartReceive/SparePartReceiveForm.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePartReceive/SpareSelectList.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePartScrap/SpareSelectList.vue 105 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue 118 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/spare/modules/sparePart/SparePart2List.vue
@@ -76,7 +76,7 @@
          <a-icon type="down" />
        </a-button>
        <a-menu slot="overlay" >
          <a-menu-item @click="batchDel" v-has="'sparePartList:delete'">
          <a-menu-item @click="batchDel">
            <a-icon type="delete" />删除
          </a-menu-item>
        </a-menu>
@@ -113,7 +113,7 @@
            更多
            <a-icon type="down" />
          </a>
          <a-menu slot="overlay">
          <a-menu slot="overlay" v-has="'sparePartList:delete'">
            <!-- <a-menu-item>
              <a @click="handleEdit(record)">编辑</a>
            </a-menu-item> -->
src/views/spare/modules/sparePartCancellingStocks/SparePartCancellingStocksModal.vue
@@ -19,7 +19,7 @@
              :wrapperCol='wrapperCol'
            >
              <a-input
                :disabled="disableSubmit"
                :disabled="true"
                placeholder='请输单据号'
                v-decorator="['num', validatorRules.num]"
              />
@@ -319,6 +319,7 @@
      url: {
        add: '/spare/sparePartCancellingStocks/add',
        getSysDeparts: "/eam/equipment/getSysDeparts",
        getNum: '/eam/sysIdentity/getNumNew',
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
        edit: '/spare/sparePartCancellingStocks/edit'
      },
@@ -418,6 +419,13 @@
        this.codeDisable = true
      } else {
        this.codeDisable = false
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
src/views/spare/modules/sparePartOutbound/SparePartOutboundModal.vue
@@ -20,7 +20,7 @@
            >
              <a-input
                placeholder="请输申请单编码"
                :disabled="disableSubmit"
                :disabled="true"
                v-decorator="['num', validatorRules.num]"
              />
            </a-form-item>
@@ -313,6 +313,7 @@
        add: "/spare/sparePartOutbound/add",
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
        getSysDeparts: "/eam/equipment/getSysDeparts",
        getNum: '/eam/sysIdentity/getNumNew',
        edit: "/spare/sparePartOutbound/edit",
      },
@@ -401,6 +402,13 @@
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
    initOptions() {
src/views/spare/modules/sparePartPurchaseStorage/SparePartPurchaseStorageModal.vue
@@ -20,7 +20,7 @@
            >
              <a-input
                placeholder='请输入库单编号'
                :disabled="disableSubmit"
                :disabled="true"
                v-decorator="['num', validatorRules.num]"
              />
            </a-form-item>
@@ -353,7 +353,8 @@
        getSuppliers: '/spare/sparePartPurchaseStorageDeatil/getSuppliers',
        getWarehouseAreas: '/spare/sparePartPurchaseStorageDeatil/getWarehouseAreas',
        getWarehouseLocations: '/spare/sparePartPurchaseStorageDeatil/getWarehouseLocations',
        getWarehouses: '/base/warehouse/queryById'
        getWarehouses: '/base/warehouse/queryById',
        getNum: '/eam/sysIdentity/getNumNew',
      },
      dataSource: []
@@ -430,6 +431,13 @@
        this.codeDisable = true
      } else {
        this.codeDisable = false
        this.$nextTick(() => {
          getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
            if (res.success) {
              this.form.setFieldsValue({ num: res.message });
            }
          })
        });
      }
    },
    initOptions() {
src/views/spare/modules/sparePartReceive/SparePartReceiveForm.vue
@@ -6,7 +6,7 @@
        <a-row>
          <a-col :span='12'>
            <a-form-model-item label='单据号' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='num'>
              <a-input v-model='model.num' placeholder='请输入单据号'></a-input>
              <a-input v-model='model.num' placeholder='请输入单据号' :disabled="true"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col  :span='12'>
@@ -345,6 +345,7 @@
        edit: '/spare/sparePartReceive/edit',
        getSysDeparts: "/eam/equipment/getSysDeparts",
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
        getNum: '/eam/sysIdentity/getNumNew',
        sparesReceiveDetail: {
          list: '/spare/sparePartReceive/querySparePartReceiveDeatilByMainId'
        }
@@ -373,8 +374,18 @@
  },
  created() {
    this.initOptions();
    this.initNum()
  },
  methods: {
    initNum() {
      getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
          /* this.model.setFieldsValue({ num: res.message }); */
        }
      })
    },
    getSysDeparts() {
      getAction(this.url.getSysDeparts).then((res) => {
        if (res.success) {
src/views/spare/modules/sparePartReceive/SpareSelectList.vue
@@ -71,63 +71,54 @@
        {
          title: '备件编码',
          align: 'center',
          fixed: 'left',
          dataIndex: 'spareNum',
          width: 150,
          ellipsis: true
        },
        {
          title: '备件名称',
          align: 'center',
          fixed: 'left',
          dataIndex: 'spareName',
          width: 150,
          ellipsis: true
        },
        {
          title: '型号',
          align: 'center',
          dataIndex: 'model',
          fixed: 'left',
          width: 150
        },
        {
          title: '规格',
          align: 'center',
          dataIndex: 'specification',
          width: 150,
          ellipsis: true
        },
        {
          title: '批次号',
          align: 'center',
          dataIndex: 'batchNum',
          width: 150,
        },
        {
          title: '制造商',
          align: 'center',
          dataIndex: 'constructorName',
          width: 150,
        },
        {
          title: '出厂日期',
          align: 'center',
          dataIndex: 'manufactureDate',
          width: 150,
        },
        { title: '有效期',
          align: 'center',
          dataIndex: 'validityPeriod',
          width: 150,
        },
        { title: '单位',
          align: 'center',
          dataIndex: 'mainUnitId_dictText',
          width: 150,
        },
        /* { title: '辅单位',
          align: 'center',
@@ -138,7 +129,7 @@
        { title: '数量',
          align: 'center',
          dataIndex: 'mainQuantity',
          width: 150
        },
      /*   { title: '辅数量',
src/views/spare/modules/sparePartScrap/SparePartScrapForm.vue
@@ -6,7 +6,7 @@
        <a-row>
          <a-col :span='12'>
            <a-form-model-item label='单据号' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='num'>
              <a-input v-model='model.num' placeholder='请输入单据号'></a-input>
              <a-input v-model='model.num' placeholder='请输入单据号' :disabled="true"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span='12'>
@@ -397,6 +397,7 @@
        getSysDeparts: "/eam/equipment/getSysDeparts",
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
        queryById: '/spare/sparePartScrap/queryById',
        getNum: '/eam/sysIdentity/getNumNew',
        sparesScrapDetail: {
          list: '/spare/sparePartScrap/querySparesScrapDetailByMainId'
        }
@@ -425,8 +426,18 @@
  },
  created() {
    this.initOptions()
    this.initNum()
  },
  methods: {
    initNum() {
      getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
          /* this.model.setFieldsValue({ num: res.message }); */
        }
      })
    },
    initOptions() {
      getAction(this.url.loadOptions).then(res => {
        if (res.success) {
src/views/spare/modules/sparePartScrap/SpareSelectList.vue
@@ -1,19 +1,19 @@
<template>
  <!--支持全屏缩放-->
  <a-modal :visible='visible' :title='title' switchFullscreen @ok='handleSubmit' @cancel='close' style='top:50px'
           cancelText='关闭' :width='1800'>
    <a-card :bordered='false'>
      <div class='table-page-search-wrapper'>
        <a-form layout='inline' @keyup.enter.native='searchQuery'>
          <a-row :gutter='24'>
            <a-col :md='6' :sm='4'>
              <a-form-item label='备件编码'>
                <a-input placeholder='请输入备件编码' v-model='queryParam.num'/>
  <a-modal :visible="visible" :title="title" switchFullscreen @ok="handleSubmit" @cancel="close" style="top:50px"
           cancelText="关闭" :width="1800">
    <a-card :bordered="false">
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :md="6" :sm="4">
              <a-form-item label="备件编码">
                <a-input placeholder="请输入备件编码" v-model="queryParam.num" />
              </a-form-item>
            </a-col>
            <a-col :md='6' :sm='4'>
              <a-form-item label='备件名称'>
                <a-input placeholder='请输入备件名称' v-model='queryParam.name'/>
            <a-col :md="6" :sm="4">
              <a-form-item label="备件名称">
                <a-input placeholder="请输入备件名称" v-model="queryParam.name" />
              </a-form-item>
            </a-col>
            <!-- <a-col :md='6' :sm='4'>
@@ -22,28 +22,28 @@
                                     dictCode='tooling_category_flag' placeholder='请选择存货分类' />
              </a-form-item>
            </a-col> -->
            <a-col :md='3'>
              <span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'>
                <a-button type='primary' @click='searchQuery' icon='search'>查询</a-button>
                <a-button @click='searchReset' icon='reload' style='margin-left: 10px'>重置</a-button>
            <a-col :md="3">
              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                <a-button @click="searchReset" icon="reload" style="margin-left: 10px">重置</a-button>
              </span>
            </a-col>
          </a-row>
        </a-form>
      </div>
      <a-row :gutter='24'>
        <a-col :md='24' :sm='12'>
          <a-table ref='table'
                   :scroll='{ x: true }'
                   size='middle' rowKey='id'
      <a-row :gutter="24">
        <a-col :md="24" :sm="12">
          <a-table ref="table"
                   :scroll="{ x: true }"
                   size="middle" rowKey="id"
                   bordered
                   :columns='columns'
                   :dataSource='dataSource'
                   :pagination='ipagination'
                   :rowSelection='rowSelection'
                   :columns="columns"
                   :dataSource="dataSource"
                   :pagination="ipagination"
                   :rowSelection="rowSelection"
                   :loading='loading'
                   @change='handleTableChange'>
                   :loading="loading"
                   @change="handleTableChange">
          </a-table>
        </a-col>
      </a-row>
@@ -79,62 +79,55 @@
          align: 'center',
          fixed: 'left',
          dataIndex: 'spareNum',
          width: 150,
          ellipsis: true
        },
        {
          title: '备件名称',
          align: 'center',
          fixed: 'left',
          dataIndex: 'spareName',
          width: 150,
          dataIndex: 'spareName'
        },
        {
          title: '规格',
          align: 'center',
          dataIndex: 'specification',
          width: 150,
          dataIndex: 'specification'
        },
        {
          title: '型号',
          align: 'center',
          dataIndex: 'model',
          width: 150
          dataIndex: 'model'
        },
        {
          title: '批次号',
          align: 'center',
          dataIndex: 'batchNum',
          width: 150,
          dataIndex: 'batchNum'
        },
        {
          title: '制造商',
          align: 'center',
          dataIndex: 'constructorName',
          width: 150,
          dataIndex: 'constructorName'
        },
        {
          title: '出厂日期',
          align: 'center',
          dataIndex: 'manufactureDate',
          width: 150,
        },
        { title: '有效期',
          align: 'center',
          dataIndex: 'validityPeriod',
          width: 150,
          dataIndex: 'manufactureDate'
        },
        { title: '单位',
        {
          title: '有效期',
          align: 'center',
          dataIndex: 'mainUnitId_dictText',
          width: 150,
          dataIndex: 'validityPeriod'
        },
        {
          title: '单位',
          align: 'center',
          dataIndex: 'mainUnitId_dictText'
        },
     /*    { title: '辅单位',
@@ -143,12 +136,12 @@
          width: 150
        }, */
        { title: '库存数量',
        {
          title: '库存数量',
          align: 'center',
          dataIndex: 'mainQuantity',
          width: 150
          dataIndex: 'mainQuantity'
        },
        }
      /*   { title: '库存辅数量',
          align: 'center',
          dataIndex: 'auxiliaryQuantity',
@@ -187,7 +180,7 @@
      loading: false,
      url: {
        list: '/spare/sparePartScrap/getSpareList'
      },
      }
    }
  },
  computed: {
@@ -287,7 +280,7 @@
    },
    searchQuery() {
      this.loadData(1)
    },
    }
  }
}
src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue
@@ -1,16 +1,16 @@
<template>
  <a-spin :spinning='confirmLoading'>
    <j-form-container :disabled='formDisabled'>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <!-- 主表单区域 -->
      <a-form-model ref='form' :model='model' :rules='validatorRules' slot='detail'>
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span='12'>
            <a-form-model-item label='单据号' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='num'>
              <a-input v-model='model.num' placeholder='请输入单据号'></a-input>
          <a-col :span="12">
            <a-form-model-item label="单据号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
              <a-input v-model="model.num" placeholder="请输入单据号" :disabled="true"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span='12'>
            <a-form-model-item label='申请部门' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='departId'>
          <a-col :span="12">
            <a-form-model-item label="申请部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departId">
              <!--              <a-input v-model="model.departId" placeholder="请输入领用部门ID" ></a-input>-->
<!--              <j-dict-select-tag
                allow-clear
@@ -24,7 +24,7 @@
                :tree-data="treeData"
                placeholder="请选择申请部门"
                tree-default-expand-all
                v-model='model.departId'
                v-model="model.departId"
              />
<!--              <a-select
                :placeholder="'请选择申请部门'"
@@ -34,13 +34,13 @@
              />-->
            </a-form-model-item>
          </a-col>
          <a-col :span='12'>
            <a-form-model-item label='备注' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='remark'>
          <a-col :span="12">
            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
              <!--              <a-input v-model="model.userId" placeholder="请输入领用人员ID" ></a-input>-->
              <a-textarea
                allow-clear
                :placeholder="'请输入备注'"
                v-model='model.remark'
                v-model="model.remark"
              />
            </a-form-model-item>
          </a-col>
@@ -49,26 +49,26 @@
      </a-form-model>
    </j-form-container>
    <!-- 子表单区域 -->
    <a-tabs v-model='activeKey' @change='handleChangeTabs'>
      <a-tab-pane tab='备件报废明细表' :key='refKeys[0]' :forceRender='true'>
    <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='sparesScrapRequirementDetailTable.loading'
          :columns='sparesScrapRequirementDetailTable.columns'
          :dataSource='sparesScrapRequirementDetailTable.dataSource'
          :maxHeight='300'
          :disabled='formDisabled'
          :alwaysEdit='true'
          :rowNumber='true'
          :bordered='bordered'
          :rowSelection='true'
          :toolbar='true'
          :toolbarConfig='toolbarConfig'
          :ref="refKeys[0]"
          :loading="sparesScrapRequirementDetailTable.loading"
          :columns="sparesScrapRequirementDetailTable.columns"
          :dataSource="sparesScrapRequirementDetailTable.dataSource"
          :maxHeight="300"
          :disabled="formDisabled"
          :alwaysEdit="true"
          :rowNumber="true"
          :bordered="bordered"
          :rowSelection="true"
          :toolbar="true"
          :toolbarConfig="toolbarConfig"
        >
          <template slot='toolbarPrefix'>
            <a-button type='primary' @click='selectEquipmentList' :disabled='formDisabled'>选择备件
          <template slot="toolbarPrefix">
            <a-button type="primary" @click="selectEquipmentList" :disabled="formDisabled">选择备件
            </a-button>
          </template>
          <!--          <template slot='toolbarPrefix'>
@@ -78,8 +78,7 @@
        </j-vxe-table>
      </a-tab-pane>
    </a-tabs>
    <spare-select-list ref='SparesSelectModal'></spare-select-list>
    <!--    <spare-requirement-select-modal ref='SpareRequirementSelecModal'></spare-requirement-select-modal>-->
    <spare-select-list ref="SparesSelectModal"></spare-select-list>
  </a-spin>
</template>
@@ -91,7 +90,6 @@
import JFormContainer from '@comp/jeecg/JFormContainer'
import SpareSelectList from './SpareSelectList'
import { getAction } from '@api/manage'
/*import SpareRequirementSelectModal from './SpareRequirementSelectModal'*/
export default {
  name: 'SparePartScrapRequirementForm',
  mixins: [JVxeTableModelMixin],
@@ -305,7 +303,8 @@
        edit: '/spare/sparePartRequirement/edit',
        queryById: '/spare/sparePartRequirement/queryById',
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
        getSysDeparts: "/eam/equipment/getSysDeparts",
        getSysDeparts: '/eam/equipment/getSysDeparts',
        getNum: '/eam/sysIdentity/getNumNew',
        sparesScrapRequirementDetail: {
          list: '/spare/sparePartRequirement/querySparesScrapRequirementDetailByMainId'
        }
@@ -339,8 +338,59 @@
  },
  created() {
    this.initOptions()
    this.initNum()
  },
  methods: {
    /*     edit(record) {
          this.form.resetFields();
          this.model = Object.assign({}, record);
          this.visible = true;
          this.disableSubmit = false;
          this.auxiliaryUnits = record.auxiliaryUnits
          this.$nextTick(() => {
            this.form.setFieldsValue(pick(this.model,
              'num',
              'name',
              'specification',
              'model',
              'constructorId',
              'mainUnitId',
              'auxiliaryUnitId',
              'conversionRatio',
              'validityPeriod',
              'validityPeriodUnitId',
              'inventoryUpperLimit',
              'inventoryLowerLimit',
              'economicOrderQuantity',
              'purchaseLeadTime',
              'inventoryWarnLimit',
              'remark'));
          });
          if (record.id) {
            this.codeDisable = true;
          } else {
            this.codeDisable = false;
            this.$nextTick(() => {
              getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
                if (res.success) {
                  this.form.setFieldsValue({ num: res.message });
                }
              })
            });
          }
        }, */
    initNum() {
      getAction(this.url.getNum, { type: 'SparePart', length: '4' }).then((res) => {
        if (res.success) {
          this.model.num = res.message
          /* this.model.setFieldsValue({ num: res.message }); */
        }
      })
    },
    initOptions() {
      getAction(this.url.loadOptions).then(res => {
        if (res.success) {
@@ -427,7 +477,7 @@
    validateSubForm(allValues) {
      let tableData = this.$refs.sparesScrapRequirementDetail.getTableData()
      if(tableData.length == 0){
        this.$message.warning("请添加加报废明细!");
        this.$message.warning('请添加加报废明细!')
        return
      }
      return new Promise((resolve, reject) => {
@@ -458,7 +508,7 @@
      this.visible = false
      this.$emit('close')
      this.$refs.form.clearValidate()
    },
    }
/*     changeAuxiliaryQuantity(target){
      console.log(target.columnIndex)
      let num=target.columnIndex