allot_list.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <Collapse :screen-form="screenForm">
  7. <template #right_btn>
  8. <el-button size="mini" @click="resetScreenForm">清空</el-button>
  9. <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
  10. </template>
  11. <template #search>
  12. <el-form ref="screenForm" :model="screenForm" label-width="120px" size="mini" label-position="left">
  13. <el-row :gutter="20">
  14. <el-col :xs="24" :sm="12" :lg="6">
  15. <el-form-item label="单据编号" prop="orderNum">
  16. <el-input v-model="screenForm.orderNum" placeholder="请输入单据编号"></el-input>
  17. </el-form-item>
  18. </el-col>
  19. <el-col :xs="24" :sm="12" :lg="6">
  20. <el-form-item label="产品名称" prop="wlName">
  21. <el-input v-model="screenForm.wlName" placeholder="请输入产品名称"></el-input>
  22. </el-form-item>
  23. </el-col>
  24. <el-col :xs="24" :sm="12" :lg="6">
  25. <el-form-item label="提货日期" prop="date">
  26. <el-date-picker
  27. v-model="screenForm.date"
  28. type="datetimerange"
  29. :default-time="['00:00:00','23:59:59']"
  30. range-separator="至"
  31. style="width: 100%"
  32. start-placeholder="开始日期"
  33. end-placeholder="结束日期"
  34. >
  35. </el-date-picker>
  36. </el-form-item>
  37. </el-col>
  38. </el-row>
  39. </el-form>
  40. </template>
  41. </Collapse>
  42. </div>
  43. <div class="mymain-container">
  44. <div class="btn-group clearfix">
  45. <div class="fr">
  46. <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
  47. </div>
  48. </div>
  49. <div class="table">
  50. <el-table
  51. v-loading="listLoading"
  52. :data="dataList"
  53. element-loading-text="Loading"
  54. border
  55. fit
  56. highlight-current-row
  57. stripe
  58. >
  59. <el-table-column
  60. align="center"
  61. label="单据编号"
  62. prop="billNo"
  63. min-width="160"
  64. show-overflow-tooltip
  65. ></el-table-column>
  66. <el-table-column
  67. align="center"
  68. label="单据类型"
  69. prop="billType"
  70. min-width="160"
  71. show-overflow-tooltip
  72. ></el-table-column>
  73. <el-table-column
  74. align="center"
  75. label="调拨类型"
  76. prop="transferBizType"
  77. min-width="120"
  78. show-overflow-tooltip
  79. >
  80. <template slot-scope="scope">
  81. {{ scope.row.transferBizType | allotTypeFilter }}
  82. </template>
  83. </el-table-column>
  84. <el-table-column
  85. align="center"
  86. label="申请日期"
  87. prop="fDate"
  88. min-width="160"
  89. show-overflow-tooltip
  90. ></el-table-column>
  91. <el-table-column
  92. align="center"
  93. label="单据状态"
  94. prop="documentStatus"
  95. min-width="100"
  96. show-overflow-tooltip
  97. >
  98. <template slot-scope="scope">
  99. {{ scope.row.documentStatus | orderStatusFilter }}
  100. </template>
  101. </el-table-column>
  102. <el-table-column align="center" label="关闭状态" prop="cancelStatus" min-width="100" show-overflow-tooltip>
  103. <template slot-scope="scope">
  104. {{ scope.row.cancelStatus | closeStatusFilter }}
  105. </template>
  106. </el-table-column>
  107. <el-table-column
  108. align="center"
  109. label="物料编码"
  110. prop="materialNumber"
  111. min-width="120"
  112. show-overflow-tooltip
  113. ></el-table-column>
  114. <el-table-column
  115. align="center"
  116. label="产品名称"
  117. prop="materialName"
  118. min-width="160"
  119. show-overflow-tooltip
  120. ></el-table-column>
  121. <el-table-column
  122. align="center"
  123. label="规格型号"
  124. prop="model"
  125. min-width="240"
  126. show-overflow-tooltip
  127. ></el-table-column>
  128. <el-table-column
  129. align="center"
  130. label="辅助属性"
  131. prop="auxPropId"
  132. min-width="100"
  133. show-overflow-tooltip
  134. ></el-table-column>
  135. <el-table-column
  136. align="center"
  137. label="单位"
  138. prop="baseUnitId"
  139. min-width="100"
  140. show-overflow-tooltip
  141. ></el-table-column>
  142. <el-table-column
  143. align="center"
  144. label="申请数量"
  145. prop="qty"
  146. min-width="100"
  147. show-overflow-tooltip
  148. ></el-table-column>
  149. <el-table-column
  150. align="center"
  151. label="调出仓库"
  152. prop="srcStockName"
  153. min-width="100"
  154. show-overflow-tooltip
  155. ></el-table-column>
  156. <el-table-column
  157. align="center"
  158. label="调入仓库"
  159. prop="destStockName"
  160. min-width="100"
  161. show-overflow-tooltip
  162. ></el-table-column>
  163. <el-table-column align="center" label="操作" width="100" fixed="right">
  164. <template slot-scope="scope">
  165. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  166. </template>
  167. </el-table-column>
  168. </el-table>
  169. </div>
  170. </div>
  171. <div class="pagination clearfix">
  172. <div class="fr">
  173. <el-pagination
  174. @size-change="handleSizeChange"
  175. @current-change="handleCurrentChange"
  176. :current-page="currentPage"
  177. :page-sizes="[10, 20, 30, 50]"
  178. :page-size="10"
  179. layout="total, sizes, prev, pager, next, jumper"
  180. :total="listTotal"
  181. >
  182. </el-pagination>
  183. </div>
  184. </div>
  185. </div>
  186. <AllotDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  187. </div>
  188. </template>
  189. <script>
  190. import { getList } from '@/api/supply/allot'
  191. import AllotDetail from '@/views/supply/allot/components/allot_detail'
  192. export default {
  193. components: {
  194. AllotDetail
  195. },
  196. filters: {
  197. allotTypeFilter(val) {
  198. const MAP = {
  199. InnerOrgTransfer: '组织内调拨',
  200. OverOrgTransfer: '跨组织调拨'
  201. }
  202. return MAP[val]
  203. },
  204. closeStatusFilter(val) {
  205. const MAP = {
  206. A: '正常',
  207. B: '作废'
  208. }
  209. return MAP[val]
  210. },
  211. orderStatusFilter(val) {
  212. const MAP = {
  213. C: '审核'
  214. }
  215. return MAP[val]
  216. }
  217. },
  218. data() {
  219. return {
  220. currentPage: 1, // 当前页码
  221. pageSize: 10, // 每页数量
  222. listTotal: 0, // 列表总数
  223. dataList: null, // 列表数据
  224. listLoading: false, // 列表加载loading
  225. screenForm: {
  226. // 筛选表单数据
  227. orderNum: '',
  228. wlName: '',
  229. date: []
  230. },
  231. isCollapse: true,
  232. queryItem: {}
  233. }
  234. },
  235. computed: {
  236. exParams() {
  237. return {
  238. billNo: this.screenForm.orderNum,
  239. materialName: this.screenForm.wlName,
  240. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  241. endTime: this.screenForm.date ? this.screenForm.date[1] : ''
  242. }
  243. },
  244. isShowDetail() {
  245. return this.queryItem.hasOwnProperty('id')
  246. }
  247. },
  248. created() {
  249. this.getList()
  250. },
  251. methods: {
  252. // 查询按钮权限
  253. checkBtnRole(value) {
  254. // let btnRole = this.$route.meta.roles;
  255. // if(!btnRole) {return true}
  256. // let index = btnRole.indexOf(value);
  257. // return index >= 0;
  258. return true
  259. },
  260. // 查询列表
  261. getList() {
  262. this.listLoading = true
  263. let params = {
  264. pageNum: this.currentPage,
  265. pageSize: this.pageSize,
  266. billNo: this.screenForm.orderNum,
  267. materialName: this.screenForm.wlName,
  268. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  269. endTime: this.screenForm.date ? this.screenForm.date[1] : ''
  270. }
  271. getList(params).then(res => {
  272. this.dataList = res.data.records
  273. this.listTotal = res.data.total
  274. this.listLoading = false
  275. })
  276. },
  277. // 提交筛选表单
  278. submitScreenForm() {
  279. this.currentPage = 1
  280. this.getList()
  281. },
  282. // 重置筛选表单
  283. resetScreenForm() {
  284. this.$refs.screenForm.resetFields()
  285. this.currentPage = 1
  286. this.getList()
  287. },
  288. // 更改每页数量
  289. handleSizeChange(val) {
  290. this.pageSize = val
  291. this.currentPage = 1
  292. this.getList()
  293. },
  294. // 更改当前页
  295. handleCurrentChange(val) {
  296. this.currentPage = val
  297. this.getList()
  298. },
  299. // 进入详情
  300. toDetail(item) {
  301. this.queryItem = item
  302. },
  303. backList() {
  304. this.queryItem = {}
  305. }
  306. }
  307. }
  308. </script>
  309. <style lang="scss" scoped></style>