index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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:invoice:add']">新增</el-button>
  7. <!-- <el-button
  8. type="success"
  9. size="small"
  10. icon="Edit"
  11. :disabled="single"
  12. @click="handleUpdate"
  13. v-hasPermi="['business:invoice:edit']"
  14. >修改</el-button>
  15. <el-button
  16. type="danger"
  17. size="small"
  18. icon="Delete"
  19. :disabled="multiple"
  20. @click="handleDelete"
  21. v-hasPermi="['business:invoice:remove']"
  22. >删除</el-button> -->
  23. <el-button type="warning" size="small" icon="Download" @click="handleExport"
  24. v-hasPermi="['business:invoice:export']">导出</el-button>
  25. <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
  26. </div>
  27. <!-- 搜索区 -->
  28. <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
  29. <el-form-item label="收票方:" prop="invoiceOther">
  30. <el-input size="small" v-model="queryParams.invoiceOther" style="width: 150px" placeholder="请输入收票方"
  31. clearable @keyup.enter="handleQuery" />
  32. </el-form-item>
  33. <el-form-item label="合同编号: " prop="contractNo">
  34. <el-input size="small" v-model="queryParams.contractNo" style="width: 150px" placeholder="合同编号"
  35. clearable @keyup.enter="handleQuery" />
  36. </el-form-item>
  37. <el-form-item label="发票类型: " prop="invoiceType">
  38. <el-select v-model="queryParams.invoiceType" placeholder="请选择发票类型" size="small" clearable
  39. style="width: 150px">
  40. <el-option label="增值税专用发票" value="1"></el-option>
  41. <el-option label="增值税普通发票" value="2"></el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="状态:" prop="status">
  45. <el-select v-model="queryParams.status" placeholder="请选择状态" size="small" clearable style="width: 150px">
  46. <el-option label="未提交" value="0"></el-option>
  47. <el-option label="待开票" value="1"></el-option>
  48. <el-option label="已拒绝" value="2"></el-option>
  49. <el-option label="已开票" value="3"></el-option>
  50. <el-option label="已退回" value="4"></el-option>
  51. </el-select>
  52. </el-form-item>
  53. <el-form-item label="申请人: " prop="applierName">
  54. <el-input size="small" v-model="queryParams.applierName" style="width: 150px" placeholder="申请人"
  55. clearable @keyup.enter="handleQuery" />
  56. </el-form-item>
  57. <el-form-item prop="dateFilter" label="申请时间:">
  58. <el-date-picker v-model="queryParams.dateFilter" type="daterange" clearable size="small"
  59. format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
  60. end-placeholder="业务日期" style="width: 100%;"></el-date-picker>
  61. </el-form-item>
  62. <el-form-item label="开票人:" prop="invoiceName">
  63. <el-input size="small" v-model="queryParams.invoiceName" placeholder="请输入开票人" clearable
  64. style="width: 150px" @keyup.enter="handleQuery" />
  65. </el-form-item>
  66. <el-form-item prop="invoiceDateFilter" label="开票时间:">
  67. <el-date-picker v-model="queryParams.invoiceDateFilter" type="daterange" clearable size="small"
  68. format="YYYY - MM - DD " value-format="YYYY-MM-DD" range-separator="至" start-placeholder="业务日期"
  69. end-placeholder="业务日期" style="width: 100%;"></el-date-picker>
  70. </el-form-item>
  71. <el-form-item>
  72. <el-button type="primary" icon="Search" @click="handleQuery" size="small">搜索</el-button>
  73. <el-button icon="Refresh" @click="resetQuery" size="small">重置</el-button>
  74. </el-form-item>
  75. </el-form>
  76. <!-- 列表区 -->
  77. <el-table v-loading="loading" :data="invoiceList" size="small" border height="100%">
  78. <el-table-column type="index" width="55" align="center" />
  79. <el-table-column label="收票方" align="center" prop="invoiceOther" width="200"></el-table-column>/>
  80. <el-table-column label="合同编号" align="center" prop="contractNo" />
  81. <el-table-column label="发票类型" align="center" prop="invoiceType">
  82. <template #default="scope">
  83. <span v-if="scope.row.invoiceType == 1">增值税专用发票</span>
  84. <span v-if="scope.row.invoiceType == 2">增值税普通发票</span>
  85. <span v-if="scope.row.invoiceType == 3">增值税电子发票</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="开票金额" align="center" prop="allowInvoiceAmount" />
  89. <el-table-column label="发票备注" align="center" prop="remark" />
  90. <el-table-column label="状态" align="center" prop="status">
  91. <template #default="scope">
  92. <el-link style="font-size: 12px;" type="warning" :underline="false"
  93. v-if="scope.row.status == 0">未提交</el-link>
  94. <el-link style="font-size: 12px;" type="primary" :underline="false"
  95. v-if="scope.row.status == 1">待开票</el-link>
  96. <el-link style="font-size: 12px;" type="danger" :underline="false"
  97. v-if="scope.row.status == 2">已拒绝</el-link>
  98. <el-link style="font-size: 12px;" type="success" :underline="false"
  99. v-if="scope.row.status == 3">已开票</el-link>
  100. <el-link style="font-size: 12px;" type="warning" :underline="false"
  101. v-if="scope.row.status == 4">已退回</el-link>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="申请人" align="center" prop="applierName" />
  105. <el-table-column label="申请时间" align="center" prop="applierTime" width="180">
  106. </el-table-column>
  107. <el-table-column label="开票人" align="center" prop="invoiceName" />
  108. <el-table-column label="开票时间" align="center" prop="invoiceTime" />
  109. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  110. <template #default="scope">
  111. <el-button link type="warning" size="small" icon="Edit" @click="handleUpdate(scope.row)"
  112. v-hasPermi="['business:invoice:query']">查看</el-button>
  113. <!-- <el-button link type="warning" size="small" icon="Edit" @click="handleUpdate(scope.row)"
  114. v-hasPermi="['business:invoice:edit']">修改</el-button> -->
  115. <!-- <el-button link type="danger" size="small" icon="Delete" @click="handleDelete(scope.row)"
  116. v-hasPermi="['business:invoice:remove']">删除</el-button> -->
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <!-- 分页 -->
  121. <pagination v-show="total>0" :total="total" v-model:page="queryParams.pageNum"
  122. v-model:limit="queryParams.pageSize" @pagination="getList" />
  123. <!-- 表单 -->
  124. <invoice-form ref="invoiceRef" :get-list="getList"></invoice-form>
  125. </div>
  126. </template>
  127. <script setup name="Invoice">
  128. import { listInvoice, delInvoice, exportInfo } from "@/api/business/invoice";
  129. import invoiceForm from "./form"
  130. const { proxy } = getCurrentInstance()
  131. /** 字典数组区 */
  132. /** 查询 对象 */
  133. const invoiceList = ref([]);
  134. const loading = ref(true);
  135. const ids = ref([])
  136. const single = ref(true);
  137. const multiple = ref(true);
  138. const total = ref(0);
  139. /** 查询对象 */
  140. const queryParams = ref({
  141. pageNum: 1,
  142. pageSize: 20,
  143. invoiceType: null,
  144. allowInvoiceAmount: null,
  145. invoiceContent: null,
  146. invoiceMy: null,
  147. myCreditSocietyCode: null,
  148. myAddress: null,
  149. myAccount: null,
  150. invoiceOther: null,
  151. otherCreditSocietyCode: null,
  152. otherAddress: null,
  153. applierTime: null,
  154. status: null,
  155. invoiceTime: null,
  156. invoiceRemark: null,
  157. })
  158. /*********************** 方法区 ****************************/
  159. onActivated(() => {
  160. // 你的逻辑
  161. getList();
  162. });
  163. /** 查询企业租户列表 */
  164. function getList() {
  165. loading.value = true;
  166. listInvoice(queryParams.value).then(response => {
  167. invoiceList.value = response.rows;
  168. total.value = response.total;
  169. loading.value = false;
  170. });
  171. }
  172. /** 搜索按钮操作 */
  173. function handleQuery() {
  174. queryParams.value.pageNum = 1;
  175. getList();
  176. }
  177. /** 重置按钮操作 */
  178. function resetQuery() {
  179. proxy.resetForm("queryRef");
  180. handleQuery();
  181. }
  182. // 多选框选中数据
  183. function handleSelectionChange(selection) {
  184. ids.value = selection.map(item => item.id);
  185. single.value = selection.length != 1;
  186. multiple.value = !selection.length;
  187. }
  188. /** 新增按钮操作 */
  189. function handleAdd() {
  190. proxy.$refs.invoiceRef.open()
  191. }
  192. /** 修改按钮操作 */
  193. function handleUpdate(row) {
  194. const id = row.id || ids.value
  195. proxy.$refs.invoiceRef.open(id)
  196. }
  197. /** 删除按钮操作 */
  198. function handleDelete(row) {
  199. const _ids = row.id || ids.value;
  200. proxy.$modal.confirm('是否确认删除选中的数据项?').then(function () {
  201. return delInvoice(_ids);
  202. }).then(() => {
  203. getList();
  204. proxy.$modal.msgSuccess("删除成功!");
  205. }).catch(() => { });
  206. }
  207. /** 导出按钮操作 */
  208. function handleExport() {
  209. exportInfo(queryParams.value)
  210. }
  211. getList();
  212. </script>