index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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 + -1].class">
  108. {{ status[row.verifyStatus - 1].label }}
  109. </span>
  110. </template>
  111. <!-- 单号链接 -->
  112. <template v-slot:bizNum="{ row }">
  113. <el-link @click="details(row)">
  114. {{ row.bizNum }}
  115. </el-link>
  116. </template>
  117. <!-- 操作列 -->
  118. <template v-slot:action="{ row }">
  119. <el-link
  120. type="primary"
  121. :underline="false"
  122. icon="el-icon-view"
  123. @click="details(row)"
  124. >
  125. 查看详情
  126. </el-link>
  127. </template>
  128. </ele-pro-table>
  129. </el-card>
  130. </div>
  131. </template>
  132. <script>
  133. import outin from '@/api/warehouseManagement/outin';
  134. import {
  135. warehousingType,
  136. sceneState,
  137. auditStatus,
  138. useDict
  139. } from '@/utils/dict/index';
  140. // import { getPage } from '@/api/stockManagement'
  141. // import { deepClone } from '@/utils'
  142. export default {
  143. // components: { tablePagination },
  144. data() {
  145. return {
  146. auditStatus,
  147. warehousingType,
  148. sceneState,
  149. tableData: [],
  150. formData: {
  151. bizNum: '',
  152. deliveryName: '',
  153. time: [],
  154. verifyStatus: ''
  155. // type: 1
  156. },
  157. total: 0,
  158. status: [
  159. { label: '待审核', class: 'ele-text-primary' },
  160. { label: '驳回', class: 'ele-text-danger' },
  161. { label: '通过', class: 'ele-text-success' } // 审核状态 1未审核 2
  162. ],
  163. columns: [
  164. {
  165. type: 'index',
  166. label: '序号',
  167. width: 50,
  168. align: 'center'
  169. },
  170. {
  171. prop: 'bizNum',
  172. label: '单号',
  173. align: 'center',
  174. slot: 'bizNum',
  175. showOverflowTooltip: true,
  176. width: 140
  177. },
  178. {
  179. prop: 'assetCode',
  180. label: '编码',
  181. align: 'center',
  182. showOverflowTooltip: true
  183. },
  184. {
  185. prop: 'assetName',
  186. label: '名称',
  187. align: 'center'
  188. },
  189. {
  190. prop: '',
  191. label: '牌号',
  192. align: 'center',
  193. showOverflowTooltip: true
  194. },
  195. {
  196. prop: '',
  197. label: '型号',
  198. align: 'center',
  199. showOverflowTooltip: true
  200. },
  201. {
  202. prop: '',
  203. label: '数量',
  204. align: 'center',
  205. showOverflowTooltip: true
  206. },
  207. {
  208. prop: '',
  209. label: '计量单位',
  210. align: 'center',
  211. showOverflowTooltip: true
  212. },
  213. {
  214. prop: '',
  215. label: '重量单位',
  216. align: 'center',
  217. showOverflowTooltip: true
  218. },
  219. {
  220. prop: 'verifyStatus',
  221. label: '状态',
  222. align: 'center',
  223. slot: 'verifyStatus',
  224. showOverflowTooltip: true
  225. },
  226. {
  227. prop: 'documentSource',
  228. label: '来源单据',
  229. align: 'center',
  230. showOverflowTooltip: true
  231. },
  232. {
  233. prop: 'createUserName',
  234. label: '入库人',
  235. align: 'center',
  236. showOverflowTooltip: true
  237. },
  238. {
  239. prop: 'createTime',
  240. label: '入库时间',
  241. align: 'center',
  242. showOverflowTooltip: true
  243. },
  244. {
  245. columnKey: 'action',
  246. label: '操作',
  247. width: 100,
  248. align: 'center',
  249. slot: 'action',
  250. showOverflowTooltip: true
  251. }
  252. ]
  253. };
  254. },
  255. created() {},
  256. methods: {
  257. async datasource({ page, limit, where }) {
  258. const params = Object.assign({}, this.formData);
  259. if (params.time?.length) {
  260. params.startTime = params.time[0];
  261. params.endTime = params.time[1];
  262. }
  263. delete params.time;
  264. // params.bizStatus = 1;
  265. const res = await outin.list({
  266. pageNum: page,
  267. size: limit,
  268. type: 1,
  269. ...params,
  270. bizStatus: 1
  271. });
  272. return res;
  273. },
  274. getAuditStatus: useDict(auditStatus),
  275. getList() {
  276. this.$refs.table.reload();
  277. },
  278. add(row) {
  279. const query = {};
  280. if (row?.id) {
  281. query.id = row.id;
  282. }
  283. this.$router.push({
  284. path: '/warehouseManagement/stockManagement/add'
  285. // query
  286. });
  287. },
  288. details(row) {
  289. this.$router.push({
  290. path: '/warehouseManagement/stockManagement/details',
  291. query: {
  292. id: row.id
  293. }
  294. });
  295. },
  296. handleCurrentChange() {
  297. this.getList();
  298. },
  299. handleSizeChange() {
  300. this.formData.page = 1;
  301. this.getList();
  302. },
  303. search() {
  304. this.formData.page = 1;
  305. this.getList();
  306. },
  307. reset() {
  308. this.$refs.formName.resetFields();
  309. this.search();
  310. }
  311. }
  312. };
  313. </script>
  314. <style lang="scss" scoped>
  315. .w100 {
  316. width: 100% !important;
  317. }
  318. .p20 {
  319. padding: 20px;
  320. }
  321. .mt20 {
  322. margin-top: 20px;
  323. }
  324. .mt10 {
  325. margin-top: 10px;
  326. }
  327. .el-form {
  328. overflow: hidden;
  329. }
  330. .float-right {
  331. float: right;
  332. text-align: right;
  333. margin-right: 20px;
  334. }
  335. .right {
  336. text-align: right;
  337. }
  338. .col {
  339. color: #aaa;
  340. }
  341. .pr10 {
  342. padding-right: 10px;
  343. }
  344. </style>