index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <!-- 搜索 -->
  3. <ContentWrap>
  4. <!-- 搜索工作栏 -->
  5. <el-form
  6. class="-mb-15px"
  7. :model="queryParams"
  8. ref="queryFormRef"
  9. :inline="true"
  10. label-width="90px"
  11. >
  12. <el-form-item label="单据类型" prop="type">
  13. <el-select v-model="queryParams.type" placeholder="请选择" class="!w-240px">
  14. <el-option
  15. v-for="(dict, index) in getIntDictOptions(DICT_TYPE.DOCUMENT_TYPE)"
  16. :key="index"
  17. :label="dict.label"
  18. :value="dict.value"
  19. />
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item label="单据状态" prop="type">
  23. <el-select v-model="queryParams.type" placeholder="请选择" class="!w-240px">
  24. <el-option
  25. v-for="(dict, index) in getIntDictOptions(DICT_TYPE.DOCUMENT_STATUS)"
  26. :key="index"
  27. :label="dict.label"
  28. :value="dict.value"
  29. />
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item label="供应商名称" prop="type">
  33. <el-select v-model="queryParams.type" placeholder="请选择" class="!w-240px">
  34. <el-option
  35. v-for="(dict, index) in getIntDictOptions(DICT_TYPE.DOCUMENT_STATUS)"
  36. :key="index"
  37. :label="dict.label"
  38. :value="dict.value"
  39. />
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item label="仓库名称" prop="type">
  43. <el-select v-model="queryParams.type" placeholder="请选择" class="!w-240px">
  44. <el-option
  45. v-for="(dict, index) in getIntDictOptions(DICT_TYPE.APPROVAL_STATUS)"
  46. :key="index"
  47. :label="dict.label"
  48. :value="dict.value"
  49. />
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item label="入库单号" prop="bedId">
  53. <el-input v-model="queryParams.bedId" placeholder="请输入床位号" class="!w-240px" />
  54. </el-form-item>
  55. <el-form-item label="入库日期" prop="bedId">
  56. <TgDatePicker type="daterange" v-model="queryParams.queryDayTime" />
  57. </el-form-item>
  58. <el-form-item>
  59. <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
  60. <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
  61. </el-form-item>
  62. </el-form>
  63. </ContentWrap>
  64. <!-- 列表 -->
  65. <ContentWrap>
  66. <el-row style="align-items: center">
  67. <el-button type="primary" plain @click="handleAdd" v-hasPermi="['putStorage:warehouseManage:add']">
  68. <Icon icon="ep:plus" class="mr-5px" /> 新增
  69. </el-button>
  70. <el-button type="danger" plain @click="handleAdd" v-hasPermi="['warehouseManage:delete']">
  71. <Icon icon="ep:delete" class="mr-5px" /> 删除
  72. </el-button>
  73. <el-button :disabled="(selectionChangeList.length==0)" type="success" plain @click="backfillHan" v-hasPermi="['putStorage:warehouseManage:backfill']" >
  74. <Icon icon="ep:edit" class="mr-5px" /> 回填发票
  75. </el-button>
  76. <div style="color: red;font-size: 13px;margin-left: 1vw">为确保库存数据准确,按照标准管理流程,当月要入库的物资,请当月操作完成,不能跨自然月录入!撤销功能只可当月撤销!</div>
  77. </el-row>
  78. <Table2
  79. v-loading="loading"
  80. style="margin-top: 10px"
  81. :data="list"
  82. selection
  83. @selection-change="selectionChange"
  84. :columns="BedChangeColumns"
  85. :queryParams="queryParams"
  86. @edit="openForm"
  87. @detail="openDetail"
  88. @cancel="handleDelete"
  89. />
  90. <!-- 分页 -->
  91. <Pagination
  92. :total="total"
  93. v-model:page="queryParams.pageNo"
  94. v-model:limit="queryParams.pageSize"
  95. @pagination="getList"
  96. />
  97. </ContentWrap>
  98. <Form ref="formRef" @success="getList" />
  99. <!-- <Detail ref="detailRef" />-->
  100. </template>
  101. <script lang="ts" setup>
  102. import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
  103. import { getBedChangePage } from '@/api/elderly/elder/bed-change'
  104. import { BedChangeColumns } from '../column'
  105. import { cancelprocessInstance } from '@/api/elderly/common'
  106. import Form from './Form.vue'
  107. import Detail from './Detail.vue'
  108. import { getTenantId } from '@/utils/auth'
  109. import {a} from "../../../../dist/assets/avatar-BG6NdH5s";
  110. defineOptions({ name: 'BedChange' })
  111. const message = useMessage() // 消息弹窗
  112. const { t } = useI18n() // 国际化
  113. const loading = ref(true) // 列表的加载中
  114. const total = ref(0) // 列表的总页数
  115. const list = ref([]) // 列表的数据
  116. const queryParams = reactive({
  117. pageNo: 1,
  118. pageSize: 10,
  119. elderName: undefined,
  120. bedId: undefined,
  121. type: undefined,
  122. tenantId: undefined,
  123. })
  124. const queryFormRef = ref() // 搜索的表单
  125. /** 查询列表 */
  126. const getList = async () => {
  127. loading.value = true
  128. try {
  129. const data = await getBedChangePage(queryParams)
  130. list.value = data.list
  131. total.value = data.total
  132. } finally {
  133. loading.value = false
  134. }
  135. }
  136. const handleAdd = () => {
  137. formRef.value.open()
  138. }
  139. const selectionChangeList = ref([])
  140. const selectionChange = (res) => {
  141. selectionChangeList.value = res
  142. }
  143. /** 搜索按钮操作 */
  144. const handleQuery = () => {
  145. queryParams.pageNo = 1
  146. getList()
  147. }
  148. /** 重置按钮操作 */
  149. const resetQuery = () => {
  150. queryFormRef.value.resetFields()
  151. handleQuery()
  152. }
  153. const backfillHan = async () => {
  154. try {
  155. const res = await message.confirm(`确认回填选中的${selectionChangeList.value.length}项`, '提示')
  156. if (res == 'confirm') {
  157. try {
  158. const res = await message.prompt('请输入供应商发票号', '提示')
  159. if (res.action == 'confirm') {
  160. // // 发起撤销
  161. // await cancelprocessInstance({
  162. // id: id,
  163. // reason: res.value
  164. // })
  165. // message.success(t('common.cancelSuccess'))
  166. }
  167. // 刷新列表
  168. await getList()
  169. } catch {}
  170. }
  171. } catch {}
  172. }
  173. /** 添加/修改操作 */
  174. const formRef = ref()
  175. const openForm = (row: any = {}) => {
  176. formRef.value.open(row.id, false)
  177. }
  178. // 详情
  179. const detailRef = ref()
  180. const openDetail = (row: any = {}) => {
  181. //detailRef.value.open(row.id, row.processInstanceId, row.status)
  182. formRef.value.open(row.id, true)
  183. }
  184. /** 删除按钮操作 */
  185. const handleDelete = async (id: number) => {
  186. try {
  187. const res = await message.prompt('请输入撤销原因', '提示')
  188. if (res.action == 'confirm') {
  189. // // 发起撤销
  190. await cancelprocessInstance({
  191. id: id,
  192. reason: res.value
  193. })
  194. message.success(t('common.cancelSuccess'))
  195. }
  196. // 刷新列表
  197. await getList()
  198. } catch {}
  199. }
  200. const route = useRoute()
  201. /** 初始化 **/
  202. onMounted(() => {
  203. if(route.query && route.query.elderName){
  204. queryParams.elderName = route.query.elderName as string
  205. }
  206. getList()
  207. })
  208. </script>