index.vue 10 KB

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