allot_list.vue 8.1 KB

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