index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. <template>
  2. <div id="">
  3. <search-box-new
  4. :remarkStatus="true"
  5. ref="searchBox"
  6. :formData="formData"
  7. :formList="formList"
  8. @search="search"
  9. @init="init"
  10. />
  11. <table-list
  12. ref="tableList"
  13. :tableSets="tableSet"
  14. :tableData="tableData"
  15. :navText="navText"
  16. :loading="loading"
  17. >
  18. <template slot="customize">
  19. <el-button type="warning" @click="XY(1, 1)">新增</el-button>
  20. </template>
  21. <template slot="1" slot-scope="props">
  22. <p>协议编号:{{ props.scope.row.covenantNum }}</p>
  23. <p>业务员:{{ props.scope.row.saleName || '--' }}</p>
  24. <p>业务号:{{ props.scope.row.saleNum || '--' }}</p>
  25. <p>
  26. 申请时间:{{ $methodsTools.onlyForma(props.scope.row.startTime) }}
  27. </p>
  28. <p>
  29. 协议时效:{{
  30. $methodsTools.onlyForma(props.scope.row.startTime, false) +
  31. " - " +
  32. $methodsTools.onlyForma(props.scope.row.endTime, false)
  33. }}
  34. </p>
  35. <p>协议状态:{{ getStatus(props.scope.row.status) }}</p></template
  36. >
  37. <template slot="2" slot-scope="props">
  38. <p>甲方:{{ props.scope.row.jiaCompanyName }}</p>
  39. <p>地址:{{ props.scope.row.jiaCompanyAddress }}</p>
  40. <p>联系人:{{ props.scope.row.jiaCompanyContract }}</p>
  41. <p>电话:{{ props.scope.row.jiaCompanyPhone }}</p></template
  42. >
  43. <template slot="3" slot-scope="props">
  44. <li
  45. v-for="(item, index) in relectArray(
  46. props.scope.row.bsCovenantBusinessVos
  47. )"
  48. :key="index"
  49. >
  50. {{ item }}
  51. </li></template
  52. ><template slot="4" slot-scope="props">
  53. <p>周期(月):{{ props.scope.row.settlementCycle }}</p>
  54. <p>金额:¥{{ props.scope.row.limitAmount | formatPrice }}</p></template
  55. ><template slot="5" slot-scope="props">
  56. <p>应付款:{{ $methodsTools.onlyForma(props.scope.row.createTime) }}</p>
  57. <p>已付款:{{ $methodsTools.onlyForma(props.scope.row.payTime) }}</p>
  58. <p>未付款:{{ $methodsTools.onlyForma() }}</p></template
  59. ><template slot="6" slot-scope="props">
  60. <p>正常{{ props.scope.row.cycleWarning }}</p>
  61. <p>预警</p></template
  62. ><template slot="7" slot-scope="props">
  63. <p>已开票:{{ props.scope.row.createTime }}</p>
  64. <p>待开票:{{ props.scope.row.createTime }}</p></template
  65. >
  66. <template slot="btn" slot-scope="props">
  67. <el-button type="text" @click="XY(3, 3, props.scope.row)"
  68. >协议详情</el-button
  69. >
  70. <el-button type="text">关联订单</el-button>
  71. <el-button
  72. type="text"
  73. :disabled="!props.scope.row.covenantImg"
  74. @click="sealAgre(props.scope.row.covenantImg)"
  75. >盖章协议</el-button
  76. >
  77. <el-button type="text"
  78. :disabled="
  79. !(
  80. props.scope.row.status === 5 &&
  81. (props.scope.row.stopStatus !== 1 ||
  82. props.scope.row.stopStatus !== 2 ||
  83. props.scope.row.stopStatus !== 4)
  84. )
  85. ">复制新增</el-button>
  86. <el-button
  87. type="text"
  88. :disabled="
  89. !(props.scope.row.status === 5 && props.scope.row.stopStatus === 0)
  90. "
  91. @click="Terminate(props.scope.row)"
  92. >终止申请</el-button
  93. >
  94. <el-button
  95. type="text"
  96. :disabled="props.scope.row.status !== 1"
  97. @click="cancelXY(props.scope.row)"
  98. >取消协议</el-button
  99. >
  100. <el-button
  101. type="text"
  102. :disabled="props.scope.row.status !== 4"
  103. @click="XY(2, 2, props.scope.row)"
  104. >修改重提</el-button
  105. >
  106. </template>
  107. </table-list>
  108. <pagination
  109. :total="total"
  110. :pageSize="formData.pageSize"
  111. :currentPage="formData.pageNum"
  112. @handleSizeChange="handleSizeChange"
  113. @handleCurrentChange="handleCurrentChange"
  114. />
  115. <agreeDialog ref="agreeDialog" @search="search(2)"></agreeDialog>
  116. <el-image
  117. style="display: none"
  118. :src="imgList[0]"
  119. :preview-src-list="imgList"
  120. ref="el_image"
  121. >
  122. </el-image>
  123. </div>
  124. </template>
  125. <script>
  126. import { formatPrice } from "@/directive/filter";
  127. import agreeDialog from "../components/agreeDialog";
  128. import searchBoxNew from "@/components/searchBoxNew";
  129. import tableList from "@/components/tableList";
  130. import pagination from "@/components/pagination";
  131. export default {
  132. name: "",
  133. components: {
  134. agreeDialog,
  135. searchBoxNew,
  136. tableList,
  137. pagination,
  138. },
  139. data() {
  140. return {
  141. loading: false, //当前表单加载是否加载动画
  142. navText: {
  143. title: "协议管理",
  144. index: 0,
  145. ch: "条",
  146. num: true,
  147. choice: false,
  148. addHide: true,
  149. openCheckMore: true,
  150. changeWidth: "160px",
  151. backFatherBtn: {
  152. status: false,
  153. title: "配置下单填选模板",
  154. },
  155. },
  156. //搜索
  157. formList: [
  158. {
  159. prop: "status",
  160. placeholder: "协议状态",
  161. scope: "select",
  162. noClear: false,
  163. options: [
  164. { label: "审核中", value: 1 },
  165. { label: "已通过", value: 2 },
  166. { label: "已取消", value: 3 },
  167. { label: "不通过", value: 4 },
  168. { label: "已生效", value: 5 },
  169. { label: "已过期", value: 6 },
  170. { label: "已终止", value: 7 },
  171. ],
  172. },
  173. {
  174. prop: "cycleWarning",
  175. placeholder: "结算预警",
  176. scope: "select",
  177. noClear: false,
  178. options: [
  179. { label: "正常", value: 1 },
  180. { label: "周期预警", value: 2 },
  181. { label: "金额预警", value: 3 },
  182. ],
  183. },
  184. {
  185. lable: "",
  186. prop: "searchKey",
  187. placeholder: "输入协议编号/甲方姓名/业务员/业务号",
  188. },
  189. ],
  190. formData: {
  191. pageSize: 10,
  192. pageNum: 1,
  193. },
  194. // 表单
  195. tableSet: [
  196. {
  197. label: "协议记录",
  198. hidden: true,
  199. scope: "slot",
  200. slotName: "1",
  201. dontCenter: true,
  202. },
  203. {
  204. label: "甲方信息",
  205. hidden: true,
  206. scope: "slot",
  207. slotName: "2",
  208. dontCenter: true,
  209. },
  210. {
  211. label: "协议项目(教育类型/业务层次/商品名称/单价/上限数量)",
  212. hidden: true,
  213. scope: "slot",
  214. slotName: "3",
  215. dontCenter: true,
  216. },
  217. {
  218. label: "结算信息",
  219. hidden: true,
  220. scope: "slot",
  221. slotName: "4",
  222. dontCenter: true,
  223. },
  224. {
  225. label: "账款信息",
  226. hidden: true,
  227. scope: "slot",
  228. slotName: "5",
  229. dontCenter: true,
  230. },
  231. {
  232. label: "结算预警",
  233. hidden: true,
  234. scope: "slot",
  235. slotName: "6",
  236. dontCenter: true,
  237. },
  238. {
  239. label: "发票状态",
  240. hidden: true,
  241. scope: "slot",
  242. slotName: "7",
  243. dontCenter: true,
  244. },
  245. {
  246. label: "审核意见",
  247. prop: "cwSn",
  248. hidden: true,
  249. },
  250. ],
  251. tableData: [], //表单数据
  252. total: 0, //一共多少条
  253. imgList: [
  254. "https://file-dev.xyyxt.net/oss/images/file/20230710/1688974188358.png",
  255. ],
  256. };
  257. },
  258. created() {
  259. this.search();
  260. },
  261. methods: {
  262. getStatus(i) {
  263. let str = "";
  264. switch (i) {
  265. case 1:
  266. str = "待审核";
  267. break;
  268. case 2:
  269. str = "已审核";
  270. break;
  271. case 3:
  272. str = "已取消";
  273. break;
  274. case 4:
  275. str = "不通过";
  276. break;
  277. case 5:
  278. str = "已生效";
  279. break;
  280. case 6:
  281. str = "已过期";
  282. break;
  283. case 7:
  284. str = "已终止";
  285. break;
  286. default:
  287. break;
  288. }
  289. return str;
  290. },
  291. //申请终止
  292. Terminate(row) {
  293. this.$confirm("确定申请终止吗?", "提示", {
  294. confirmButtonText: "确定",
  295. cancelButtonText: "取消",
  296. type: "warning",
  297. })
  298. .then(() => {
  299. this.$api
  300. .bsCovenantUpdateStopStatus({
  301. covenantId: row.covenantId,
  302. })
  303. .then((res) => {
  304. this.$message.success("操作成功");
  305. this.search();
  306. });
  307. })
  308. .catch(() => {});
  309. },
  310. //取消协议
  311. cancelXY(row) {
  312. this.$confirm("当前协议正在审核中,确定取消吗?", "提示", {
  313. confirmButtonText: "确定",
  314. cancelButtonText: "取消",
  315. type: "warning",
  316. })
  317. .then(() => {
  318. this.$api
  319. .bsCovenantCancelStatus({
  320. covenantId: row.covenantId,
  321. })
  322. .then((res) => {
  323. this.$message.success("操作成功");
  324. this.search();
  325. });
  326. })
  327. .catch(() => {});
  328. },
  329. sealAgre(imgStr) {
  330. if (!imgStr) return;
  331. let ary = imgStr.split(",");
  332. this.imgList = ary.map((i) => this.$methodsTools.splitImgHost(i)) || [];
  333. this.$refs.el_image.$el.children[0].click();
  334. },
  335. relectArray(array) {
  336. if (array && array.length > 0) {
  337. let ary = [];
  338. array.forEach((i) => {
  339. let a = i.bsCovenantGoodsVos.map((k) => {
  340. return `${i.educationTypeName}/${i.businessName + i.projectName}/${
  341. k.goodsName
  342. }/¥${formatPrice(k.covenantPrice)}/${
  343. k.limitStatus == 1 ? "不限" : k.limitNum
  344. }`;
  345. });
  346. ary.push(...a);
  347. });
  348. if (ary.length > 5) {
  349. ary = ary.splice(0, 5);
  350. ary.push("等5项");
  351. }
  352. return ary || [];
  353. } else {
  354. return [];
  355. }
  356. },
  357. XY(index, type, item = {}) {
  358. let data = JSON.parse(JSON.stringify(item));
  359. this.$refs.agreeDialog.openBoxs(index, type, data);
  360. },
  361. search(v) {
  362. this.loading = true;
  363. if (v === 2) {
  364. this.formData = {
  365. pageSize: 10,
  366. pageNum: 1,
  367. };
  368. }
  369. var data = JSON.parse(JSON.stringify(this.formData));
  370. this.$api
  371. .bsCovenantGetCovenantList(data)
  372. .then((res) => {
  373. this.tableData = res.rows;
  374. this.total = res.total;
  375. this.navText.index = res.total;
  376. })
  377. .finally(() => {
  378. this.loading = false;
  379. });
  380. },
  381. init() {
  382. this.search(2);
  383. },
  384. handleSizeChange(v) {
  385. this.formData.pageSize = v;
  386. this.formData.pageNum = 1;
  387. this.search();
  388. },
  389. handleCurrentChange(v) {
  390. this.formData.pageNum = v;
  391. this.search();
  392. },
  393. },
  394. };
  395. </script>
  396. <style lang="scss" scoped>
  397. </style>