index.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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="5">
  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="bizNum">
  21. <el-input
  22. size="small"
  23. class="w100"
  24. placeholder="请输入"
  25. v-model="formData.bizNum"
  26. ></el-input> </el-form-item
  27. ></el-col>
  28. <el-col :span="4">
  29. <el-form-item label="编码" prop="assetCode">
  30. <el-input
  31. size="small"
  32. class="w100"
  33. placeholder="请输入"
  34. v-model="formData.assetCode"
  35. ></el-input> </el-form-item
  36. ></el-col>
  37. <el-col :span="4">
  38. <el-form-item label="名称" prop="assetName">
  39. <el-input
  40. size="small"
  41. class="w100"
  42. placeholder="请输入"
  43. v-model="formData.assetName"
  44. ></el-input> </el-form-item
  45. ></el-col>
  46. <el-col :span="4">
  47. <el-form-item label="状态" prop="verifyStatus">
  48. <el-select
  49. filterable
  50. size="small"
  51. class="w100"
  52. v-model="formData.verifyStatus"
  53. placeholder="请选择"
  54. clearable
  55. >
  56. <el-option
  57. v-for="item in auditStatus"
  58. :key="item.code"
  59. :value="item.code"
  60. :label="item.label"
  61. ></el-option>
  62. </el-select> </el-form-item
  63. ></el-col>
  64. <!-- <el-col :lg="6" :sm="8" :xs="8">
  65. <el-form-item label="创建时间" prop="time">
  66. <el-date-picker
  67. class="w100"
  68. size="small"
  69. v-model="formData.time"
  70. type="daterange"
  71. range-separator="至"
  72. start-placeholder="开始日期"
  73. end-placeholder="结束日期"
  74. value-format="yyyy-MM-dd"
  75. ></el-date-picker> </el-form-item
  76. ></el-col> -->
  77. <el-col :span="3">
  78. <div>
  79. <el-button icon="el-icon-refresh-left" size="small" @click="reset"
  80. >重置</el-button
  81. >
  82. <el-button
  83. type="primary"
  84. icon="el-icon-search"
  85. size="small"
  86. @click="search"
  87. >搜索</el-button
  88. >
  89. </div></el-col
  90. >
  91. </el-row>
  92. </el-form>
  93. <ele-pro-table
  94. ref="table"
  95. :columns="columns"
  96. :datasource="datasource"
  97. cache-key="systemRoleTable"
  98. >
  99. <!-- 表头工具栏 -->
  100. <template v-slot:toolbar>
  101. <el-button icon="el-icon-plus" type="primary" @click="add"
  102. >新建</el-button
  103. >
  104. </template>
  105. <!-- 状态 -->
  106. <template v-slot:verifyStatus="{ row }">
  107. <span :class="status[row.verifyStatus].class">
  108. {{ status[row.verifyStatus].label }}
  109. </span>
  110. </template>
  111. <!-- 单号链接 -->
  112. <template v-slot:bizNo="{ row }">
  113. <el-link @click="details(row)">
  114. {{ row.bizNo }}
  115. </el-link>
  116. </template>
  117. <!-- 操作列 -->
  118. <template v-slot:action="{ row }">
  119. <el-link
  120. type="success"
  121. :underline="false"
  122. icon="el-icon-position"
  123. v-if="row.verifyStatus == 0 || row.verifyStatus == 3"
  124. @click="submit(row)"
  125. >
  126. 提交
  127. </el-link>
  128. <el-link
  129. type="warning"
  130. :underline="false"
  131. icon="el-icon-edit"
  132. v-if="row.verifyStatus == 3"
  133. @click="edit(row)"
  134. >
  135. 编辑
  136. </el-link>
  137. <el-link
  138. type="primary"
  139. :underline="false"
  140. icon="el-icon-view"
  141. @click="details(row)"
  142. >
  143. 查看详情
  144. </el-link>
  145. </template>
  146. <template v-slot:bizType="{ row }">
  147. {{ handleBizType(row.bizType) }}
  148. </template>
  149. </ele-pro-table>
  150. </el-card>
  151. </div>
  152. </template>
  153. <script>
  154. import outin from '@/api/warehouseManagement/outin';
  155. import {
  156. warehousingType,
  157. sceneState,
  158. auditStatus,
  159. useDict
  160. } 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. warehousingType,
  169. sceneState,
  170. tableData: [],
  171. formData: {
  172. bizNum: '',
  173. deliveryName: '',
  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: 150
  199. },
  200. {
  201. prop: 'bizType',
  202. slot: 'bizType',
  203. label: '入库类型',
  204. align: 'center',
  205. showOverflowTooltip: true,
  206. width: 150
  207. },
  208. {
  209. prop: 'extInfo.documentSource',
  210. label: '来源单据',
  211. align: 'center',
  212. showOverflowTooltip: true
  213. },
  214. {
  215. prop: 'createUserName',
  216. label: '入库人',
  217. align: 'center',
  218. showOverflowTooltip: true
  219. },
  220. {
  221. width: 160,
  222. prop: 'createTime',
  223. label: '入库时间',
  224. align: 'center',
  225. showOverflowTooltip: true
  226. },
  227. {
  228. prop: 'verifyName',
  229. label: '审核人',
  230. align: 'center',
  231. showOverflowTooltip: true
  232. },
  233. {
  234. prop: 'verifyStatus',
  235. label: '状态',
  236. align: 'center',
  237. slot: 'verifyStatus',
  238. showOverflowTooltip: true,
  239. width: 100
  240. },
  241. {
  242. columnKey: 'action',
  243. label: '操作',
  244. width: 250,
  245. align: 'center',
  246. slot: 'action',
  247. showOverflowTooltip: true
  248. }
  249. ]
  250. };
  251. },
  252. created() {},
  253. methods: {
  254. submit(row) {
  255. this.$confirm('此操作将提交流程, 是否继续?', '提示', {
  256. confirmButtonText: '确定',
  257. cancelButtonText: '取消',
  258. type: 'warning'
  259. })
  260. .then(async () => {
  261. const data = await outin.outinApprove({ outInId: row.id });
  262. if (data) {
  263. this.$message.success('流程发起成功!');
  264. this.getList();
  265. }
  266. })
  267. .catch(() => {});
  268. },
  269. handleBizType(code) {
  270. for (const key in this.sceneState) {
  271. if (this.sceneState[key].code == code) {
  272. return this.sceneState[key].label;
  273. }
  274. }
  275. },
  276. async datasource({ page, limit, where }) {
  277. const params = Object.assign({}, this.formData);
  278. if (params.time?.length) {
  279. params.startTime = params.time[0];
  280. params.endTime = params.time[1];
  281. }
  282. delete params.time;
  283. // params.bizStatus = 1;
  284. const res = await outin.list({
  285. pageNum: page,
  286. size: limit,
  287. type: 1,
  288. ...params,
  289. bizStatus: 1
  290. });
  291. return res;
  292. },
  293. getAuditStatus: useDict(auditStatus),
  294. getList() {
  295. this.$refs.table.reload();
  296. },
  297. add(row) {
  298. const query = {};
  299. if (row?.id) {
  300. query.id = row.id;
  301. }
  302. this.$router.push({
  303. path: '/warehouseManagement/stockManagement/add'
  304. // query
  305. });
  306. },
  307. edit(row) {
  308. this.$router.push({
  309. path: '/warehouseManagement/stockManagement/edit',
  310. query: {
  311. id: row.id
  312. }
  313. });
  314. },
  315. details(row) {
  316. this.$router.push({
  317. path: '/warehouseManagement/stockManagement/details',
  318. query: {
  319. id: row.id
  320. }
  321. });
  322. },
  323. handleCurrentChange() {
  324. this.getList();
  325. },
  326. handleSizeChange() {
  327. this.formData.page = 1;
  328. this.getList();
  329. },
  330. search() {
  331. this.formData.page = 1;
  332. this.getList();
  333. },
  334. reset() {
  335. this.$refs.formName.resetFields();
  336. this.search();
  337. }
  338. }
  339. };
  340. </script>
  341. <style lang="scss" scoped>
  342. .w100 {
  343. width: 100% !important;
  344. }
  345. .p20 {
  346. padding: 20px;
  347. }
  348. .mt20 {
  349. margin-top: 20px;
  350. }
  351. .mt10 {
  352. margin-top: 10px;
  353. }
  354. .el-form {
  355. overflow: hidden;
  356. }
  357. .float-right {
  358. float: right;
  359. text-align: right;
  360. margin-right: 20px;
  361. }
  362. .right {
  363. text-align: right;
  364. }
  365. .col {
  366. color: #aaa;
  367. }
  368. .pr10 {
  369. padding-right: 10px;
  370. }
  371. </style>