yangyang
2025-07-14 06c4e59fa35c1b9e74da9cf3d081e78c13d17e20
zy-asrs-admin/src/views/loc/locDetl/index.vue
@@ -8,7 +8,6 @@
import { formatMessage } from '@/utils/localeUtils.js';
import useTableSearch from '@/utils/tableUtils.jsx';
const context = getCurrentInstance()?.appContext.config.globalProperties;
const router = useRouter();
const TABLE_KEY = 'table-locDetl';
@@ -20,9 +19,10 @@
  matnr: null,
  orderNo: null,
  batch: null,
  tagId: null,
  orderType: null,
})
const editChild = ref(null)
const state = reactive({
  selectedRowKeys: [],
  loading: false,
@@ -69,11 +69,11 @@
    ...getColumnSearchProps('locNo'),
  },
  {
    title: formatMessage('db.man_loc_detl.mat_id', '商品'),
    dataIndex: 'matId$',
    title: formatMessage('db.man_loc_detl.loc_type', '库位类型'),
    dataIndex: 'type$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('matId$'),
    ...getColumnSearchProps('type$'),
  },
  {
    title: formatMessage('db.man_loc_detl.matnr', '商品编号'),
@@ -81,6 +81,62 @@
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('matnr'),
  },
  {
    title: formatMessage('db.man_loc_detl.maktx', '商品名称'),
    dataIndex: 'maktx',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('maktx'),
  },
  {
    title: formatMessage('db.man_loc_detl.specs', '规格'),
    dataIndex: 'specs',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('specs'),
  },
  {
    title: formatMessage('db.man_loc_detl.model', '型号'),
    dataIndex: 'model',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('model'),
  },
  {
    title: formatMessage('db.man_loc_detl.matnr', '品类'),
    dataIndex: 'tagId$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('tagId$'),
  },
  {
    title: formatMessage('db.man_loc_detl.maktx', '颜色'),
    dataIndex: 'color',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('color'),
  },
  {
    title: formatMessage('db.man_loc_detl.model', '品牌'),
    dataIndex: 'brand',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('brand'),
  },
  {
    title: formatMessage('db.man_loc_detl.model', '产地'),
    dataIndex: 'origin',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('origin'),
  },
  {
    title: formatMessage('db.man_loc_detl.dewell', '入库时间'),
    dataIndex: 'dewell$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('dewell$'),
  },
  {
    title: formatMessage('db.man_loc_detl.order_no', '订单号'),
@@ -103,13 +159,13 @@
    ellipsis: true,
    ...getColumnSearchProps('anfme'),
  },
  {
    title: formatMessage('db.man_loc_detl.freeze', '是否冻结'),
    dataIndex: 'freeze$',
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('freeze$'),
  },
  // {
  //   title: formatMessage('db.man_loc_detl.freeze', '是否冻结'),
  //   dataIndex: 'freeze$',
  //   width: 140,
  //   ellipsis: true,
  //   ...getColumnSearchProps('freeze$'),
  // },
  {
    title: formatMessage('db.man_loc_detl.status', '状态'),
    dataIndex: 'status$',
@@ -117,20 +173,6 @@
    ellipsis: true,
    ...getColumnSearchProps('status$'),
  },
  // {
  //   title: formatMessage('db.man_loc_detl.create_time', '添加时间'),
  //   dataIndex: 'createTime$',
  //   width: 140,
  //   ellipsis: true,
  //   ...getColumnSearchProps('createTime$'),
  // },
  // {
  //   title: formatMessage('db.man_loc_detl.create_by', '添加人员'),
  //   dataIndex: 'createBy$',
  //   width: 140,
  //   ellipsis: true,
  //   ...getColumnSearchProps('createBy$'),
  // },
  {
    title: formatMessage('db.man_loc_detl.update_time', '修改时间'),
    dataIndex: 'updateTime$',
@@ -151,6 +193,14 @@
    width: 140,
    ellipsis: true,
    ...getColumnSearchProps('memo'),
  },
  {
    title: formatMessage('common.operation', '操作'),
    name: 'oper',
    dataIndex: 'oper',
    key: 'oper',
    width: 140,
    fixed: 'right',
  },
];
@@ -174,15 +224,6 @@
        width: 140,
      })
    })
    // tmp.push({
    //   title: formatMessage('common.operation', '操作'),
    //   name: 'oper',
    //   dataIndex: 'oper',
    //   key: 'oper',
    //   width: 140,
    // })
    state.columns = tmp;
  } else if (result.code === 401) {
    message.error(result.msg);
@@ -216,9 +257,43 @@
}
const handleEdit = (item) => {
  editChild.value.open = true;
  editChild.value.formData = item == null ? editChild.value.initFormData : JSON.parse(JSON.stringify(item));
  editChild.value.isSave = item == null;
  let content = "是否确认生成-->出库任务!!"
  let type = 2
  if (item?.locNo.indexOf("B") >= 0 || item?.locNo.indexOf("C") >= 0) {
    content = "是否确认生成-->拣货单!!"
    type = 1
  }
  Modal.confirm({
    title: formatMessage('page.delete', '出库'),
    content: formatMessage('page.delete.confirm', content),
    maskClosable: true,
    onOk: async () => {
      const hide = message.loading(formatMessage('common.loading', '请求中'));
      try {
        let params = {
          outType: type,
          locDetls: [item]
        }
        post('/api/out/locs/stock', params).then(resp => {
          let result = resp.data;
          if (result.code === 200) {
            console.log(result);
            message.success(result.msg);
          } else {
            message.error(result.msg);
          }
          getPage()
          hide()
        })
      } catch (error) {
        message.error(formatMessage('common.fail', '请求失败'));
      }
    },
  });
  // editChild.value.open = true;
  // editChild.value.formData = item == null ? editChild.value.initFormData : JSON.parse(JSON.stringify(item));
  // editChild.value.isSave = item == null;
}
const handleDel = (rows) => {
@@ -259,6 +334,7 @@
const onSearch = () => {
  // console.log('search');
  currentPage = 1;
  getPage()
}
@@ -289,12 +365,25 @@
          style="width: 140px;margin-right: 10px;" />
        <a-input v-model:value="searchParam.matnr" :placeholder="formatMessage('page.locDetl.matnr.input', '请输入商品编号')"
          style="width: 140px;margin-right: 10px;" />
        <a-input v-model:value="searchParam.maktx" :placeholder="formatMessage('page.locDetl.maktx.input', '请输入商品名称')"
          style="width: 140px;margin-right: 10px;" />
        <a-input v-model:value="searchParam.orderNo"
          :placeholder="formatMessage('page.locDetl.orderNo.input', '请输入订单号')"
          style="width: 140px;margin-right: 10px;" />
        <a-input v-model:value="searchParam.batch" :placeholder="formatMessage('page.locDetl.batch.input', '请输入批号')"
          style="width: 140px;margin-right: 10px;" />
        <a-select v-model:value="searchParam.orderType" :placeholder="formatMessage('page.locDetl.orderNo.input', '仓库类型')"
          :options="[
           { label: '全部', value: null },  { label: '立库', value: 1 }, { label: '平库', value: 2 }]" style="width: 140px;margin-right: 10px;">
        </a-select>
        <a-select v-model:value="searchParam.tagId" :placeholder="formatMessage('page.locDetl.orderNo.input', '请选择品类')"
          :options="[
            { label: '默认分类', value: 10 }, { label: '机油', value: 11 }, { label: '变速箱油', value: 17 }, { label: '火花塞', value: 18 },
            { label: '养护品', value: 25 }, { label: '油漆耗材', value: 26 }, { label: '球头摆臂', value: 27 }, { label: '砂纸类', value: 31 },
            { label: '菜瓜布', value: 32 }, { label: '遮蔽类', value: 33 }, { label: '抛光类', value: 34 }, { label: '除尘类', value: 35 },
            { label: '漏斗类', value: 36 }, { label: '防护类', value: 37 }, { label: '烤房保养类', value: 38 }, { label: '调漆罐', value: 39 },
            { label: '喷枪', value: 40 }, { label: '费斯托系列', value: 41 },]" style="width: 140px;margin-right: 10px;">
        </a-select>
        <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')"
          style="width: 200px;" @search="onSearch" />
      </div>
@@ -311,9 +400,9 @@
      <template #bodyCell="{ column, text, record }">
        <template v-if="column.dataIndex === 'oper'">
          <div style="display: flex;justify-content: space-evenly;">
            <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '编辑') }}</a-button>
            <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '删除')
              }}</a-button>
            <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '手动出库')
            }}</a-button>
            <!-- <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '删除')}}</a-button> -->
          </div>
        </template>
      </template>