index.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <div class="page-container list-container">
  3. <!-- 功能按钮区 -->
  4. <div class="list-btns-container">
  5. <el-button type="primary" size="small" icon="Plus" @click="handleAdd"
  6. v-hasPermi="['business:examine:add']">新增</el-button>
  7. <el-button type="success" size="small" icon="Edit" :disabled="single" @click="handleUpdate"
  8. v-hasPermi="['business:examine:edit']">修改</el-button>
  9. <el-button type="danger" size="small" icon="Delete" :disabled="multiple" @click="handleDelete"
  10. v-hasPermi="['business:examine:remove']">删除</el-button>
  11. <el-button type="warning" size="small" icon="Download" @click="handleExport"
  12. v-hasPermi="['business:examine:export']">导出</el-button>
  13. <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
  14. </div>
  15. <!-- 搜索区 -->
  16. <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
  17. label-width="68px">
  18. <el-form-item label="所属期:" prop="currentPeriod">
  19. <el-input v-model="queryParams.currentPeriod" placeholder="请输入所属期" clearable
  20. @keyup.enter="handleQuery" />
  21. </el-form-item>
  22. <el-form-item label="委托来源:" prop="entrustCome">
  23. <el-input v-model="queryParams.entrustCome" placeholder="请输入委托来源" clearable
  24. @keyup.enter="handleQuery" />
  25. </el-form-item>
  26. <el-form-item label="取消理由:" prop="cancelReason">
  27. <el-input v-model="queryParams.cancelReason" placeholder="请输入取消理由" clearable
  28. @keyup.enter="handleQuery" />
  29. </el-form-item>
  30. <el-form-item>
  31. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  32. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  33. </el-form-item>
  34. </el-form>
  35. <!-- 列表区 -->
  36. <el-table v-loading="loading" :data="examineList" size="small" border height="100%"
  37. @selection-change="handleSelectionChange">
  38. <el-table-column type="selection" width="55" align="center" />
  39. <el-table-column label="客户名称" align="center" prop="companyName" />
  40. <el-table-column label="税号" align="center" prop="socialCreditCode" />
  41. <el-table-column label="项目" align="center" prop="taskName" />
  42. <el-table-column label="所属期" align="center" prop="currentPeriod">
  43. <template #default="scope">
  44. {{ scope.row.currentPeriod.substr(0, 7) }}
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="提交时间" align="center" prop="createTime" />
  48. <el-table-column label="委托来源" align="center" prop="fromTenant" />
  49. <el-table-column label="取消理由" align="center" prop="cancelReason" />
  50. <el-table-column label="状态" align="center" prop="status">
  51. <template #default="scope">
  52. <div v-if="scope.row.status === 0" type="danger">待确认</div>
  53. <div v-else-if="scope.row.status === 1" type="success">已同意</div>
  54. <div v-else type="info">已拒绝</div>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  58. <template #default="scope">
  59. <el-button link type="warning" size="small" icon="Edit" @click="handleUpdate(scope.row)"
  60. v-hasPermi="['business:examine:edit']">同意</el-button>
  61. <el-button link type="danger" size="small" icon="Delete" @click="handleDelete(scope.row)"
  62. v-hasPermi="['business:examine:remove']">拒绝</el-button>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. <!-- 分页 -->
  67. <pagination v-show="total>0" :total="total" v-model:page="queryParams.pageNum"
  68. v-model:limit="queryParams.pageSize" @pagination="getList" />
  69. <!-- 表单 -->
  70. <examine-form ref="examineRef" :get-list="getList"></examine-form>
  71. <el-dialog title="拒绝取消" v-model="cancelEntrust" width="720px" append-to-body size="small" draggable
  72. :close-on-click-modal="false">
  73. <el-form-item label="拒绝理由" prop="refuseReason" style="margin-top: 10px">
  74. <el-input v-model="form.refuseReason" type="textarea" placeholder="请输入取消理由" />
  75. </el-form-item>
  76. <template #footer>
  77. <div class="dialog-footer">
  78. <el-button type="primary" icon="Finished" size="small" @click="submitForm">确 定</el-button>
  79. <el-button icon="close" size="small" @click="cancelEntrust = false">取 消</el-button>
  80. </div>
  81. </template>
  82. </el-dialog>
  83. </div>
  84. </template>
  85. <script setup name="Examine">
  86. import { listExamine, delExamine, refuse } from "@/api/business/examine";
  87. import {
  88. okDelEntrust,
  89. } from "@/api/business/entrust/currentWorkOrder";
  90. const { proxy } = getCurrentInstance()
  91. /** 字典数组区 */
  92. /** 查询 对象 */
  93. const examineList = ref([]);
  94. const loading = ref(true);
  95. const ids = ref([])
  96. const single = ref(true);
  97. const cancelEntrust = ref(false);
  98. const multiple = ref(true);
  99. const total = ref(0);
  100. /** 查询对象 */
  101. const queryParams = ref({
  102. pageNum: 1,
  103. pageSize: 10,
  104. currentPeriod: null,
  105. entrustCome: null,
  106. cancelReason: null,
  107. status: null,
  108. })
  109. const form = ref({});
  110. /*********************** 方法区 ****************************/
  111. /** 查询企业租户列表 */
  112. function getList() {
  113. loading.value = true;
  114. listExamine(queryParams.value).then(response => {
  115. examineList.value = response.rows;
  116. total.value = response.total;
  117. loading.value = false;
  118. });
  119. }
  120. /** 搜索按钮操作 */
  121. function handleQuery() {
  122. queryParams.value.pageNum = 1;
  123. getList();
  124. }
  125. /** 重置按钮操作 */
  126. function resetQuery() {
  127. proxy.resetForm("queryRef");
  128. handleQuery();
  129. }
  130. // 多选框选中数据
  131. function handleSelectionChange(selection) {
  132. ids.value = selection.map(item => item.id);
  133. single.value = selection.length != 1;
  134. multiple.value = !selection.length;
  135. }
  136. /** 新增按钮操作 */
  137. function handleAdd() {
  138. proxy.$refs.examineRef.open()
  139. }
  140. /** 修改按钮操作 */
  141. function handleUpdate(row) {
  142. proxy.$modal
  143. .confirm("确定同意么?")
  144. .then((_) => {
  145. const entrust = {
  146. workMonth: row.currentPeriod,
  147. workOrderIds: [row.workOrderId],
  148. examineId: row.id
  149. };
  150. okDelEntrust(entrust).then((res) => {
  151. proxy.$modal.msgSuccess("同意成功");
  152. getList();
  153. });
  154. })
  155. .catch((_) => { });
  156. }
  157. function submitForm() {
  158. if(form.value.refuseReason == null){
  159. proxy.$modal.msgError("请填写拒绝理由");
  160. return;
  161. }
  162. console.log(23,form.value);
  163. refuse(form.value).then((res) => {
  164. proxy.$modal.msgSuccess("操作成功");
  165. getList();
  166. cancelEntrust.value = false;
  167. });
  168. }
  169. /** 删除按钮操作 */
  170. function handleDelete(row) {
  171. cancelEntrust.value = true;
  172. form.value.id = row.id
  173. console.log(form.value);
  174. }
  175. /** 导出按钮操作 */
  176. function handleExport() {
  177. proxy.download('business/examine/export', {
  178. ...queryParams.value
  179. }, `examine_${new Date().getTime()}.xlsx`)
  180. }
  181. getList();
  182. </script>