index.vue 10 KB

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