admin-web/src/views/departmentitem/itemdis/distribution/index.vue
@@ -11,6 +11,7 @@
            <!--列表-->
            <div class="table-tool-bar" style="margin-bottom: 15px">
              <my-button name="新增" @click="handleAdd" site="tools" size="medium"/>
              <my-button name="导入" @click="openImport()" site="tools" size="medium" />
            </div>
            <div :style="{ 'overflow-y': 'auto', height: `calc(100vh - 320px)` }" v-loading="loading">
              <el-row v-if="list.length" class="card" :gutter="5">
@@ -21,8 +22,21 @@
                        <div class="card-header-left">
                          <span>分发单号:</span>
                          <span class="value">{{ item.businessFormCode }}</span>
<!--                          <span style="padding-left: 30px">分发状态:</span>-->
<!--                          <span style="color: red" v-if="item.states === 0"  class="value">未分发</span>-->
<!--                          <span v-if="item.states === 2"  class="value">已分发</span>-->
                        </div>
                        <div class="card-header-right">
                          <!-- 导出单子 -->
<!--                          <el-button v-if="item.states === 0" name="下载" site="form" type="primary" size="mini" @click="handleDetail(item)">-->
<!--                            下载-->
<!--                          </el-button>-->
<!--                          <el-button v-if="item.states === 0" name="上传" site="form" type="primary" size="mini" @click="handleUploadPage(item)">-->
<!--                            上传-->
<!--                          </el-button>-->
                          <el-button name="查看详情" site="form" type="primary" size="mini" @click="handleDetail(item)">
                            查看详情
                          </el-button>
@@ -67,6 +81,16 @@
        </el-row>
      </el-card>
    </el-container>
    <!-- 上传分发单文件-->
    <uploadPage
      v-if="uploadPageSetting.show"
      :setting="uploadPageSetting"
      ref="uploadRef"
      @close="uploadPageSetting.show = false"
      @search="refreshData"
    ></uploadPage>
    <!--添加/编辑弹窗-->
    <edit
        v-if="editSetting.show"
@@ -81,6 +105,13 @@
        @close="detailSetting.show = false"
        ref="detailRef"
    ></detail>
    <my-import
      :import-setting="importSetting"
      :dialog-show="importSetting.dialogShow"
      :dialog-title="importSetting.dialogTitle"
    />
  </div>
</template>
@@ -91,18 +122,40 @@
import myImport from '@/views/components/myImport';
import edit from './edit';
import detail from './detail';
import uploadPage from './uploadPage';
import listPage from '@/views/mixins/listPage';
import {getUserDetail} from "@/utils/auth";
import {getBaseUrl} from '@/utils/base';
export default {
  name: 'index',
  mixins: [listPage],
  components: {MyButton, myImport, edit, detail},
  components: {MyButton, myImport, edit, detail,uploadPage},
  data() {
    return {
      loading: false,
      adddialog: false,
      list: [],
      // 导入
      importSetting: {
        dialogTitle: '导入',
        dialogShow: false,
        fileSettings: {
          data: {},
          uploadUrl: getBaseUrl() + '/pc/l/wh/form/transfer/import2', // 上传地址
          accept: '.xls', // 格式
          type: 'text', // 回显形式
          loading: true, // 导入效果
        },
        /* 模板下载 */
        templateSettings: {
          templateName: '导入模板.xls', // 名称
          templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate?type=distribute', // 下载地址
        },
        onSuccess: null,
      },
      // 搜索框
      items: [
        {
@@ -172,7 +225,6 @@
        qryType: 1,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        departmentId: this.userInfo.tenantId,
        outAgencyId: this.userInfo.tenantId,
        ...this.filterFrom,
      }).then((res) => {
@@ -180,7 +232,23 @@
        this.total = res.totalRows;
        this.loading = false;
      });
    }
    },
    openImport(){
      this.importOrg();
    },
    //导入
    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();
      };
    },
  },
};
</script>