liuguocan
2023-11-28 ed2117c738eedd3143d3b2ad6b0d40b2116afcf6
admin-web/src/views/departmentitem/itemdis/distribution/index.vue
@@ -10,8 +10,7 @@
          <el-col>
            <!--列表-->
            <div class="table-tool-bar" style="margin-bottom: 15px">
              <my-button name="物品分发" @click="handleAdd" site="tools" size="medium" icon="el-icon-edit-outline" />
              <my-button name="导入" @click="importSetting.dialogShow = true" site="tools" size="medium" />
              <my-button name="新增" @click="handleAdd" site="tools" size="medium" />
            </div>
            <div :style="{ 'overflow-y': 'auto', height: `${clientHeight - 320}px` }" v-loading="loading">
              <el-row v-if="list.length" class="card" :gutter="5">
@@ -24,9 +23,7 @@
                          <span class="value">{{ item.businessFormCode }}</span>
                        </div>
                        <div class="card-header-right">
                          <el-button name="查看详情" site="form" type="info" size="mini" @click="handleDetail(item)"
                            >查看详情</el-button
                          >
                          <el-button name="查看详情" site="form" type="primary" size="mini" @click="handleDetail(item)">查看详情</el-button>
                        </div>
                      </div>
                      <div class="one-hed">
@@ -82,11 +79,6 @@
      @close="detailSetting.show = false"
      ref="detailRef"
    ></detail>
    <my-import
      :import-setting="importSetting"
      :dialog-show="importSetting.dialogShow"
      :dialog-title="importSetting.dialogTitle"
    />
  </div>
</template>
@@ -98,7 +90,7 @@
import edit from './edit';
import detail from './detail';
import { getBaseUrl } from '@/utils/base';
import listPage from '../../../mixins/listPage'
import listPage from '../../../mixins/listPage';
export default {
  name: 'index',
@@ -120,18 +112,25 @@
        },
        {
          type: 'select',
          dataIndex: 'goodsTemplateId',
          label: '物品名称',
          placeholder: '请输入',
          defaultValue: '',
          options: [],
          optionsConfig: {
            label: 'goodsName',
            value: 'id',
            url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate',
          },
        },
        {
          type: 'cascader',
          dataIndex: 'agencyId',
          label: '分发部门',
          placeholder: '请选择',
          optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null },
          defaultValue: '',
          options: [],
        },
        {
          type: 'text',
          dataIndex: 'goodsTemplateName',
          label: '物品名称',
          placeholder: '可模糊搜索',
          defaultValue: '',
        },
        {
          type: 'text',
@@ -154,26 +153,11 @@
        },
      ],
      // 树数据
      treeDataList: [],
      // 导入
      importSetting: {
        dialogTitle: '导入',
        dialogShow: false,
        fileSettings: {
          data: {},
          uploadUrl: getBaseUrl() + '/pc/fin/sys/tenant/import', // 上传地址
          accept: '.xls', // 格式
          type: 'text', // 回显形式
          loading: false, // 导入效果
        },
        /* 模板下载 */
        templateSettings: {
          templateName: '导入模板.xls', // 名称
          templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate', // 下载地址
        },
        onSuccess: null,
      },
      treeDataList: []
    };
  },
  created(){
    this.fetchData()
  },
  methods: {
    fetchData() {
@@ -189,41 +173,6 @@
        console.log(this.list);
      });
    },
    //导入
    importOrg() {
      this.importSetting.dialogShow = true;
      this.importSetting.onSuccess = (response, callBack) => {
        if (response.code === 1) {
          this.$message.success(response.msg);
          this.search(1);
        } else {
          this.$message.warning(response.msg);
        }
        callBack();
      };
    },
    // 分发
    handleIncome(row) {
      this.$confirm(`您确定 单号:${row.businessFormCode}  分发吗?`, '分发分发').then(() => {
        procureIncome({ id: row.id })
          .then((res) => {
            this.$message.success('分发成功!');
            this.search();
          })
          .catch(() => {});
      });
    },
    del(row) {
      this.$modal.confirm('是否确认删除分发单号为"' + row.businessFormCode + '"的数据吗?').then( () => {
        procureDel({ id: row.id })
          .then((res) => {
            this.$message.success('删除成功!');
            this.search();
          })
          .catch(() => {});
      });
    },
    fifterForm(params) {
      this.filterFrom = Object.assign(this.filterFrom, params);
      if (this.filterFrom.incomeTimeStart) {
@@ -232,9 +181,6 @@
      if (this.filterFrom.incomeTimeEnd) {
        this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, '');
      }
      if (this.filterFrom.agencyId && this.filterFrom.agencyId.length) {
        this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1];
      }
      this.search(1);
    },
  },
@@ -242,5 +188,5 @@
</script>
<style scoped lang="scss">
@import url(../../../../styles/store.scss);
  //@import url(../../../../styles/index.scss);
</style>