haoyahui
2023-11-22 9834dbff448908d2008d8c52a2544aad00c099b1
admin-web/src/views/stock/inventorycount/exceptionDetails/index.vue
@@ -26,8 +26,9 @@
import * as finsystenant from '@/api/baseSetting/finsystenant';
import { getBaseUrl } from '@/utils/base';
import { mapGetters } from 'vuex';
import { selectTenantWarehouse,goodsModel } from '@/api/baseSetting/finsystenant';
import { selectTenantWarehouse, goodsModel } from '@/api/baseSetting/finsystenant';
import { getDicts } from '@/api/system/dict/data';
import * as DateFormatter from '@/utils/DateFormatter';
export default {
  name: 'index',
@@ -52,21 +53,38 @@
          placeholder: '请选择',
          defaultValue: '',
          options: [],
        },
        {
          type: 'text',
          dataIndex: 'goodsTemplateName',
          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 +92,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,20 +113,24 @@
          label: '出入库类型',
          placeholder: '请选择',
          defaultValue: '',
          options: [{
            label:'全部',
            value:''
          },{
            label:'盘盈入库',
            value:'1'
          },{
            label:'盘亏出库',
            value:'2'
          }],
          options: [
            {
              label: '全部',
              value: '',
            },
            {
              label: '盘盈入库',
              value: '1',
            },
            {
              label: '盘亏出库',
              value: '2',
            },
          ],
        },
        {
          type: 'text',
          dataIndex: 'baseGoodsModelsId',
          dataIndex: 'businessFormCode',
          label: '单号',
          placeholder: '请输入',
          defaultValue: '',
@@ -133,10 +159,6 @@
      treeDataList: [],
      // 搜索条件
      filterFrom: {
        tenantId: null,
        userName: null,
        userPhone: null,
        status: 1,
      },
      // 表格数据
      table: {
@@ -158,18 +180,32 @@
        },
        // 列信息
        columns: [
          { title: '仓库', field: 'warehouseFormCode', align: 'left' },
          { title: '仓库', field: 'warehouseName', align: 'left' },
          { title: '物品名称', field: 'goodsTemplateName', 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: 'baseGoodsModelsName', align: 'center' },
          { title: '类型', field: 'inventoryResultType', align: 'center' },
          { title: '库存数量', field: 'initCounts', align: 'left' },
          { title: '盘点数量', field: 'inventoryCounts', align: 'left' },
          { title: '异常数量', field: 'errorCounts', align: 'left' },
          {
            title: '出入库类型',
            field: 'inventoryType',
            align: 'left',
            formatter: (row) => {
              return { value: row.inventoryType, type: row.inventoryType && row.inventoryType.includes('盘盈') ? 'success' : 'danger' };
            },
          },
          { title: '出入库单号', field: 'warehouseFormCode', align: 'left' },
          { title: '机构', field: 'agencyName', align: 'left' },
          { title: '操作人', field: 'operatorName', align: 'left' },
          { title: '操作时间', field: 'summary', align: 'left' },
          {
            title: '操作时间',
            field: 'operatorTime',
            align: 'center',
            formatter: (row) => {
              return { value: row.operatorTime ? DateFormatter.LongToDateTime(row.operatorTime) : '-' };
            },
          },
        ],
        // 操作信息
        operation: {
@@ -194,35 +230,8 @@
  computed: {
    ...mapGetters(['userInfo']),
  },
  created() {
    this.initQuery();
  },
  created() {},
  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);