石广澎
2024-01-05 b2429057ae17e9f5b357435b0bff5f6cc0040b69
admin-web/src/views/stock/transfer/transferdetails/index.vue
@@ -31,10 +31,7 @@
import MyButton from '@/components/myButton/myButton';
import SettingIplatform from '@/utils/settingIplatform';
import detail from '../transferApplication/detail';
import * as finsystenant from '@/api/baseSetting/finsystenant';
import myImport from '@/views/components/myImport';
import { getBaseUrl } from '@/utils/base';
import { goodsModel } from '@/api/baseSetting/finsystenant';
import * as DateFormatter from '@/utils/DateFormatter';
export default {
@@ -52,19 +49,31 @@
          defaultValue: '',
        },
        {
          type: 'text',
          dataIndex: 'goodsName',
          type: 'select',
          dataIndex: 'goodsTemplateId',
          label: '物品名称',
          placeholder: '请输入',
          defaultValue: '',
          options: [],
          cascader: [{ key: 'baseGoodsModelsId', queryKey: 'goodsTemplatesId' }],
          optionsConfig: {
            label: 'goodsName',
            value: 'id',
            url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate',
          },
        },
        {
          type: 'select',
          dataIndex: 'baseGoodsModelsId',
          label: '规格型号',
          placeholder: '请选择',
          placeholder: '请输入',
          defaultValue: '',
          options: [],
          optionsConfig: {
            label: 'modelName',
            value: 'id',
            url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel',
          },
        },
        {
          type: 'cascader',
@@ -93,25 +102,25 @@
        },
        {
          type: 'date-picker',
          dataIndex: 'val1',
          dataIndex: 'createTimeStart',
          label: '申请时间',
          defaultValue: '',
        },
        {
          type: 'date-picker',
          dataIndex: 'val2',
          dataIndex: 'createTimeEnd',
          label: '至',
          defaultValue: '',
        },
        {
          type: 'date-picker',
          dataIndex: 'val1',
          dataIndex: 'startTime',
          label: '接收时间',
          defaultValue: '',
        },
        {
          type: 'date-picker',
          dataIndex: 'val2',
          dataIndex: 'endTime',
          label: '至',
          defaultValue: '',
        },
@@ -148,12 +157,12 @@
        },
        // 列信息
        columns: [
          { title: '单号', field: 'businessFormCode', align: 'center' },
          { title: '物品名称', field: 'goodsName', align: 'center' },
          { title: '规格型号', field: 'baseGoodsModelsName', align: 'center' },
          { title: '数量', field: 'counts', align: 'left' },
          { title: '接受机构', field: 'inAgencyName', align: 'left' },
          { title: '创建人', field: 'operatorName', align: 'left' },
          { title: '单号', field: 'businessFormCode', align: 'center', width: 130 },
          { title: '物品名称', field: 'goodsName', align: 'left', width: 140 },
          { title: '规格型号', field: 'baseGoodsModelsName', align: 'left', width: 130 },
          { title: '数量', field: 'counts', align: 'center' },
          { title: '接受机构', field: 'inAgencyName', align: 'left', width: 130 },
          { title: '创建人', field: 'operatorName', align: 'center', width: 90 },
          {
            title: '申请时间',
            field: 'createTime',
@@ -172,11 +181,12 @@
              return { value: row.inTime ? DateFormatter.LongToDateTime(row.inTime) : '-' };
            },
          },
          { title: '调拨机构', field: 'outAgencyName', align: 'left' },
          { title: '调拨机构', field: 'outAgencyName', align: 'left', width: 130 },
          {
            title: '调拨人',
            field: 'outOperatorName',
            align: 'center',
            width: 90,
            formatter: (row) => {
              return { value: row.outOperatorName || '-' };
            },
@@ -194,7 +204,7 @@
        // 操作信息
        operation: {
          show: true, // 显示操作列
          width: '150', // 列宽
          width: 100, // 列宽
          attr: [
            {
              title: '详情',
@@ -218,22 +228,8 @@
    };
  },
  created() {
    this.initSearch();
  },
  methods: {
    initSearch() {
      this.items.map(async (item) => {
        if (item.label == '规格型号') {
          let res = await goodsModel();
          item.options = res.map((v) => {
            v.label = v.modelName;
            v.value = v.id;
            return v;
          });
        }
        return item;
      });
    },
    showDetail(row) {
      this.detailSetting.id = row.id;
      this.detailSetting.info = JSON.stringify(row);
@@ -243,19 +239,13 @@
    // 查询table列表
    search(pageNum) {
      if (pageNum != undefined) {
        this.$refs.myTable.search(pageNum);
        this.$refs.myTable.search({pageNum});
      } else {
        this.$refs.myTable.search();
      }
    },
    fifterForm(params) {
      this.filterFrom = Object.assign(this.filterFrom, params);
      if (this.filterFrom.outAgencyId && this.filterFrom.outAgencyId.length) {
        this.filterFrom.outAgencyId = this.filterFrom.outAgencyId[this.filterFrom.outAgencyId.length - 1];
      }
      if (this.filterFrom.inAgencyId && this.filterFrom.inAgencyId.length) {
        this.filterFrom.inAgencyId = this.filterFrom.inAgencyId[this.filterFrom.inAgencyId.length - 1];
      }
      if (this.filterFrom.createTimeStart) {
        this.filterFrom.createTimeStart = this.filterFrom.createTimeStart.replace(/\-/g, '');
      }