liuying
2024-04-24 0c525ecf57809add2b988f331e22a74022ad1070
iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/WmsControlRule/index.vue
@@ -1,6 +1,6 @@
<template>
  <!-- 控制属性规则 -->
  <div ref="boxOutWrap" class="boxOutWrap">
  <div ref="boxOutWrap">
    <div ref="boxForm" class="boxForm">
      <a-card :bordered="false" :bodyStyle="tstyle">
        <div class="table-page-search-wrapper" v-if="hasPerm('WmsControlRule:page')">
@@ -14,8 +14,7 @@
              <a-col :md="8" :sm="24">
                <a-form-item label="规则名称">
                  <a-input v-model="queryParam.ruleName" allow-clear placeholder="请输入规则名称" />
                </a-form-item> </a-col
              ><template v-if="advanced">
                </a-form-item> </a-col><template v-if="advanced">
                <a-col :md="8" :sm="24">
                  <a-form-item label="规则描述">
                    <a-input v-model="queryParam.ruleDesc" allow-clear placeholder="请输入规则描述" />
@@ -23,12 +22,8 @@
                </a-col>
                <a-col :md="8" :sm="24">
                  <a-form-item label="是否禁用">
                    <a-select
                      :allowClear="true"
                      style="width: 100%"
                      v-model="queryParam.isDisabled"
                      placeholder="请选择是否禁用"
                    >
                    <a-select :allowClear="true" style="width: 100%" v-model="queryParam.isDisabled"
                      placeholder="请选择是否禁用">
                      <a-select-option v-for="(item, index) in isDisabledData" :key="index" :value="item.code">{{
                        item.name
                      }}</a-select-option>
@@ -40,18 +35,11 @@
                <a-col :md="8" :sm="24">
                  <a-form-item label="创建时间">
                    <a-range-picker
                      style="width: 100%"
                      :placeholder="['开始时间', '结束时间']"
                      :show-time="{
                        format: 'HH:mm:ss',
                        defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')]
                      }"
                      v-model="queryParam.createdTime"
                      value-format="YYYY-MM-DD HH:mm:ss"
                      format="YYYY-MM-DD HH:mm:ss"
                      @change="onChangecreatedTime"
                    />
                    <a-range-picker style="width: 100%" :placeholder="['开始时间', '结束时间']" :show-time="{
                      format: 'HH:mm:ss',
                      defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')]
                    }" v-model="queryParam.createdTime" value-format="YYYY-MM-DD HH:mm:ss"
                      format="YYYY-MM-DD HH:mm:ss" @change="onChangecreatedTime" />
                  </a-form-item>
                </a-col>
                <!--年月日时分秒-->
@@ -59,18 +47,11 @@
                <a-col :md="8" :sm="24">
                  <a-form-item label="更新时间">
                    <a-range-picker
                      style="width: 100%"
                      :placeholder="['开始时间', '结束时间']"
                      :show-time="{
                        format: 'HH:mm:ss',
                        defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')]
                      }"
                      v-model="queryParam.updatedTime"
                      value-format="YYYY-MM-DD HH:mm:ss"
                      format="YYYY-MM-DD HH:mm:ss"
                      @change="onChangeupdatedTime"
                    />
                    <a-range-picker style="width: 100%" :placeholder="['开始时间', '结束时间']" :show-time="{
                      format: 'HH:mm:ss',
                      defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')]
                    }" v-model="queryParam.updatedTime" value-format="YYYY-MM-DD HH:mm:ss"
                      format="YYYY-MM-DD HH:mm:ss" @change="onChangeupdatedTime" />
                  </a-form-item>
                </a-col>
@@ -102,16 +83,9 @@
      </a-card>
    </div>
    <a-card :bordered="false">
      <s-table
        ref="table"
        :columns="columns"
        :data="loadData"
        :alert="true"
        @changeTablePage="pageInfo = $event"
        :scroll="{ x: true, y: tableHeight }"
        :rowKey="record => record.id"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
      >
      <s-table ref="table" :columns="columns" :data="loadData" :alert="true" @changeTablePage="pageInfo = $event"
        :scroll="{ x: true}" :rowKey="record => record.id"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
        <template class="table-operator" slot="operator" v-if="hasPerm('WmsControlRule:add')">
          <!-- <div ref="actionBar" class="actionBar">
            <a-button
@@ -144,20 +118,13 @@
          </div>
          <div v-else=""></div>
        </span>
        <span slot="action" slot-scope="text, record">
          <!-- 自定义 -->
        <!-- <span slot="action" slot-scope="text, record">
          <a v-if="hasPerm('WmsControlRule:getdetail')" @click="$refs.detailForm.edit(record)">详情</a>
          &nbsp;&nbsp;
          </a-popconfirm>
        </span>
        </span> -->
      </s-table>
      <add-form ref="addForm" @ok="handleOk" />
      <edit-form ref="editForm" @ok="handleOk" />
      <excel-form ref="excelForm" @ok="handleOk" />
     <!-- 自定义 -->
      <detail-form ref="detailForm" @ok="handleOk" />
    </a-card>
  </div>
</template>
@@ -171,22 +138,13 @@
} from '@/api/modular/main/WmsBase/WmsControlRuleManage'
//自定义table高度
import setTableHtMixin from '@/mixins/handleTableHt.js'
import addForm from './addForm.vue'
import { exportExcel } from '@/utils/exportToExcel'
import { downloadFile } from '@/utils/util'
import editForm from './editForm.vue'
import excelForm from './excelForm.vue'
import detailForm from './details.vue'
export default {
  mixins: [setTableHtMixin],
  // mixins: [setTableHtMixin],
  components: {
    STable,
    addForm,
    editForm,
    excelForm,
    detailForm
  },
  data() {
    return {
@@ -204,19 +162,19 @@
          customRender: (text, record, index) => `${index + 1 + (this.pageInfo.current - 1) * this.pageInfo.pageSize}`
        },
        {
          title: '规则编号',
          title: '控制属性规则编号',
          align: 'center',
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '150px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
@@ -224,44 +182,145 @@
          dataIndex: 'ruleCode'
        },
        {
          title: '规则名称',
          title: '最高库存',
          align: 'center',
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          sorter: true,
          dataIndex: 'ruleName'
          dataIndex: 'maxImumqty'
        },
        {
          title: '规则描述',
          title: '最低库存',
          align: 'center',
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          sorter: true,
          dataIndex: 'ruleDesc'
          dataIndex: 'minImumqty'
        },
        {
          title: '安全库存',
          align: 'center',
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          sorter: true,
          dataIndex: 'safeImumqty'
        },
        {
          title: '最小库龄',
          align: 'center',
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          sorter: true,
          dataIndex: 'minStorageAge'
        },
        {
          title: '最大库龄',
          align: 'center',
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          sorter: true,
          dataIndex: 'maxStorageAge'
        },
        {
          title: '是否免检',
          align: 'center',
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          sorter: true,
          dataIndex: 'isNotChek',
          scopedSlots: { customRender: 'isNotChekscopedSlots' }
        },
        {
          title: '保质期天数',
          align: 'center',
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          sorter: true,
          dataIndex: 'shelfLifeDays'
        },
        {
          title: '是否禁用',
@@ -269,14 +328,14 @@
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
@@ -290,14 +349,14 @@
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
@@ -310,14 +369,14 @@
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
@@ -330,14 +389,14 @@
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
@@ -350,14 +409,14 @@
          customHeaderCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
          customCell: () => {
            return {
              style: {
                'min-width': '120px' //最小列宽设置
                'min-width': '120px'//最小列宽设置
              }
            }
          },
@@ -377,14 +436,14 @@
    }
  },
  created() {
    if (this.hasPerm('WmsControlRule:edit') || this.hasPerm('WmsControlRule:delete')) {
      this.columns.push({
        title: '操作',
        width: '150px',
        dataIndex: 'action',
        scopedSlots: { customRender: 'action' }
      })
    }
    // if (this.hasPerm('WmsControlRule:edit') || this.hasPerm('WmsControlRule:delete')) {
    //   this.columns.push({
    //     title: '操作',
    //     width: '150px',
    //     dataIndex: 'action',
    //     scopedSlots: { customRender: 'action' }
    //   })
    // }
    const path = this.$route.path
    const columnStr = window.localStorage.getItem(path)
    if (columnStr) {
@@ -506,6 +565,7 @@
.table-operator {
  margin-bottom: 18px;
}
button {
  margin-right: 8px;
}