index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. <template>
  2. <div class="outgoingManagement_index">
  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 :class="status[row.flowableStatus].class">
  111. {{ status[row.flowableStatus].label }}
  112. </span>
  113. </template>
  114. <!-- 领料人 -->
  115. <template v-slot:createUserName="{ row }">
  116. <div class="deviceName">
  117. <p class="n-p">{{ row.createUserName }}</p>
  118. <!-- <p class="col">出库:{{ row.createTime }}</p> -->
  119. </div>
  120. </template>
  121. <template v-slot:bizType="{ row }">
  122. {{ handleBizType(row.bizType) }}
  123. </template>
  124. <!-- 操作列 -->
  125. <template v-slot:action="{ row }">
  126. <el-link
  127. type="success"
  128. :underline="false"
  129. icon="el-icon-position"
  130. v-if="row.verifyStatus == 0 || row.verifyStatus == 3"
  131. @click="submit(row)"
  132. >
  133. 提交
  134. </el-link>
  135. <el-link
  136. type="warning"
  137. :underline="false"
  138. icon="el-icon-edit"
  139. v-if="row.verifyStatus == 3"
  140. @click="edit(row)"
  141. >
  142. 修改
  143. </el-link>
  144. <el-link
  145. type="primary"
  146. :underline="false"
  147. icon="el-icon-view"
  148. @click="details(row)"
  149. >
  150. 详情
  151. </el-link>
  152. </template>
  153. </ele-pro-table>
  154. </el-card>
  155. </div>
  156. </template>
  157. <script>
  158. import outin from '@/api/warehouseManagement/outin';
  159. import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
  160. import { auditStatus, useDict, outputSceneState } from '@/utils/dict/index';
  161. // import { getPage } from '@/api/stockManagement'
  162. // import { deepClone } from '@/utils'
  163. export default {
  164. // components: { tablePagination },
  165. data() {
  166. return {
  167. auditStatus,
  168. outputSceneState,
  169. tableData: [],
  170. fromUserList: [],
  171. formData: {
  172. bizNo: '',
  173. fromUser: '',
  174. time: [],
  175. verifyStatus: ''
  176. // type: 1
  177. },
  178. total: 0,
  179. status: [
  180. { label: '未审核', class: 'ele-text-info' },
  181. { label: '审核中', class: 'ele-text-primary' },
  182. { label: '审核通过', class: 'ele-text-success' },
  183. { label: '驳回', class: 'ele-text-danger' }
  184. ],
  185. columns: [
  186. {
  187. type: 'index',
  188. label: '序号',
  189. width: 50,
  190. align: 'center'
  191. },
  192. {
  193. prop: 'bizNo',
  194. label: '单号',
  195. align: 'center',
  196. slot: 'bizNo',
  197. showOverflowTooltip: true,
  198. width: 160
  199. },
  200. {
  201. prop: 'bizType',
  202. slot: 'bizType',
  203. label: '出库场景',
  204. align: 'center',
  205. showOverflowTooltip: true,
  206. width: 150
  207. },
  208. // {
  209. // prop: 'verifyStatus',
  210. // label: '状态',
  211. // align: 'center',
  212. // slot: 'verifyStatus',
  213. // showOverflowTooltip: true,
  214. // width: 120
  215. // },
  216. {
  217. prop: 'sourceBizNo',
  218. label: '来源单据',
  219. align: 'center',
  220. showOverflowTooltip: true
  221. },
  222. {
  223. prop: 'createUserName',
  224. label: '领料人',
  225. align: 'center',
  226. slot: 'createUserName',
  227. showOverflowTooltip: true,
  228. width: 200
  229. },
  230. {
  231. prop: 'createTime',
  232. label: '出库时间',
  233. align: 'center',
  234. showOverflowTooltip: true,
  235. width: 200
  236. },
  237. {
  238. prop: 'verifyStatus',
  239. slot: 'verifyStatus',
  240. label: '状态',
  241. align: 'center',
  242. showOverflowTooltip: true,
  243. width: 120
  244. },
  245. {
  246. prop: 'verifyName',
  247. slot: 'verifyName',
  248. label: '审核人',
  249. align: 'center',
  250. showOverflowTooltip: true,
  251. width: 120
  252. },
  253. {
  254. columnKey: 'action',
  255. label: '操作',
  256. width: 200,
  257. align: 'center',
  258. slot: 'action',
  259. showOverflowTooltip: true
  260. }
  261. ]
  262. };
  263. },
  264. created() {
  265. this.getUser();
  266. },
  267. methods: {
  268. edit(row) {
  269. this.$router.push({
  270. path: '/warehouseManagement/outgoingManagement/edit',
  271. query: {
  272. id: row.id
  273. }
  274. });
  275. },
  276. submit(row) {
  277. this.$confirm('此操作将提交流程, 是否继续?', '提示', {
  278. confirmButtonText: '确定',
  279. cancelButtonText: '取消',
  280. type: 'warning'
  281. })
  282. .then(async () => {
  283. const data = await outin.outApprove({ outInId: row.id });
  284. if (data) {
  285. this.$message.success('流程发起成功!');
  286. this.getList();
  287. }
  288. })
  289. .catch(() => {});
  290. },
  291. handleBizType(code) {
  292. for (const key in this.outputSceneState) {
  293. if (this.outputSceneState[key].code == code) {
  294. return this.outputSceneState[key].label;
  295. }
  296. }
  297. },
  298. getUserName(id) {
  299. let obj = this.fromUserList.find((x) => x.id == id);
  300. return obj && obj.name;
  301. },
  302. async getUser() {
  303. let res22 = await warehouseDefinition.getUserPage({
  304. groupId: 1,
  305. size: 9999,
  306. page: 1
  307. });
  308. this.fromUserList = res22.list;
  309. },
  310. async datasource({ page, limit, where }) {
  311. const params = Object.assign({}, this.formData);
  312. if (params.time?.length) {
  313. params.startTime = params.time[0];
  314. params.endTime = params.time[1];
  315. }
  316. delete params.time;
  317. // params.bizStatus = 1;
  318. const res = await outin.list({
  319. pageNum: page,
  320. size: limit,
  321. bizStatus: 2,
  322. ...params,
  323. type: 2
  324. });
  325. return res;
  326. },
  327. getAuditStatus: useDict(auditStatus),
  328. getList() {
  329. this.$refs.table.reload();
  330. },
  331. add() {
  332. this.$router.push({
  333. path: '/warehouseManagement/outgoingManagement/add'
  334. });
  335. },
  336. details(row) {
  337. this.$router.push({
  338. path: '/warehouseManagement/outgoingManagement/details',
  339. query: {
  340. id: row.id
  341. }
  342. });
  343. },
  344. handleCurrentChange() {
  345. this.getList();
  346. },
  347. handleSizeChange() {
  348. this.formData.page = 1;
  349. this.getList();
  350. },
  351. search() {
  352. this.formData.page = 1;
  353. this.getList();
  354. },
  355. reset() {
  356. this.$refs.formName.resetFields();
  357. this.search();
  358. }
  359. }
  360. };
  361. </script>
  362. <style lang="scss">
  363. .outgoingManagement_index {
  364. height: 100%;
  365. width: 100%;
  366. padding: 10px;
  367. box-sizing: border-box;
  368. .el-card {
  369. height: 100%;
  370. .el-card__body {
  371. height: 100%;
  372. box-sizing: border-box;
  373. display: flex;
  374. flex-direction: column;
  375. .ele-pro-table {
  376. flex: 1;
  377. display: flex;
  378. flex-direction: column;
  379. }
  380. }
  381. }
  382. .w100 {
  383. width: 100% !important;
  384. }
  385. .p20 {
  386. padding: 20px;
  387. }
  388. .mt20 {
  389. margin-top: 20px;
  390. }
  391. .mt10 {
  392. margin-top: 10px;
  393. }
  394. .el-form {
  395. overflow: hidden;
  396. }
  397. .float-right {
  398. float: right;
  399. text-align: right;
  400. margin-right: 20px;
  401. }
  402. .right {
  403. text-align: right;
  404. }
  405. .col {
  406. color: #aaa;
  407. }
  408. .pr10 {
  409. padding-right: 10px;
  410. }
  411. }
  412. </style>