index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <div id="mechanism">
  3. <search-box-new
  4. ref="searchBox"
  5. :formData="formData"
  6. :formList="formList"
  7. @search="search"
  8. @init="init"
  9. />
  10. <table-list
  11. rowKey="tenantId"
  12. ref="tableList"
  13. :tableSets="tableSet"
  14. :tableData="tableData"
  15. :navText="navText"
  16. :loading="loading"
  17. @addClick="addClick"
  18. >
  19. <template slot="customize">
  20. <el-button type="warning" @click="remove" v-if="false"> 批量删除 </el-button>
  21. <el-button type="warning" @click="excelPort" v-if="false"> Excel导出 </el-button>
  22. </template>
  23. <template slot="status" slot-scope="props">
  24. <el-popover placement="right" width="650" trigger="click">
  25. <el-table border :data="props.scope.row.accountList">
  26. <el-table-column
  27. type="index"
  28. label="序号"
  29. width="70"
  30. align="center"
  31. header-align="center"
  32. >
  33. </el-table-column>
  34. <el-table-column
  35. width="120"
  36. property="openingBank"
  37. label="开户银行"
  38. align="center"
  39. ></el-table-column>
  40. <el-table-column
  41. width="180"
  42. property="openingName"
  43. label="开户名称"
  44. align="center"
  45. ></el-table-column>
  46. <el-table-column
  47. property="proceedsAccount"
  48. label="收款账号"
  49. align="center"
  50. ></el-table-column>
  51. </el-table>
  52. <el-button
  53. slot="reference"
  54. type="text"
  55. :disabled="
  56. !props.scope.row.accountList ||
  57. props.scope.row.accountList.length === 0
  58. "
  59. >查看</el-button
  60. >
  61. </el-popover>
  62. </template>
  63. <template slot="domainName" slot-scope="props">
  64. <p>移动端:{{ props.scope.row.hostH5 }}</p>
  65. <p>电脑端:{{ props.scope.row.hostPc }}</p>
  66. </template>
  67. <template slot="accountPeriodSetting" slot-scope="props">
  68. <p>
  69. {{ getBillType(props.scope.row.billType) }},次月{{
  70. props.scope.row.billDay || " "
  71. }}日
  72. </p>
  73. </template>
  74. <template slot="invoiceInformation" slot-scope="props">
  75. <p>
  76. 发票类型:<span v-if="props.scope.row.invoiceBo !== null">
  77. {{
  78. props.scope.row.invoiceBo["invoiceType"] === 1
  79. ? "普票"
  80. : props.scope.row.invoiceBo["invoiceType"] === 2
  81. ? "专票"
  82. : ""
  83. }}</span
  84. >
  85. </p>
  86. <p>
  87. 发票抬头:<span v-if="props.scope.row.invoiceBo !== null">{{
  88. props.scope.row.invoiceBo["invoice"]
  89. }}</span>
  90. </p>
  91. <p>企业名称:{{ props.scope.row.tenantName }}</p>
  92. <p>
  93. 纳税人:<span v-if="props.scope.row.invoiceBo !== null">{{
  94. props.scope.row.invoiceBo["taxpayer"]
  95. }}</span>
  96. </p>
  97. </template>
  98. <template slot="btn" slot-scope="props">
  99. <el-button type="text" @click="addClick(props.scope.row)"
  100. >修改</el-button
  101. ><el-button v-if="false" type="text" @click="del(props.scope.row)">删除</el-button>
  102. </template>
  103. </table-list>
  104. <pagination
  105. :total="total"
  106. :pageSize.sync="formData.pageSize"
  107. :currentPage.sync="formData.pageNum"
  108. @search="search"
  109. />
  110. <dislog
  111. :dialogVisible.sync="dialogVisible"
  112. @search="search"
  113. :activeData="activeData"
  114. ></dislog>
  115. </div>
  116. </template>
  117. <script>
  118. import dislog from "./dislog.vue";
  119. import searchBoxNew from "@/components/searchBoxNew";
  120. import tableList from "@/components/tableList";
  121. import pagination from "@/components/pagination";
  122. export default {
  123. name: "Mechanism",
  124. components: { searchBoxNew, tableList, pagination, dislog },
  125. data() {
  126. return {
  127. loading: false,
  128. navText: {
  129. title: "机构列表",
  130. index: 0,
  131. ch: "条",
  132. num: true,
  133. choice: true,
  134. addHide: false,
  135. custom: false,
  136. openCheckMore: true,
  137. },
  138. formList: [
  139. {
  140. prop: "tenantid",
  141. placeholder: "请选择机构名称",
  142. scope: "systemtenantlist",
  143. },
  144. ],
  145. formData: {},
  146. tableSet: [
  147. {
  148. label: "机构名称",
  149. prop: "tenantName",
  150. hidden: true,
  151. },
  152. {
  153. label: "网站域名",
  154. prop: "address",
  155. hidden: true,
  156. scope: "slot",
  157. slotName: "domainName",
  158. },
  159. {
  160. label: "账期设置",
  161. prop: "address",
  162. hidden: true,
  163. scope: "slot",
  164. slotName: "accountPeriodSetting",
  165. },
  166. {
  167. label: "教务电话",
  168. prop: "eduPhone",
  169. hidden: true,
  170. },
  171. {
  172. label: "是否有商户号",
  173. prop: "commercialTenant",
  174. hidden: false,
  175. scope: "isOptions",
  176. options: [
  177. {
  178. label: "是",
  179. value: 1,
  180. },
  181. {
  182. label: "否",
  183. value: 0,
  184. },
  185. ],
  186. },
  187. {
  188. label: "银行账号信息",
  189. prop: "accountList",
  190. hidden: true,
  191. scope: "slot",
  192. slotName: "status",
  193. },
  194. {
  195. label: "发票信息",
  196. prop: "address",
  197. hidden: true,
  198. scope: "slot",
  199. slotName: "invoiceInformation",
  200. },
  201. ],
  202. tableData: [],
  203. total: 0,
  204. dialogVisible: false,
  205. activeData: {},
  206. };
  207. },
  208. created() {
  209. this.search(2);
  210. },
  211. methods: {
  212. getBillType(e) {
  213. var a = "";
  214. switch (e) {
  215. case 1:
  216. a = "月份";
  217. break;
  218. case 2:
  219. a = "季度";
  220. break;
  221. case 3:
  222. a = "半年";
  223. break;
  224. case 4:
  225. a = "年度";
  226. break;
  227. default:
  228. break;
  229. }
  230. return a;
  231. },
  232. addClick(data) {
  233. this.activeData = data || {};
  234. this.dialogVisible = true;
  235. },
  236. search(v) {
  237. this.loading = true;
  238. if (v === 2) {
  239. this.formData = {
  240. pageSize: 10,
  241. pageNum: 1,
  242. };
  243. this.$nextTick(() => {
  244. this.$refs.tableList.clearMoreActive();
  245. });
  246. }
  247. if (v === 3) {
  248. this.$nextTick(() => {
  249. this.$refs.tableList.clearMoreActive();
  250. });
  251. }
  252. this.$api
  253. .systemtenantlist(this.formData)
  254. .then((res) => {
  255. this.tableData = res.rows;
  256. this.total = res.total;
  257. this.navText.index = res.total;
  258. })
  259. .finally(() => {
  260. this.loading = false;
  261. });
  262. },
  263. init() {
  264. this.search(2);
  265. },
  266. del(v) {
  267. this.$confirm("确定删除此内容?", "提示", {
  268. confirmButtonText: "确定",
  269. cancelButtonText: "取消",
  270. type: "warning",
  271. })
  272. .then(() => {
  273. this.$api
  274. .systemtenantdeletetop({ tenantIds: [v.tenantId] })
  275. .then((res) => {
  276. this.$message.success("删除成功");
  277. this.$store.commit("TENANTLIST");
  278. this.search(3);
  279. });
  280. })
  281. .catch(() => {});
  282. },
  283. excelPort(){
  284. if (this.$refs.tableList.allCheckData.length === 0) {
  285. this.$message.warning("请勾选数据");
  286. return;
  287. }
  288. },
  289. remove() {
  290. if (this.$refs.tableList.allCheckData.length === 0) {
  291. this.$message.warning("请勾选数据");
  292. return;
  293. }
  294. this.$confirm("确定批量删除选中的数据吗?", "提示", {
  295. confirmButtonText: "确定",
  296. cancelButtonText: "取消",
  297. type: "warning",
  298. })
  299. .then(() => {
  300. this.$api
  301. .systemtenantdeletetop({
  302. tenantIds: this.$refs.tableList.allCheckData.map(
  303. (i) => i.tenantId
  304. ),
  305. })
  306. .then(() => {
  307. this.$message.success("批量删除成功");
  308. this.$store.commit("TENANTLIST");
  309. this.search(3);
  310. });
  311. })
  312. .catch(() => {});
  313. },
  314. },
  315. };
  316. </script>
  317. <style lang="scss" scoped></style>