|  | @@ -12,12 +12,13 @@
 | 
	
		
			
				|  |  |            class="newBand"
 | 
	
		
			
				|  |  |            @click="makeUrl"
 | 
	
		
			
				|  |  |            style="max-width: 150px; margin-right: 10px"
 | 
	
		
			
				|  |  | +          v-if="permission('replacementInstrumentCooperation/add')"
 | 
	
		
			
				|  |  |          >
 | 
	
		
			
				|  |  |            生成链接
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  | -        <div class="newBand" @click="onExport" style="max-width: 150px">
 | 
	
		
			
				|  |  | +        <!-- <div class="newBand" @click="onExport" style="max-width: 150px">
 | 
	
		
			
				|  |  |            导出
 | 
	
		
			
				|  |  | -        </div>
 | 
	
		
			
				|  |  | +        </div> -->
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |        <save-form
 | 
	
		
			
				|  |  |          :inline="true"
 | 
	
	
		
			
				|  | @@ -33,9 +34,9 @@
 | 
	
		
			
				|  |  |              placeholder="学校名称或编号"
 | 
	
		
			
				|  |  |            ></el-input>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  | -        <el-form-item prop="organIdList">
 | 
	
		
			
				|  |  | +        <el-form-item prop="organId">
 | 
	
		
			
				|  |  |            <el-select
 | 
	
		
			
				|  |  | -            v-model.trim="searchForm.organIdList"
 | 
	
		
			
				|  |  | +            v-model.trim="searchForm.organId"
 | 
	
		
			
				|  |  |              filterable
 | 
	
		
			
				|  |  |              clearable
 | 
	
		
			
				|  |  |              placeholder="请选择分部"
 | 
	
	
		
			
				|  | @@ -48,16 +49,16 @@
 | 
	
		
			
				|  |  |              ></el-option>
 | 
	
		
			
				|  |  |            </el-select>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  | -        <el-form-item prop="ispay">
 | 
	
		
			
				|  |  | +        <el-form-item prop="openPay">
 | 
	
		
			
				|  |  |            <el-select
 | 
	
		
			
				|  |  |              class="multiple"
 | 
	
		
			
				|  |  | -            v-model.trim="searchForm.ispay"
 | 
	
		
			
				|  |  | +            v-model.trim="searchForm.openPay"
 | 
	
		
			
				|  |  |              filterable
 | 
	
		
			
				|  |  |              clearable
 | 
	
		
			
				|  |  |              placeholder="是否开启缴费"
 | 
	
		
			
				|  |  |            >
 | 
	
		
			
				|  |  | -            <el-option label="是" value="true"></el-option>
 | 
	
		
			
				|  |  | -            <el-option label="否" value="false"></el-option>
 | 
	
		
			
				|  |  | +            <el-option label="是" value="YES"></el-option>
 | 
	
		
			
				|  |  | +            <el-option label="否" value="NO"></el-option>
 | 
	
		
			
				|  |  |            </el-select>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  |          <el-form-item>
 | 
	
	
		
			
				|  | @@ -73,43 +74,63 @@
 | 
	
		
			
				|  |  |          >
 | 
	
		
			
				|  |  |            <el-table-column
 | 
	
		
			
				|  |  |              align="center"
 | 
	
		
			
				|  |  | -            prop="studentId"
 | 
	
		
			
				|  |  | +            prop="organName"
 | 
	
		
			
				|  |  |              label="分部"
 | 
	
		
			
				|  |  |            ></el-table-column>
 | 
	
		
			
				|  |  |            <el-table-column
 | 
	
		
			
				|  |  |              align="center"
 | 
	
		
			
				|  |  | -            prop="studentId"
 | 
	
		
			
				|  |  | +            prop="cooperationOrganName"
 | 
	
		
			
				|  |  |              label="合作单位"
 | 
	
		
			
				|  |  | -          ></el-table-column>
 | 
	
		
			
				|  |  | +          >
 | 
	
		
			
				|  |  | +            <template slot-scope="scope">
 | 
	
		
			
				|  |  | +              <div>
 | 
	
		
			
				|  |  | +                {{ scope.row.cooperationOrganName }}
 | 
	
		
			
				|  |  | +                (<copy-text> {{ scope.row.cooperationOrganId }} </copy-text>)
 | 
	
		
			
				|  |  | +              </div>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  | +          </el-table-column>
 | 
	
		
			
				|  |  |            <el-table-column
 | 
	
		
			
				|  |  |              align="center"
 | 
	
		
			
				|  |  | -            prop="studentId"
 | 
	
		
			
				|  |  | +            prop="replaceNum"
 | 
	
		
			
				|  |  |              label="调查人数"
 | 
	
		
			
				|  |  |            ></el-table-column>
 | 
	
		
			
				|  |  |            <el-table-column
 | 
	
		
			
				|  |  |              align="center"
 | 
	
		
			
				|  |  | -            prop="studentId"
 | 
	
		
			
				|  |  | +            prop="activeNum"
 | 
	
		
			
				|  |  |              label="置换人数"
 | 
	
		
			
				|  |  |            ></el-table-column>
 | 
	
		
			
				|  |  | -          <el-table-column
 | 
	
		
			
				|  |  | -            align="center"
 | 
	
		
			
				|  |  | -            prop="studentId"
 | 
	
		
			
				|  |  | -            label="置换率"
 | 
	
		
			
				|  |  | -          ></el-table-column>
 | 
	
		
			
				|  |  | -          <el-table-column
 | 
	
		
			
				|  |  | -            align="center"
 | 
	
		
			
				|  |  | -            prop="studentId"
 | 
	
		
			
				|  |  | -            label="是否开启缴费"
 | 
	
		
			
				|  |  | -          ></el-table-column>
 | 
	
		
			
				|  |  | +          <el-table-column align="center" prop="replaceScale" label="置换率">
 | 
	
		
			
				|  |  | +            <template slot-scope="scope">
 | 
	
		
			
				|  |  | +              <div>{{ scope.row.replaceScale }}%</div>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  | +          </el-table-column>
 | 
	
		
			
				|  |  | +          <el-table-column align="center" prop="openPay" label="是否开启缴费">
 | 
	
		
			
				|  |  | +            <template slot-scope="scope">
 | 
	
		
			
				|  |  | +              <div>{{ scope.row.openPay ? "是" : "否" }}</div>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  | +          </el-table-column>
 | 
	
		
			
				|  |  |            <el-table-column align="center" prop="studentId" label="操作">
 | 
	
		
			
				|  |  |              <template slot-scope="scope">
 | 
	
		
			
				|  |  |                <div>
 | 
	
		
			
				|  |  | -                <el-button type="text" @click="lookDetail(scope.row)"
 | 
	
		
			
				|  |  | +                <!-- <el-button type="text" @click="lookDetail(scope.row)"
 | 
	
		
			
				|  |  |                    >详情</el-button
 | 
	
		
			
				|  |  | +                > -->
 | 
	
		
			
				|  |  | +                <el-button
 | 
	
		
			
				|  |  | +                  type="text"
 | 
	
		
			
				|  |  | +                  @click="onCreateQRCode(scope.row, '调查链接')"
 | 
	
		
			
				|  |  | +                  >调查链接</el-button
 | 
	
		
			
				|  |  | +                >
 | 
	
		
			
				|  |  | +                <el-button
 | 
	
		
			
				|  |  | +                  type="text"
 | 
	
		
			
				|  |  | +                  @click="onCreateQRCode(scope.row, '统计链接')"
 | 
	
		
			
				|  |  | +                  >统计链接</el-button
 | 
	
		
			
				|  |  | +                >
 | 
	
		
			
				|  |  | +                <el-button
 | 
	
		
			
				|  |  | +                  type="text"
 | 
	
		
			
				|  |  | +                  @click="openPay(scope.row)"
 | 
	
		
			
				|  |  | +                  v-if="!scope.row.openPay&&permission('replacementInstrumentCooperation/openPay')"
 | 
	
		
			
				|  |  | +                  >开启缴费</el-button
 | 
	
		
			
				|  |  |                  >
 | 
	
		
			
				|  |  | -                <el-button type="text" @click="onCreateQRCode(scope.row,'调查链接')">调查链接</el-button>
 | 
	
		
			
				|  |  | -                <el-button type="text"  @click="onCreateQRCode(scope.row,'统计链接')">统计链接</el-button>
 | 
	
		
			
				|  |  | -                <el-button type="text">开启缴费</el-button>
 | 
	
		
			
				|  |  |                </div>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  |            </el-table-column>
 | 
	
	
		
			
				|  | @@ -130,7 +151,7 @@
 | 
	
		
			
				|  |  |        width="500px"
 | 
	
		
			
				|  |  |        v-if="makeUrlVisible"
 | 
	
		
			
				|  |  |      >
 | 
	
		
			
				|  |  | -      <addUrl ref="addUrl" @close="close" />
 | 
	
		
			
				|  |  | +      <addUrl ref="addUrl" @close="close" @getList="getList" />
 | 
	
		
			
				|  |  |        <div slot="footer">
 | 
	
		
			
				|  |  |          <el-button @click="makeUrlVisible = false">取 消</el-button>
 | 
	
		
			
				|  |  |          <el-button type="primary" @click="addurl">生成链接</el-button>
 | 
	
	
		
			
				|  | @@ -154,7 +175,11 @@
 | 
	
		
			
				|  |  |        <div class="left-code">
 | 
	
		
			
				|  |  |          <!-- <h2>学员报名连接</h2> -->
 | 
	
		
			
				|  |  |          <div id="qrcode" class="qrcode code" ref="qrCodeUrl"></div>
 | 
	
		
			
				|  |  | -        <p class="code-url" v-if="codeUrl">{{ codeUrl }}</p>
 | 
	
		
			
				|  |  | +        <p class="code-url" v-if="codeUrl">
 | 
	
		
			
				|  |  | +          <copy-text>
 | 
	
		
			
				|  |  | +            {{ codeUrl }}
 | 
	
		
			
				|  |  | +          </copy-text>
 | 
	
		
			
				|  |  | +        </p>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |      </el-dialog>
 | 
	
		
			
				|  |  |    </div>
 | 
	
	
		
			
				|  | @@ -163,11 +188,13 @@
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  |  import axios from "axios";
 | 
	
		
			
				|  |  |  import { getToken } from "@/utils/auth";
 | 
	
		
			
				|  |  | -import { vaildStudentUrl } from "@/utils/validate";
 | 
	
		
			
				|  |  | +import { permission } from "@/utils/directivePage";
 | 
	
		
			
				|  |  | +import { vaildStudentUrl, vaildTeachingUrl } from "@/utils/validate";
 | 
	
		
			
				|  |  |  import pagination from "@/components/Pagination/index";
 | 
	
		
			
				|  |  |  import addUrl from "./modals/addUrl";
 | 
	
		
			
				|  |  |  import detail from "./modals/detail";
 | 
	
		
			
				|  |  |  import load from "@/utils/loading";
 | 
	
		
			
				|  |  | +import { getReplacementList, openPayReplacement } from "./api";
 | 
	
		
			
				|  |  |  import QRCode from "qrcodejs2";
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    components: { pagination, addUrl, detail },
 | 
	
	
		
			
				|  | @@ -175,11 +202,11 @@ export default {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  |        searchForm: {
 | 
	
		
			
				|  |  |          search: null,
 | 
	
		
			
				|  |  | -        organIdList: "",
 | 
	
		
			
				|  |  | -        ispay: "",
 | 
	
		
			
				|  |  | +        organId: "",
 | 
	
		
			
				|  |  | +        openPay: "",
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -      tableList: [{}],
 | 
	
		
			
				|  |  | +      tableList: [],
 | 
	
		
			
				|  |  |        rules: {
 | 
	
		
			
				|  |  |          // 分页规则
 | 
	
		
			
				|  |  |          limit: 10, // 限制显示条数
 | 
	
	
		
			
				|  | @@ -191,8 +218,8 @@ export default {
 | 
	
		
			
				|  |  |        detailVisible: false,
 | 
	
		
			
				|  |  |        codeUrl: "",
 | 
	
		
			
				|  |  |        qrcodes: true,
 | 
	
		
			
				|  |  | -      qrcodeStatus:false,
 | 
	
		
			
				|  |  | -      qrcodeName:'调查链接'
 | 
	
		
			
				|  |  | +      qrcodeStatus: false,
 | 
	
		
			
				|  |  | +      qrcodeName: "调查链接",
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    //生命周期 - 创建完成(可以访问当前this实例)
 | 
	
	
		
			
				|  | @@ -204,12 +231,26 @@ export default {
 | 
	
		
			
				|  |  |      this.init();
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | +    permission(str, parent) {
 | 
	
		
			
				|  |  | +      return permission(str, parent);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      init() {
 | 
	
		
			
				|  |  |        this.$store.dispatch("setBranchs");
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |        this.getList();
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    getList() {},
 | 
	
		
			
				|  |  | +    async getList() {
 | 
	
		
			
				|  |  | +      try {
 | 
	
		
			
				|  |  | +        const res = await getReplacementList({
 | 
	
		
			
				|  |  | +          ...this.searchForm,
 | 
	
		
			
				|  |  | +          page: this.rules.page,
 | 
	
		
			
				|  |  | +          rows: this.rules.limit,
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        this.rules.total = res.data.total;
 | 
	
		
			
				|  |  | +        this.tableList = res.data.rows;
 | 
	
		
			
				|  |  | +      } catch (e) {
 | 
	
		
			
				|  |  | +        console.log(e);
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      search() {
 | 
	
		
			
				|  |  |        this.rules.page = 1;
 | 
	
		
			
				|  |  |        this.getList();
 | 
	
	
		
			
				|  | @@ -229,14 +270,17 @@ export default {
 | 
	
		
			
				|  |  |      lookDetail(row) {
 | 
	
		
			
				|  |  |        this.detailVisible = true;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    onCreateQRCode(row,name) {
 | 
	
		
			
				|  |  | +    onCreateQRCode(row, name) {
 | 
	
		
			
				|  |  |        // 生成链接
 | 
	
		
			
				|  |  |        this.qrcodeName = name;
 | 
	
		
			
				|  |  |        this.qrcodeStatus = true;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        let id = this.$route.query.id;
 | 
	
		
			
				|  |  |        if (this.qrcodes) {
 | 
	
		
			
				|  |  |          this.qrcodes = false;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          setTimeout(() => {
 | 
	
		
			
				|  |  | +          document.getElementById("qrcode").innerHTML = "";
 | 
	
		
			
				|  |  |            this.qrcode = new QRCode("qrcode", {
 | 
	
		
			
				|  |  |              width: 260,
 | 
	
		
			
				|  |  |              height: 260,
 | 
	
	
		
			
				|  | @@ -244,13 +288,42 @@ export default {
 | 
	
		
			
				|  |  |              colorLight: "#ffffff",
 | 
	
		
			
				|  |  |              correctLevel: QRCode.CorrectLevel.H,
 | 
	
		
			
				|  |  |            });
 | 
	
		
			
				|  |  | +          let str;
 | 
	
		
			
				|  |  | +          if (name == "调查链接") {
 | 
	
		
			
				|  |  | +            str = vaildStudentUrl();
 | 
	
		
			
				|  |  | +          } else if (name == "统计链接") {
 | 
	
		
			
				|  |  | +            str = vaildTeachingUrl();
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +          console.log(str);
 | 
	
		
			
				|  |  | +          // vaildTeachingUrl
 | 
	
		
			
				|  |  |            this.qrcode.makeCode(
 | 
	
		
			
				|  |  | -            vaildStudentUrl() + "/#/login?musicGroupId=" + id
 | 
	
		
			
				|  |  | +            str +
 | 
	
		
			
				|  |  | +              `/#/questionnaireInfo?o=${row.organId}&c=${row.cooperationOrganId}`
 | 
	
		
			
				|  |  |            );
 | 
	
		
			
				|  |  | -          this.codeUrl = vaildStudentUrl() + "/#/login?musicGroupId=" + id;
 | 
	
		
			
				|  |  | +          this.codeUrl =
 | 
	
		
			
				|  |  | +            str +
 | 
	
		
			
				|  |  | +            `/#/questionnaireInfo?o=${row.organId}&c=${row.cooperationOrganId}`;
 | 
	
		
			
				|  |  | +          this.qrcodes = true;
 | 
	
		
			
				|  |  |          }, 500);
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    openPay(row) {
 | 
	
		
			
				|  |  | +      this.$confirm("确定开启缴费?", "提示", {
 | 
	
		
			
				|  |  | +        confirmButtonText: "确定",
 | 
	
		
			
				|  |  | +        cancelButtonText: "取消",
 | 
	
		
			
				|  |  | +        type: "warning",
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +        .then(async () => {
 | 
	
		
			
				|  |  | +          try {
 | 
	
		
			
				|  |  | +            const res = await openPayReplacement({ id: row.id });
 | 
	
		
			
				|  |  | +            this.$message.success("开启缴费成功");
 | 
	
		
			
				|  |  | +            this.getList();
 | 
	
		
			
				|  |  | +          } catch (e) {
 | 
	
		
			
				|  |  | +            console.log(e);
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +        .catch(() => {});
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  </script>
 |