index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never">
  4. <el-form :model="formData" ref="formName" label-width="80px">
  5. <el-row :gutter="10">
  6. <el-col :span="6">
  7. <el-form-item label="出库时间" prop="time">
  8. <el-date-picker
  9. class="w100"
  10. size="small"
  11. v-model="formData.time"
  12. type="daterange"
  13. range-separator="至"
  14. start-placeholder="开始日期"
  15. end-placeholder="结束日期"
  16. value-format="yyyy-MM-dd"
  17. ></el-date-picker> </el-form-item
  18. ></el-col>
  19. <el-col :span="4">
  20. <el-form-item label="出库单号" prop="bizNo">
  21. <el-input
  22. size="small"
  23. class="w100"
  24. placeholder="请输入"
  25. v-model="formData.bizNo"
  26. ></el-input> </el-form-item
  27. ></el-col>
  28. <el-col :span="4">
  29. <el-form-item label="领料人" prop="fromUser">
  30. <el-input
  31. size="small"
  32. class="w100"
  33. placeholder="请输入"
  34. v-model="formData.fromUser"
  35. ></el-input> </el-form-item
  36. ></el-col>
  37. <el-col :span="4">
  38. <el-form-item label="状态" prop="verifyStatus">
  39. <el-select
  40. filterable
  41. size="small"
  42. class="w100"
  43. v-model="formData.verifyStatus"
  44. placeholder="请选择"
  45. clearable
  46. >
  47. <el-option
  48. v-for="item in auditStatus"
  49. :key="item.code"
  50. :value="item.code"
  51. :label="item.label"
  52. ></el-option>
  53. </el-select> </el-form-item
  54. ></el-col>
  55. <!-- <el-col :lg="6" :sm="8" :xs="8">
  56. <el-form-item label="创建时间" prop="time">
  57. <el-date-picker
  58. class="w100"
  59. size="small"
  60. v-model="formData.time"
  61. type="daterange"
  62. range-separator="至"
  63. start-placeholder="开始日期"
  64. end-placeholder="结束日期"
  65. value-format="yyyy-MM-dd"
  66. ></el-date-picker> </el-form-item
  67. ></el-col> -->
  68. <el-col :span="6">
  69. <div>
  70. <el-button icon="el-icon-refresh-left" size="small" @click="reset"
  71. >重置</el-button
  72. >
  73. <el-button
  74. type="primary"
  75. icon="el-icon-search"
  76. size="small"
  77. @click="search"
  78. >搜索</el-button
  79. >
  80. </div></el-col
  81. >
  82. </el-row>
  83. </el-form>
  84. <ele-pro-table
  85. ref="table"
  86. :columns="columns"
  87. :datasource="datasource"
  88. cache-key="systemRoleTable"
  89. >
  90. <!-- 表头工具栏 -->
  91. <template v-slot:toolbar>
  92. <el-button icon="el-icon-plus" type="primary" @click="add"
  93. >新建</el-button
  94. >
  95. </template>
  96. <!-- 单号链接 -->
  97. <template v-slot:bizNo="{ row }">
  98. <el-link @click="details(row)">
  99. {{ row.bizNo }}
  100. </el-link>
  101. </template>
  102. <!-- 状态 -->
  103. <template v-slot:verifyStatus="{ row }">
  104. <span :class="status[row.verifyStatus].class">
  105. {{ status[row.verifyStatus].label }}
  106. </span>
  107. </template>
  108. <!-- 工作流审批状态 -->
  109. <template v-slot:flowableStatus="{ row }">
  110. <span v-if="row.flowableStatus == 1" class="ele-text-primary">
  111. 审批中
  112. </span>
  113. <span v-if="row.flowableStatus == 2" class="ele-text-success">
  114. 通过
  115. </span>
  116. <span v-if="row.flowableStatus == 3" class="ele-text-danger">
  117. 拒绝
  118. </span>
  119. </template>
  120. <!-- 领料人 -->
  121. <template v-slot:deliveryName="{ row }">
  122. <div class="deviceName">
  123. <p class="n-p">{{ getUserName(row.fromUser) }}</p>
  124. <!-- <p class="col">出库:{{ row.createTime }}</p> -->
  125. </div>
  126. </template>
  127. <template v-slot:bizType="{ row }">
  128. {{ handleBizType(row.bizType) }}
  129. </template>
  130. <!-- 操作列 -->
  131. <template v-slot:action="{ row }">
  132. <el-link
  133. type="primary"
  134. :underline="false"
  135. icon="el-icon-view"
  136. @click="details(row)"
  137. >
  138. 查看详情
  139. </el-link>
  140. </template>
  141. </ele-pro-table>
  142. </el-card>
  143. </div>
  144. </template>
  145. <script>
  146. import outin from '@/api/warehouseManagement/outin';
  147. import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
  148. import { auditStatus, useDict, outputSceneState } from '@/utils/dict/index';
  149. // import { getPage } from '@/api/stockManagement'
  150. // import { deepClone } from '@/utils'
  151. export default {
  152. // components: { tablePagination },
  153. data() {
  154. return {
  155. auditStatus,
  156. outputSceneState,
  157. tableData: [],
  158. fromUserList: [],
  159. formData: {
  160. bizNo: '',
  161. fromUser: '',
  162. time: [],
  163. verifyStatus: ''
  164. // type: 1
  165. },
  166. total: 0,
  167. status: [
  168. { label: '待审核', class: 'ele-text-primary' },
  169. { label: '已审核', class: 'ele-text-success' }, // 审核状态 1未审核 2
  170. { label: '驳回', class: 'ele-text-danger' }
  171. ],
  172. columns: [
  173. {
  174. type: 'index',
  175. label: '序号',
  176. width: 50,
  177. align: 'center'
  178. },
  179. {
  180. prop: 'bizNo',
  181. label: '单号',
  182. align: 'center',
  183. slot: 'bizNo',
  184. showOverflowTooltip: true,
  185. width: 160
  186. },
  187. {
  188. prop: 'bizType',
  189. slot: 'bizType',
  190. label: '出库场景',
  191. align: 'center',
  192. showOverflowTooltip: true,
  193. width: 150
  194. },
  195. {
  196. prop: 'verifyStatus',
  197. label: '状态',
  198. align: 'center',
  199. slot: 'verifyStatus',
  200. showOverflowTooltip: true,
  201. width: 120
  202. },
  203. {
  204. prop: 'extInfo.documentSource',
  205. label: '来源单据',
  206. align: 'center',
  207. showOverflowTooltip: true
  208. },
  209. {
  210. prop: 'flowableStatus',
  211. slot: 'flowableStatus',
  212. label: '工作流审批状态',
  213. align: 'center',
  214. showOverflowTooltip: true,
  215. width: 120
  216. },
  217. {
  218. prop: 'deliveryName',
  219. label: '领料人',
  220. align: 'center',
  221. slot: 'deliveryName',
  222. showOverflowTooltip: true,
  223. width: 200
  224. },
  225. {
  226. prop: 'createTime',
  227. label: '出库时间',
  228. align: 'center',
  229. showOverflowTooltip: true,
  230. width: 200
  231. },
  232. {
  233. columnKey: 'action',
  234. label: '操作',
  235. width: 100,
  236. align: 'center',
  237. slot: 'action',
  238. showOverflowTooltip: true
  239. }
  240. ]
  241. };
  242. },
  243. created() {
  244. this.getUser();
  245. },
  246. methods: {
  247. handleBizType(code) {
  248. for (const key in this.outputSceneState) {
  249. if (this.outputSceneState[key].code == code) {
  250. return this.outputSceneState[key].label;
  251. }
  252. }
  253. },
  254. getUserName(id) {
  255. let obj = this.fromUserList.find((x) => x.id == id);
  256. return obj && obj.name;
  257. },
  258. async getUser() {
  259. let res22 = await warehouseDefinition.getUserPage({
  260. groupId: 1,
  261. size: 9999,
  262. page: 1
  263. });
  264. this.fromUserList = res22.list;
  265. },
  266. async datasource({ page, limit, where }) {
  267. const params = Object.assign({}, this.formData);
  268. if (params.time?.length) {
  269. params.startTime = params.time[0];
  270. params.endTime = params.time[1];
  271. }
  272. delete params.time;
  273. // params.bizStatus = 1;
  274. const res = await outin.list({
  275. pageNum: page,
  276. size: limit,
  277. bizStatus: 2,
  278. ...params,
  279. type: 2
  280. });
  281. return res;
  282. },
  283. getAuditStatus: useDict(auditStatus),
  284. getList() {
  285. this.$refs.table.reload();
  286. },
  287. add() {
  288. this.$router.push({
  289. path: '/warehouseManagement/outgoingManagement/add'
  290. });
  291. },
  292. details(row) {
  293. this.$router.push({
  294. path: '/warehouseManagement/outgoingManagement/details',
  295. query: {
  296. id: row.id
  297. }
  298. });
  299. },
  300. handleCurrentChange() {
  301. this.getList();
  302. },
  303. handleSizeChange() {
  304. this.formData.page = 1;
  305. this.getList();
  306. },
  307. search() {
  308. this.formData.page = 1;
  309. this.getList();
  310. },
  311. reset() {
  312. this.$refs.formName.resetFields();
  313. this.search();
  314. }
  315. }
  316. };
  317. </script>
  318. <style lang="scss" scoped>
  319. .w100 {
  320. width: 100% !important;
  321. }
  322. .p20 {
  323. padding: 20px;
  324. }
  325. .mt20 {
  326. margin-top: 20px;
  327. }
  328. .mt10 {
  329. margin-top: 10px;
  330. }
  331. .el-form {
  332. overflow: hidden;
  333. }
  334. .float-right {
  335. float: right;
  336. text-align: right;
  337. margin-right: 20px;
  338. }
  339. .right {
  340. text-align: right;
  341. }
  342. .col {
  343. color: #aaa;
  344. }
  345. .pr10 {
  346. padding-right: 10px;
  347. }
  348. </style>