index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <!-- 出库信息审核 -->
  2. <template>
  3. <basic-container>
  4. <el-form :model="formData" label-width="100px" class="whole_form">
  5. <el-row :gutter="20">
  6. <el-col :span="6">
  7. <el-form-item label="出库类型">
  8. <el-select v-model="formData.outboundType" class="m-2" placeholder="请选择" clearable style="width: 280px">
  9. <el-option v-for="item in cklxOptions" :key="item.value" :label="item.label" :value="item.value" />
  10. </el-select>
  11. </el-form-item>
  12. </el-col>
  13. <el-col :span="6">
  14. <el-form-item label="物资名称">
  15. <el-input v-model="formData.materialNameVo" clearable placeholder="请输入" style="width: 280px" />
  16. </el-form-item>
  17. </el-col>
  18. <el-col :span="6">
  19. <el-form-item label="当前审批节点">
  20. <el-select v-model="formData.status" class="m-2" placeholder="请选择" clearable style="width: 280px">
  21. <el-option v-for="(item, index) in dqspjdOptions" :key="index" :label="item.label" :value="item.value" />
  22. </el-select>
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="6">
  26. <el-button type="primary" :icon="Search" @click="handleSearch">查询</el-button>
  27. </el-col>
  28. </el-row>
  29. <!-- <el-row :gutter="20">
  30. <el-col :span="6">
  31. <el-form-item label="审批节点">
  32. <el-select v-model="formData.spjd" class="m-2" placeholder="请选择" clearable style="width: 280px">
  33. <el-option v-for="item in spjdOptions" :key="item.value" :label="item.label" :value="item.value" />
  34. </el-select>
  35. </el-form-item>
  36. </el-col>
  37. </el-row> -->
  38. </el-form>
  39. <el-table :data="tableData" style="width: 100%" stripe border>
  40. <el-table-column type="index" label="序号" header-align="center" align="center" width="60" />
  41. <el-table-column prop="warehouse" label="库点简称" header-align="center" align="center" />
  42. <el-table-column prop="outboundType" label="出库类型" header-align="center" align="center">
  43. <template #default="scope">
  44. {{ cklxObject[scope.row.outboundType] }}
  45. </template>
  46. </el-table-column>
  47. <el-table-column prop="materialGroup" label="物资大类" header-align="center" align="center" />
  48. <el-table-column prop="materialType" label="物资类别" header-align="center" align="center" />
  49. <el-table-column prop="materialName" label="物资名称" header-align="center" align="center" />
  50. <el-table-column prop="quantity" label="数量" header-align="center" align="center" />
  51. <el-table-column prop="calledProvince" label="调用省份" header-align="center" align="center">
  52. <template #default="scope">
  53. {{ dysfObject[scope.row.calledProvince] }}
  54. </template>
  55. </el-table-column>
  56. <el-table-column prop="outboundTime" label="出库日期" header-align="center" align="center" />
  57. <el-table-column prop="status" label="当前审批节点" header-align="center" align="center">
  58. <template #default="scope">
  59. {{ spjdObject[scope.row.status] }}
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="操作" header-align="center" width="160">
  63. <template #default="scope">
  64. <el-button size="" type="primary" style="backgroundcolor: #949aef" @click="handleShow(scope.row)"
  65. >查看</el-button
  66. >
  67. <el-button
  68. size=""
  69. v-if="
  70. (deptId == '9' && scope.row.status == '3') ||
  71. (deptId == '10' && (scope.row.status == '2' || scope.row.status == '6'))
  72. "
  73. type="warning"
  74. style="backgroundcolor: #dbc262"
  75. @click="handleProcess(scope.row)"
  76. >审核</el-button
  77. >
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. <pagination
  82. v-show="page.total > 0"
  83. v-model:page="page.currentPage"
  84. v-model:limit="page.pageSize"
  85. :total="page.total"
  86. layout="->,total, sizes, prev, pager, next, jumper"
  87. @pagination="getList"
  88. />
  89. </basic-container>
  90. </template>
  91. <script setup lang="ts">
  92. import { reactive, toRefs, onMounted } from "vue";
  93. import { getInAuditList } from "@/api/inAndOut/outAudit/index";
  94. import { getDictItemList } from "@/api/admin/index";
  95. import { Search } from "@element-plus/icons-vue";
  96. import { useRouter } from "vue-router";
  97. const router = useRouter();
  98. const data = reactive({
  99. tableData: [],
  100. cklxOptions: [],
  101. cklxObject: {}, //出库类型
  102. dysfObject: {}, //调用省份
  103. spjdObject: {}, //审批节点
  104. dqspjdOptions: [],
  105. spjdOptions: [],
  106. deptId: ""
  107. });
  108. let page = reactive({
  109. currentPage: 1,
  110. pageSize: 10,
  111. total: 0
  112. });
  113. let formData = reactive({
  114. outboundType: "",
  115. materialNameVo: "",
  116. status: ""
  117. // spjd: ""
  118. });
  119. let { tableData, cklxOptions, cklxObject, dqspjdOptions, spjdOptions, dysfObject, spjdObject, deptId } = toRefs(data);
  120. // 获取列表
  121. const getList = () => {
  122. const data = reactive({
  123. size: page.pageSize,
  124. current: page.currentPage,
  125. params: { ...formData }
  126. });
  127. getInAuditList(data).then((res: any) => {
  128. console.log(res);
  129. if (res.code === 0) {
  130. tableData.value = res.data.records;
  131. page.total = res.data.total;
  132. }
  133. });
  134. };
  135. // 字典-出库类型
  136. const getOutboundTypeList = () => {
  137. const data = reactive({
  138. size: 100,
  139. current: 1,
  140. dictId: "214124"
  141. });
  142. getDictItemList(data).then((res: any) => {
  143. if (res.code === 0) {
  144. cklxOptions.value = res.data.records;
  145. cklxObject.value = res.data.records.reduce((acc: any, item: any) => {
  146. acc[item.value] = item.label;
  147. return acc;
  148. }, {});
  149. }
  150. });
  151. };
  152. // 字典-审批节点
  153. const getStatusList = () => {
  154. const data = reactive({
  155. size: 100,
  156. current: 1,
  157. dictId: "423059273"
  158. });
  159. getDictItemList(data).then((res: any) => {
  160. if (res.code === 0) {
  161. dqspjdOptions.value = res.data.records;
  162. spjdObject.value = res.data.records.reduce((acc: any, item: any) => {
  163. acc[item.value] = item.label;
  164. return acc;
  165. }, {});
  166. }
  167. });
  168. };
  169. // 字典-调用省份
  170. const getProvinceList = () => {
  171. const data = reactive({
  172. size: 100,
  173. current: 1,
  174. dictId: "1763408141744652289"
  175. });
  176. getDictItemList(data).then((res: any) => {
  177. if (res.code === 0) {
  178. dysfObject.value = res.data.records.reduce((acc: any, item: any) => {
  179. acc[item.value] = item.label;
  180. return acc;
  181. }, {});
  182. }
  183. });
  184. };
  185. // 查询
  186. const handleSearch = () => {
  187. getList();
  188. };
  189. // 重置
  190. const handleReSearch = () => {
  191. page = {
  192. currentPage: 1,
  193. pageSize: 10,
  194. total: 0
  195. };
  196. formData = {
  197. outboundType: "",
  198. materialNameVo: "",
  199. status: ""
  200. // spjd: "",
  201. };
  202. getList();
  203. };
  204. // 审核
  205. const handleProcess = (row: any) => {
  206. router.push({
  207. name: "outWarehouseAuditDetail",
  208. query: {
  209. id: row.outboundId,
  210. type: "audit"
  211. }
  212. });
  213. };
  214. // 查看
  215. const handleShow = (row: any) => {
  216. router.push({
  217. name: "outWarehouseAuditDetail",
  218. query: {
  219. id: row.outboundId,
  220. type: "show"
  221. }
  222. });
  223. };
  224. getOutboundTypeList();
  225. getStatusList();
  226. getProvinceList();
  227. onMounted(() => {
  228. getList();
  229. let deptObj: any = sessionStorage.getItem("userInfo");
  230. deptId = deptObj ? JSON.parse(deptObj).deptId : "";
  231. });
  232. </script>
  233. <style lang="scss" scoped></style>