index.vue 10 KB

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