石广澎
2023-11-29 20913c80c3f5fc8e533cb92b90e6f20bcd68e032
admin-web/src/views/stock/ledger/ledgerQuery/index.vue
@@ -30,9 +30,9 @@
import SettingIplatform from '@/utils/settingIplatform';
import * as finsystenant from '@/api/baseSetting/finsystenant';
import myImport from '@/views/components/myImport';
import { getBaseUrl } from '@/utils/base';
import { getCategorySelectTree, goodsModel } from '@/api/baseSetting/finsystenant';
import { getDicts } from '@/api/system/dict/data';
import {getBaseUrl} from '@/utils/base';
import * as DateFormatter from '@/utils/DateFormatter';
import stockType from '@/utils/stockType'
export default {
  name: 'index',
@@ -46,64 +46,83 @@
          dataIndex: 'agencyId',
          label: '机构',
          placeholder: '请选择',
          optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null },
          defaultValue: '',
          options: [],
          cascader: [
            { key: 'warehouseId', queryKey: 'agencyId' },
            { key: 'goodsTemplateId', queryKey: 'agencyId' },
          ],
          optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null },
        },
        {
          type: 'text',
          dataIndex: 'name',
          type: 'select',
          dataIndex: 'warehouseId',
          label: '仓库',
          placeholder: '请选择',
          defaultValue: '',
          options: [],
          optionsConfig: {
            label: 'warehouseName',
            value: 'id',
            url: SettingIplatform.apiBaseURL + '/pc/base/warehouse/select/tenant_warehouse',
          },
        },
        {
          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: 'status',
          dataIndex: 'baseGoodsModelsId',
          label: '规格型号',
          placeholder: '请选择',
          placeholder: '请输入',
          defaultValue: '',
          options: [],
          optionsConfig: {
            label: 'modelName',
            value: 'id',
            url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel',
          },
        },
        {
          type: 'select',
          dataIndex: 'status',
          label: '分类',
          dataIndex: 'flowType',
          label: '类型',
          placeholder: '请选择',
          defaultValue: '',
          options: [],
        },
        {
          type: 'select',
          dataIndex: 'status',
          label: '类别',
          placeholder: '请选择',
          defaultValue: '',
          options: [],
          optionsConfig: {
            label: 'dict_label',
            value: 'dict_value',
            url: SettingIplatform.apiBaseURL + '/permit/dict/data/type/FLOW_TYPE',
          },
        },
        {
          type: 'text',
          dataIndex: 'name',
          dataIndex: 'businessFormCode',
          label: '单号',
          placeholder: '请输入',
          defaultValue: '',
        },
        {
          type: 'text',
          dataIndex: 'name',
          label: '操作人',
          placeholder: '请输入',
          type: 'date-picker',
          dataIndex: 'dealTimeStart',
          label: '时间',
          defaultValue: '',
        },
        {
          type: 'date-picker',
          dataIndex: 'val1',
          label: '出库时间',
          defaultValue: '',
        },
        {
          type: 'date-picker',
          dataIndex: 'val2',
          dataIndex: 'dealTimeEnd',
          label: '至',
          defaultValue: '',
        },
@@ -145,7 +164,7 @@
      table: {
        showIndex: true, // 是否显示序号
        expand: false, // 是否显示详情数据
        url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 请求地址
        url: SettingIplatform.apiBaseURL + '/pc/warehouse/flow/getTaiZhangList', // 请求地址
        // 工具条
        tools: {
          columnsCtrl: {
@@ -161,17 +180,33 @@
        },
        // 列信息
        columns: [
          { title: '机构', field: 'name', align: 'left' },
          { title: '仓库', field: 'code', align: 'center' },
          { title: '物品名称', field: 'lv', align: 'center' },
          { title: '规格型号', field: 'lv', align: 'center' },
          { title: '类型', field: 'summary', align: 'left' },
          { title: '单号', field: 'summary', align: 'left' },
          { title: '数量', field: 'summary', align: 'left' },
          { title: '操作前数量', field: 'summary', align: 'left' },
          { title: '操作后数量', field: 'summary', align: 'left' },
          { title: '在途', field: 'summary', align: 'left' },
          { title: '操作时间', field: 'summary', align: 'left' },
          { title: '机构', field: 'agencyName', align: 'left', width: 130 },
          { title: '仓库', field: 'warehouseName', align: 'left', width: 130 },
          { title: '物品名称', field: 'goodsTemplateName', align: 'left', minWidth: 130 },
          { title: '规格型号', field: 'baseGoodsModelsName', align: 'left', width: 130 },
          {
            title: '类型',
            field: 'summary',
            align: 'center',
            formatter: (row) => {
              let result = stockType(row)
              return { value: result };
            },
          },
          { title: '单号', field: 'businessFormCode', align: 'center', width: 130 },
          { title: '数量', field: 'thisCount', align: 'center', width: 100 },
          { title: '操作前数量', field: 'initialCount', align: 'center', width: 100 },
          { title: '操作后数量', field: 'endCount', align: 'center', width: 100 },
          { title: '在途', field: 'zaiTuCount', align: 'center', width: 100 },
          {
            title: '操作时间',
            field: 'dealTime',
            align: 'center',
            width: 160,
            formatter: (row) => {
              return { value: DateFormatter.LongToDateTime(row.dealTime) };
            },
          },
        ],
        paging: {
          show: true, // 显示分页
@@ -186,45 +221,8 @@
      },
    };
  },
  created() {
    this.initQuery();
  },
  created() {},
  methods: {
    initQuery() {
      goodsModel().then((res) => {
        this.items.forEach((v) => {
          if (v.label == '规格型号') {
            v.options = res.map((item) => {
              item.label = item.modelName;
              item.vlaue = item.id;
              return item;
            });
          }
        });
      });
      getDicts('GOODS_PRICE').then((res) => {
        this.items.forEach((v) => {
          if (v.label == '类别') {
            v.options = res.map((v) => {
              v.label = v.dict_label;
              v.value = v.dict_value;
              return v;
            });
          }
        });
      });
      getCategorySelectTree().then((res) => {
        this.items.forEach((v) => {
          if (v.label == '分类') {
            v.options = res.map((item) => {
              item.label = item.label;
              item.vlaue = item.id;
              return item;
            });
          }
        });
      });
    },
    del(row) {
      this.$modal
        .confirm('是否确认删除名称为"' + row.name + '"的机构吗?')