index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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:entrustOrder:add']">新增</el-button>
  7. <el-button type="danger" size="small" icon="Delete" :disabled="!multiple" @click="handleDelete"
  8. v-hasPermi="['business:entrustOrder:remove']">删除</el-button>
  9. <el-button type="success" size="small" icon="Refresh" @click="getList"
  10. v-hasPermi="['business:entrustOrder:remove']">刷新</el-button>
  11. <el-dropdown>
  12. <el-button type="primary" size="small">
  13. 其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
  14. </el-button>
  15. <template #dropdown>
  16. <el-dropdown-menu>
  17. <el-dropdown-item icon="Download" @click="handleExport" v-hasPermi="['business:entrustOrder:export']">
  18. 导出</el-dropdown-item>
  19. </el-dropdown-menu>
  20. </template>
  21. </el-dropdown>
  22. </div>
  23. <!-- 搜索区 -->
  24. <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
  25. label-width="68px">
  26. <el-form-item label="往来单位:" prop="contactCompany">
  27. <el-input v-model="queryParams.contactCompany" placeholder="请输入往来单位" style="width: 150px" 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="list" 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="workOrderNo" width="200" /> -->
  40. <el-table-column label="签约主体" align="center" min-width="150" prop="signingSubject" />
  41. <el-table-column label="签约日期" align="center" prop="formDate" min-width="80" />
  42. <el-table-column label="合同编号" align="center" prop="formNo" min-width="150">
  43. </el-table-column>
  44. <el-table-column label="往来单位" align="center" prop="contactCompany" min-width="150">
  45. </el-table-column>
  46. <el-table-column label="预存金额" prop="depositAmount" align="center" min-width="80">
  47. </el-table-column>
  48. <el-table-column label="结余金额" prop="remainAmount" align="center" min-width="80">
  49. </el-table-column>
  50. <el-table-column label="状态" prop="status" align="center" minm-width="100">
  51. <template #default="scope">
  52. <dict-tag :options="entrust_order_status" :value="scope.row.status" />
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="操作" align="center" min-width="150" class-name="small-padding fixed-width">
  56. <template #default="scope">
  57. <el-button link type="primary" size="small" @click="handleUpdate(scope.row.id)"
  58. v-hasPermi="['business:entrustOrder:query']">详情</el-button>
  59. <el-button v-show="scope.row.status === 0" link type="primary" size="small" @click="handleConfirm(scope.row)"
  60. v-hasPermi="['business:entrustOrder:confirm']">确认订单</el-button>
  61. <el-button v-show="scope.row.status === 1" link type="primary" size="small" @click="handleFinished(scope.row)"
  62. v-hasPermi="['business:entrustOrder:finished']">确认完结</el-button>
  63. <router-link v-if="scope.row.status !== 0" :to="'/entrust/statusment/order/' + scope.row.id" class="link-type">
  64. <el-button link size="small" style="margin-left: 10px" type="primary"
  65. v-hasPermi="['business:entrustOrder:statement:list']">对账单列表</el-button>
  66. </router-link>
  67. </template>
  68. </el-table-column>
  69. </el-table>
  70. <entrust-order-form ref="entrustOrderFormRef" :getList="getList" />
  71. <!-- 分页 -->
  72. <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
  73. @pagination="getList" />
  74. </div>
  75. </template>
  76. <script setup name="Company">
  77. import {
  78. listEntrustOrder,
  79. exportEntrustOrder,
  80. delEntrustOrder,
  81. confirmEntrustOrder,
  82. finishedEntrustOrder,
  83. } from "@/api/business/entrust/entrustOrder";
  84. import entrustOrderForm from "./form";
  85. const { proxy } = getCurrentInstance();
  86. /** 字典数组区 */
  87. /** 查询 对象 */
  88. const list = ref([]);
  89. const loading = ref(true);
  90. const ids = ref([]);
  91. const selections = ref([]);
  92. const single = ref(false);
  93. const multiple = ref(false);
  94. const total = ref(0);
  95. const prev = ref([]);
  96. const entrustOrderFormRef = ref(null);
  97. const setEntrustDialogRef = ref(null);
  98. const { entrust_order_status } = proxy.useDict("entrust_order_status");
  99. /** 查询对象 */
  100. const queryParams = ref({
  101. pageNum: 1,
  102. pageSize: 10,
  103. contactCompany: "",
  104. orderByColumn: "create_time",
  105. type: 2,
  106. });
  107. const editStatus = {
  108. startMonth: false,
  109. };
  110. /*********************** 方法区 ****************************/
  111. /** 查询company列表 */
  112. function getList() {
  113. loading.value = true;
  114. listEntrustOrder(queryParams.value).then((response) => {
  115. list.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. selections.value = selection;
  134. single.value = selection.length != 1;
  135. multiple.value = selection.length > 0;
  136. }
  137. /** 导出按钮操作 */
  138. function handleExport() {
  139. exportEntrustOrder(queryParams.value);
  140. }
  141. /** 新增按钮操作 */
  142. function handleAdd() {
  143. entrustOrderFormRef.value.open();
  144. }
  145. function handleUpdate(id) {
  146. entrustOrderFormRef.value.open(id);
  147. }
  148. /** 删除按钮操作 */
  149. function handleDelete(row) {
  150. const _ids = row.id || ids.value;
  151. proxy.$modal
  152. .confirm("是否确认删除选中的数据项?")
  153. .then(function () {
  154. return delEntrustOrder(_ids);
  155. })
  156. .then(() => {
  157. getList();
  158. proxy.$modal.msgSuccess("删除成功!");
  159. })
  160. .catch(() => { });
  161. }
  162. function handleConfirm(row) {
  163. proxy.$modal
  164. .confirm("确认启用该合同?")
  165. .then((_) => {
  166. return confirmEntrustOrder(row);
  167. })
  168. .then((res) => {
  169. console.log(res);
  170. getList();
  171. proxy.$modal.msgSuccess("确认成功");
  172. });
  173. }
  174. function handleFinished(row) {
  175. proxy.$modal
  176. .confirm("确认完结该合同?")
  177. .then((_) => {
  178. return finishedEntrustOrder(row);
  179. })
  180. .then((res) => {
  181. console.log(res);
  182. getList();
  183. proxy.$modal.msgSuccess("完结成功");
  184. });
  185. }
  186. function handleViewAccountment(row) { }
  187. getList();
  188. </script>