index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <div class="page-container list-container">
  3. <!-- 功能按钮区 -->
  4. <div class="list-btns-container">
  5. <!-- <el-button
  6. type="primary"
  7. size="small"
  8. icon="Plus"
  9. @click="handleAdd"
  10. v-hasPermi="['business:company:add']"
  11. >新增</el-button>
  12. <el-button
  13. type="success"
  14. size="small"
  15. icon="Edit"
  16. :disabled="single"
  17. @click="handleUpdate"
  18. v-hasPermi="['business:company:edit']"
  19. >修改</el-button>
  20. <el-button
  21. type="danger"
  22. size="small"
  23. icon="Delete"
  24. :disabled="multiple"
  25. @click="handleDelete"
  26. v-hasPermi="['business:company:remove']"
  27. >删除</el-button>
  28. <el-button
  29. type="warning"
  30. size="small"
  31. icon="Download"
  32. @click="handleExport"
  33. v-hasPermi="['business:company:export']"
  34. >导出</el-button> -->
  35. <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
  36. </div>
  37. <!-- 搜索区 -->
  38. <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true">
  39. <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true">
  40. <el-form-item label="客户名称:" prop="name">
  41. <el-input v-model="queryParams.name" placeholder="请输入客户名称" clearable @keyup.enter="handleQuery" />
  42. </el-form-item>
  43. <el-form-item label="统一社会信用码:" prop="socialCreditCode">
  44. <el-input v-model="queryParams.socialCreditCode" placeholder="请输入统一社会信用码" clearable
  45. @keyup.enter="handleQuery" />
  46. </el-form-item>
  47. <el-form-item label="客户负责人:" prop="leaderName">
  48. <el-input v-model="queryParams.leaderName" placeholder="请输入客户负责人" clearable
  49. @keyup.enter="handleQuery" />
  50. </el-form-item>
  51. <el-form-item>
  52. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  53. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  54. </el-form-item>
  55. </el-form>
  56. </el-form>
  57. <!-- 列表区 -->
  58. <el-table v-loading="loading" :data="companyList" size="small" border height="100%"
  59. @selection-change="handleSelectionChange">
  60. <el-table-column type="selection" width="55" align="center" />
  61. <el-table-column label="序号" align="center" type="index" />
  62. <el-table-column label="客户名称" width="230" align="center" prop="name" />
  63. <el-table-column label="税号" width="180" align="center" prop="socialCreditCode" />
  64. <el-table-column label="注册省-市-区" width="180" align="center" prop="province">
  65. <template #default="scope">
  66. <span>{{ scope.row.province + '-' + scope.row.city + '-' + scope.row.district }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="年收入" align="center" prop="annualIncome" />
  70. <el-table-column label="纳税类型" align="center" prop="taxType" />
  71. <el-table-column label="是否零申报" width="100" align="center" prop="isZero">
  72. <template #default="scope">
  73. <span>{{ scope.row.isZero === 1 ? "是" : scope.row.isZero === 0 ? "否" : '' }}</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="客服" align="center" prop="adviserName" />
  77. <el-table-column label="负责人" align="center" prop="leaderName" />
  78. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  79. <template #default="scope">
  80. <el-button link type="warning" size="small" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['business:company:edit']">修改</el-button>
  81. <el-button link type="danger" size="small" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['business:company:remove']">删除</el-button>
  82. </template>
  83. </el-table-column> -->
  84. </el-table>
  85. <!-- 分页 -->
  86. <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
  87. v-model:limit="queryParams.pageSize" @pagination="getList" />
  88. <!-- 表单 -->
  89. <company-form ref="companyRef" :get-list="getList"></company-form>
  90. </div>
  91. </template>
  92. <script setup name="SimpleCompany">
  93. import { listCompany, delCompany } from "@/api/business/crm/company";
  94. import companyForm from "./form"
  95. const { proxy } = getCurrentInstance()
  96. /** 字典数组区 */
  97. /** 查询 对象 */
  98. const companyList = ref([]);
  99. const loading = ref(true);
  100. const ids = ref([])
  101. const single = ref(true);
  102. const multiple = ref(true);
  103. const total = ref(0);
  104. /** 查询对象 */
  105. const queryParams = ref({
  106. pageNum: 1,
  107. pageSize: 20,
  108. category: null,
  109. code: null,
  110. name: null,
  111. shortName: null,
  112. oldName: null,
  113. owner: null,
  114. phone: null,
  115. email: null,
  116. contactAddress: null,
  117. source: null,
  118. type: null,
  119. socialCreditCode: null,
  120. mainBusiness: null,
  121. legalRepresentative: null,
  122. foundationDate: null,
  123. licenceDate: null,
  124. businessStartDate: null,
  125. businessEndDate: null,
  126. isPermanentlyEffective: null,
  127. registerMoney: null,
  128. registerMoneyUnit: null,
  129. provinceCode: null,
  130. province: null,
  131. cityCode: null,
  132. city: null,
  133. districtCode: null,
  134. district: null,
  135. address: null,
  136. businessField: null,
  137. taxType: null,
  138. isZero: null,
  139. competentTaxAuthority: null,
  140. taxCollectorName: null,
  141. taxCollectorPhone: null,
  142. taxMonth: null,
  143. openingBank: null,
  144. bankAccount: null,
  145. annualIncome: null,
  146. governmentAccountNo: null,
  147. governmentPassword: null,
  148. socialSecurityAccountNo: null,
  149. socialSecurityPassword: null,
  150. employeePassword: null,
  151. housingFundPassword: null,
  152. housingFundUnitAccount: null,
  153. housingFundDeductionPassword: null,
  154. collectionMethod: null,
  155. quotaAmount: null,
  156. isPayOnWindow: null,
  157. isFirstSocialSecurity: null,
  158. isFirstHousingFund: null,
  159. leaderId: null,
  160. adviserId: null,
  161. leaderName: null,
  162. adviserName: null,
  163. })
  164. /*********************** 方法区 ****************************/
  165. onActivated(() => {
  166. // 你的逻辑
  167. getList();
  168. });
  169. /** 查询company列表 */
  170. function getList() {
  171. loading.value = true;
  172. listCompany(queryParams.value).then(response => {
  173. companyList.value = response.rows;
  174. total.value = response.total;
  175. loading.value = false;
  176. console.log(companyList.value)
  177. });
  178. }
  179. /** 搜索按钮操作 */
  180. function handleQuery() {
  181. queryParams.value.pageNum = 1;
  182. getList();
  183. }
  184. /** 重置按钮操作 */
  185. function resetQuery() {
  186. proxy.resetForm("queryRef");
  187. queryParams.value.name = "";
  188. queryParams.value.socialCreditCode = "";
  189. queryParams.value.leaderName = "";
  190. handleQuery();
  191. }
  192. // 多选框选中数据
  193. function handleSelectionChange(selection) {
  194. ids.value = selection.map(item => item.id);
  195. single.value = selection.length != 1;
  196. multiple.value = !selection.length;
  197. }
  198. /** 新增按钮操作 */
  199. function handleAdd() {
  200. proxy.$refs.companyRef.open()
  201. }
  202. /** 修改按钮操作 */
  203. function handleUpdate(row) {
  204. const id = row.id || ids.value
  205. proxy.$refs.companyRef.open(id)
  206. }
  207. /** 删除按钮操作 */
  208. function handleDelete(row) {
  209. const _ids = row.id || ids.value;
  210. proxy.$modal.confirm('是否确认删除选中的数据项?').then(function () {
  211. return delCompany(_ids);
  212. }).then(() => {
  213. getList();
  214. proxy.$modal.msgSuccess("删除成功!");
  215. }).catch(() => { });
  216. }
  217. /** 导出按钮操作 */
  218. function handleExport() {
  219. proxy.download('business/company/export', {
  220. ...queryParams.value
  221. }, `company_${new Date().getTime()}.xlsx`)
  222. }
  223. getList();
  224. </script>