石广澎
2024-01-05 b2429057ae17e9f5b357435b0bff5f6cc0040b69
admin-web/src/views/stock/inventorycount/exceptionDetails/index.vue
@@ -10,7 +10,7 @@
          <el-row style="margin-top: 15px">
            <el-col>
              <!--列表-->
              <my-table-v2 ref="myTable" :filter="filterFrom" :table="table" />
              <my-table-v2 ref="myTable" :filter="filterFrom" :table="table"/>
            </el-col>
          </el-row>
        </el-card>
@@ -23,15 +23,12 @@
import MyTableV2 from '@/components/myTable/myTableV2';
import MyButton from '@/components/myButton/myButton';
import SettingIplatform from '@/utils/settingIplatform';
import * as finsystenant from '@/api/baseSetting/finsystenant';
import { getBaseUrl } from '@/utils/base';
import { mapGetters } from 'vuex';
import { selectTenantWarehouse,goodsModel } from '@/api/baseSetting/finsystenant';
import { getDicts } from '@/api/system/dict/data';
import {mapGetters} from 'vuex';
import * as DateFormatter from '@/utils/DateFormatter';
export default {
  name: 'index',
  components: { MyButton, MyTableV2 },
  components: {MyButton, MyTableV2},
  data() {
    return {
      // 搜索框
@@ -41,7 +38,8 @@
          dataIndex: 'agencyId',
          label: '机构',
          placeholder: '请选择',
          optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null },
          optionsConfig: {url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null},
          cascader: [{key:'warehouseId',queryKey: 'agencyId'},{key:'goodsTemplateId',queryKey: 'agencyId'}],
          defaultValue: '',
          options: [],
        },
@@ -52,21 +50,38 @@
          placeholder: '请选择',
          defaultValue: '',
          options: [],
        },
        {
          type: 'text',
          dataIndex: 'name',
          label: '物品名称',
          placeholder: '请输入',
          defaultValue: '',
          optionsConfig: {
            label: 'warehouseName',
            value: 'id',
            url: SettingIplatform.apiBaseURL + '/pc/base/warehouse/select/tenant_warehouse',
          },
        },
        {
          type: 'select',
          dataIndex: 'warehouseId',
          label: '规格型号',
          placeholder: '请选择',
          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: '请输入',
          defaultValue: '',
          options: [],
          optionsConfig: {
            label: 'modelName',
            value: 'id',
            url: SettingIplatform.apiBaseURL + '/pc/base/goods/models/query/goodsModel',
          },
        },
        {
          type: 'select',
@@ -74,16 +89,20 @@
          label: '类型',
          placeholder: '请选择',
          defaultValue: '',
          options: [{
            label:'全部',
            value:''
          },{
            label:'盘盈',
            value:'1'
          },{
            label:'盘亏',
            value:'2'
          }],
          options: [
            {
              label: '全部',
              value: '',
            },
            {
              label: '盘盈',
              value: '1',
            },
            {
              label: '盘亏',
              value: '2',
            },
          ],
        },
        {
          type: 'select',
@@ -91,40 +110,44 @@
          label: '出入库类型',
          placeholder: '请选择',
          defaultValue: '',
          options: [{
            label:'全部',
            value:''
          },{
            label:'盘盈入库',
            value:'1'
          },{
            label:'盘亏出库',
            value:'2'
          }],
          options: [
            {
              label: '全部',
              value: '',
            },
            {
              label: '盘盈入库',
              value: '1',
            },
            {
              label: '盘亏出库',
              value: '2',
            },
          ],
        },
        {
          type: 'text',
          dataIndex: 'name',
          dataIndex: 'businessFormCode',
          label: '单号',
          placeholder: '请输入',
          defaultValue: '',
        },
        {
          type: 'text',
          dataIndex: 'name',
          dataIndex: 'operatorName',
          label: '操作人',
          placeholder: '请输入',
          defaultValue: '',
        },
        {
          type: 'date-picker',
          dataIndex: 'incomeTimeStart',
          dataIndex: 'startTime',
          label: '时间',
          defaultValue: '',
        },
        {
          type: 'date-picker',
          dataIndex: 'incomeTimeEnd',
          dataIndex: 'endTime',
          label: '至',
          defaultValue: '',
        },
@@ -132,12 +155,7 @@
      // 树数据
      treeDataList: [],
      // 搜索条件
      filterFrom: {
        tenantId: null,
        userName: null,
        userPhone: null,
        status: 1,
      },
      filterFrom: {},
      // 表格数据
      table: {
        showIndex: true, // 是否显示序号
@@ -158,18 +176,37 @@
        },
        // 列信息
        columns: [
          { title: '仓库', field: 'name', align: 'left' },
          { title: '物品名称', field: 'WAREHOUSE_NAME', 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: 'summary', align: 'left' },
          {title: '仓库', field: 'warehouseName', align: 'left', width: 140},
          {title: '物品名称', field: 'goodsTemplateName', align: 'left', minWidth: 130},
          {title: '规格型号', field: 'baseGoodsModelsName', align: 'left', width: 120},
          {title: '类型', field: 'inventoryResultType', align: 'center'},
          {title: '库存数量', field: 'initCounts', align: 'left'},
          {title: '盘点数量', field: 'inventoryCounts', align: 'left'},
          {title: '异常数量', field: 'errorCounts', align: 'left'},
          {
            title: '出入库类型',
            field: 'inventoryType',
            align: 'center',
            width: 100,
            formatter: (row) => {
              return {
                value: row.inventoryType,
                type: row.inventoryType && row.inventoryType.includes('盘盈') ? 'success' : 'danger'
              };
            },
          },
          {title: '出入库单号', field: 'warehouseFormCode', align: 'center', width: 130},
          {title: '机构', field: 'agencyName', align: 'left', width: 130},
          {title: '操作人', field: 'operatorName', align: 'center', width: 90},
          {
            title: '操作时间',
            field: 'operatorTime',
            align: 'center',
            width: 160,
            formatter: (row) => {
              return {value: row.operatorTime ? DateFormatter.LongToDateTime(row.operatorTime) : '-'};
            },
          },
        ],
        // 操作信息
        operation: {
@@ -195,34 +232,8 @@
    ...mapGetters(['userInfo']),
  },
  created() {
    this.initQuery();
  },
  methods: {
    initQuery() {
      selectTenantWarehouse({ agencyId: this.userInfo.tenantId }).then((res) => {
        this.items.forEach((v) => {
          if (v.label == '盘点仓库') {
            v.options = res.map((item) => {
              item.label = item.warehouseName;
              item.value = item.id;
              return item;
            });
          }
        });
      });
      goodsModel().then((res) => {
        this.items.forEach((v) => {
          if (v.label == '规格型号') {
            v.options = res.map((item) => {
              item.label = item.modelName;
              item.value = item.id;
              return item;
            });
          }
        });
      });
    },
    showAudit(row) {
      this.editSetting.id = row.id;
      this.editSetting.info = JSON.stringify(row);
@@ -232,7 +243,7 @@
    // 查询table列表
    search(pageNum) {
      if (pageNum != undefined) {
        this.$refs.myTable.search(pageNum);
        this.$refs.myTable.search({pageNum});
      } else {
        this.$refs.myTable.search();
      }