| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402 |
- <template>
- <div id="">
- <search-box-new
- :remarkStatus="true"
- ref="searchBox"
- :formData="formData"
- :formList="formList"
- @search="search"
- @init="init"
- />
- <table-list
- ref="tableList"
- :tableSets="tableSet"
- :tableData="tableData"
- :navText="navText"
- :loading="loading"
- >
- <template slot="customize">
- <el-button type="warning" @click="XY(1, 1)">新增</el-button>
- </template>
- <template slot="1" slot-scope="props">
- <p>协议编号:{{ props.scope.row.covenantNum }}</p>
- <p>业务员:{{ props.scope.row.saleName || '--' }}</p>
- <p>业务号:{{ props.scope.row.saleNum || '--' }}</p>
- <p>
- 申请时间:{{ $methodsTools.onlyForma(props.scope.row.startTime) }}
- </p>
- <p>
- 协议时效:{{
- $methodsTools.onlyForma(props.scope.row.startTime, false) +
- " - " +
- $methodsTools.onlyForma(props.scope.row.endTime, false)
- }}
- </p>
- <p>协议状态:{{ getStatus(props.scope.row.status) }}</p></template
- >
- <template slot="2" slot-scope="props">
- <p>甲方:{{ props.scope.row.jiaCompanyName }}</p>
- <p>地址:{{ props.scope.row.jiaCompanyAddress }}</p>
- <p>联系人:{{ props.scope.row.jiaCompanyContract }}</p>
- <p>电话:{{ props.scope.row.jiaCompanyPhone }}</p></template
- >
- <template slot="3" slot-scope="props">
- <li
- v-for="(item, index) in relectArray(
- props.scope.row.bsCovenantBusinessVos
- )"
- :key="index"
- >
- {{ item }}
- </li></template
- ><template slot="4" slot-scope="props">
- <p>周期(月):{{ props.scope.row.settlementCycle }}</p>
- <p>金额:¥{{ props.scope.row.limitAmount | formatPrice }}</p></template
- ><template slot="5" slot-scope="props">
- <p>应付款:{{ $methodsTools.onlyForma(props.scope.row.createTime) }}</p>
- <p>已付款:{{ $methodsTools.onlyForma(props.scope.row.payTime) }}</p>
- <p>未付款:{{ $methodsTools.onlyForma() }}</p></template
- ><template slot="6" slot-scope="props">
- <p>正常{{ props.scope.row.cycleWarning }}</p>
- <p>预警</p></template
- ><template slot="7" slot-scope="props">
- <p>已开票:{{ props.scope.row.createTime }}</p>
- <p>待开票:{{ props.scope.row.createTime }}</p></template
- >
- <template slot="btn" slot-scope="props">
- <el-button type="text" @click="XY(3, 3, props.scope.row)"
- >协议详情</el-button
- >
- <el-button type="text">关联订单</el-button>
- <el-button
- type="text"
- :disabled="!props.scope.row.covenantImg"
- @click="sealAgre(props.scope.row.covenantImg)"
- >盖章协议</el-button
- >
- <el-button type="text"
- :disabled="
- !(
- props.scope.row.status === 5 &&
- (props.scope.row.stopStatus !== 1 ||
- props.scope.row.stopStatus !== 2 ||
- props.scope.row.stopStatus !== 4)
- )
- ">复制新增</el-button>
- <el-button
- type="text"
- :disabled="
- !(props.scope.row.status === 5 && props.scope.row.stopStatus === 0)
- "
- @click="Terminate(props.scope.row)"
- >终止申请</el-button
- >
- <el-button
- type="text"
- :disabled="props.scope.row.status !== 1"
- @click="cancelXY(props.scope.row)"
- >取消协议</el-button
- >
- <el-button
- type="text"
- :disabled="props.scope.row.status !== 4"
- @click="XY(2, 2, props.scope.row)"
- >修改重提</el-button
- >
- </template>
- </table-list>
- <pagination
- :total="total"
- :pageSize="formData.pageSize"
- :currentPage="formData.pageNum"
- @handleSizeChange="handleSizeChange"
- @handleCurrentChange="handleCurrentChange"
- />
- <agreeDialog ref="agreeDialog" @search="search(2)"></agreeDialog>
- <el-image
- style="display: none"
- :src="imgList[0]"
- :preview-src-list="imgList"
- ref="el_image"
- >
- </el-image>
- </div>
- </template>
-
- <script>
- import { formatPrice } from "@/directive/filter";
- import agreeDialog from "../components/agreeDialog";
- import searchBoxNew from "@/components/searchBoxNew";
- import tableList from "@/components/tableList";
- import pagination from "@/components/pagination";
- export default {
- name: "",
- components: {
- agreeDialog,
- searchBoxNew,
- tableList,
- pagination,
- },
- data() {
- return {
- loading: false, //当前表单加载是否加载动画
- navText: {
- title: "协议管理",
- index: 0,
- ch: "条",
- num: true,
- choice: false,
- addHide: true,
- openCheckMore: true,
- changeWidth: "160px",
- backFatherBtn: {
- status: false,
- title: "配置下单填选模板",
- },
- },
- //搜索
- formList: [
- {
- prop: "status",
- placeholder: "协议状态",
- scope: "select",
- noClear: false,
- options: [
- { label: "审核中", value: 1 },
- { label: "已通过", value: 2 },
- { label: "已取消", value: 3 },
- { label: "不通过", value: 4 },
- { label: "已生效", value: 5 },
- { label: "已过期", value: 6 },
- { label: "已终止", value: 7 },
- ],
- },
- {
- prop: "cycleWarning",
- placeholder: "结算预警",
- scope: "select",
- noClear: false,
- options: [
- { label: "正常", value: 1 },
- { label: "周期预警", value: 2 },
- { label: "金额预警", value: 3 },
- ],
- },
- {
- lable: "",
- prop: "searchKey",
- placeholder: "输入协议编号/甲方姓名/业务员/业务号",
- },
- ],
- formData: {
- pageSize: 10,
- pageNum: 1,
- },
- // 表单
- tableSet: [
- {
- label: "协议记录",
- hidden: true,
- scope: "slot",
- slotName: "1",
- dontCenter: true,
- },
- {
- label: "甲方信息",
- hidden: true,
- scope: "slot",
- slotName: "2",
- dontCenter: true,
- },
- {
- label: "协议项目(教育类型/业务层次/商品名称/单价/上限数量)",
- hidden: true,
- scope: "slot",
- slotName: "3",
- dontCenter: true,
- },
- {
- label: "结算信息",
- hidden: true,
- scope: "slot",
- slotName: "4",
- dontCenter: true,
- },
- {
- label: "账款信息",
- hidden: true,
- scope: "slot",
- slotName: "5",
- dontCenter: true,
- },
- {
- label: "结算预警",
- hidden: true,
- scope: "slot",
- slotName: "6",
- dontCenter: true,
- },
- {
- label: "发票状态",
- hidden: true,
- scope: "slot",
- slotName: "7",
- dontCenter: true,
- },
- {
- label: "审核意见",
- prop: "cwSn",
- hidden: true,
- },
- ],
- tableData: [], //表单数据
- total: 0, //一共多少条
- imgList: [
- "https://file-dev.xyyxt.net/oss/images/file/20230710/1688974188358.png",
- ],
- };
- },
- created() {
- this.search();
- },
- methods: {
- getStatus(i) {
- let str = "";
- switch (i) {
- case 1:
- str = "待审核";
- break;
- case 2:
- str = "已审核";
- break;
- case 3:
- str = "已取消";
- break;
- case 4:
- str = "不通过";
- break;
- case 5:
- str = "已生效";
- break;
- case 6:
- str = "已过期";
- break;
- case 7:
- str = "已终止";
- break;
- default:
- break;
- }
- return str;
- },
- //申请终止
- Terminate(row) {
- this.$confirm("确定申请终止吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- this.$api
- .bsCovenantUpdateStopStatus({
- covenantId: row.covenantId,
- })
- .then((res) => {
- this.$message.success("操作成功");
- this.search();
- });
- })
- .catch(() => {});
- },
- //取消协议
- cancelXY(row) {
- this.$confirm("当前协议正在审核中,确定取消吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- this.$api
- .bsCovenantCancelStatus({
- covenantId: row.covenantId,
- })
- .then((res) => {
- this.$message.success("操作成功");
- this.search();
- });
- })
- .catch(() => {});
- },
- sealAgre(imgStr) {
- if (!imgStr) return;
- let ary = imgStr.split(",");
- this.imgList = ary.map((i) => this.$methodsTools.splitImgHost(i)) || [];
- this.$refs.el_image.$el.children[0].click();
- },
- relectArray(array) {
- if (array && array.length > 0) {
- let ary = [];
- array.forEach((i) => {
- let a = i.bsCovenantGoodsVos.map((k) => {
- return `${i.educationTypeName}/${i.businessName + i.projectName}/${
- k.goodsName
- }/¥${formatPrice(k.covenantPrice)}/${
- k.limitStatus == 1 ? "不限" : k.limitNum
- }`;
- });
- ary.push(...a);
- });
- if (ary.length > 5) {
- ary = ary.splice(0, 5);
- ary.push("等5项");
- }
- return ary || [];
- } else {
- return [];
- }
- },
- XY(index, type, item = {}) {
- let data = JSON.parse(JSON.stringify(item));
- this.$refs.agreeDialog.openBoxs(index, type, data);
- },
- search(v) {
- this.loading = true;
- if (v === 2) {
- this.formData = {
- pageSize: 10,
- pageNum: 1,
- };
- }
- var data = JSON.parse(JSON.stringify(this.formData));
- this.$api
- .bsCovenantGetCovenantList(data)
- .then((res) => {
- this.tableData = res.rows;
- this.total = res.total;
- this.navText.index = res.total;
- })
- .finally(() => {
- this.loading = false;
- });
- },
- init() {
- this.search(2);
- },
- handleSizeChange(v) {
- this.formData.pageSize = v;
- this.formData.pageNum = 1;
- this.search();
- },
- handleCurrentChange(v) {
- this.formData.pageNum = v;
- this.search();
- },
- },
- };
- </script>
-
- <style lang="scss" scoped>
- </style>
-
|