enter_list.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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="70px" 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="chName">
  15. <el-input v-model="screenForm.chName" 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="chNum">
  20. <el-input v-model="screenForm.chNum" placeholder="请输入产品编码"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :xs="24" :sm="12" :lg="6">
  24. <el-form-item label="入库日期" prop="date">
  25. <el-date-picker
  26. v-model="screenForm.date"
  27. type="datetimerange"
  28. range-separator="至"
  29. style="width: 100%;"
  30. value-format="yyyy-MM-dd HH:mm:ss"
  31. start-placeholder="开始日期"
  32. end-placeholder="结束日期">
  33. </el-date-picker>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :xs="24" :sm="12" :lg="6">
  37. <el-form-item label="供货单位" prop="company">
  38. <el-input v-model="screenForm.company" placeholder="请输入供货单位"></el-input>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :xs="24" :sm="12" :lg="18" class="tr">
  42. <el-form-item label="">
  43. <el-button size="small" @click="resetScreenForm">清空</el-button>
  44. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  45. </el-form-item>
  46. </el-col>
  47. </el-row>
  48. </el-form>
  49. </div>
  50. <div class="mymain-container">
  51. <div class="btn-group clearfix">
  52. <div class="fr">
  53. <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
  54. </div>
  55. </div>
  56. <div class="table">
  57. <el-table
  58. v-loading="listLoading"
  59. :data="dataList"
  60. element-loading-text="Loading"
  61. border
  62. fit
  63. highlight-current-row
  64. stripe
  65. show-summary
  66. :summary-method="$getSummaries">
  67. <el-table-column align="center" label="入库单号" prop="billNo" min-width="140" show-overflow-tooltip></el-table-column>
  68. <el-table-column align="center" label="入库日期" prop="fdate" min-width="120" show-overflow-tooltip>
  69. <template slot-scope="scope">
  70. {{scope.row.fdate | dateToDayFilter}}
  71. </template>
  72. </el-table-column>
  73. <el-table-column align="center" label="仓库" prop="stockId" min-width="120" show-overflow-tooltip></el-table-column>
  74. <el-table-column align="center" label="供货单位" prop="supplyName" min-width="200" show-overflow-tooltip></el-table-column>
  75. <el-table-column align="center" label="审核日期" prop="approveDate" min-width="160" show-overflow-tooltip></el-table-column>
  76. <el-table-column align="center" label="备注" prop="abcdRemarks" min-width="160" show-overflow-tooltip></el-table-column>
  77. <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="140" show-overflow-tooltip></el-table-column>
  78. <el-table-column align="center" label="产品名称" prop="materialName" min-width="140" show-overflow-tooltip></el-table-column>
  79. <el-table-column align="center" label="规格型号" prop="uom" min-width="200" show-overflow-tooltip></el-table-column>
  80. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  81. <el-table-column align="right" label="数量" prop="realQty" min-width="100" show-overflow-tooltip></el-table-column>
  82. <el-table-column align="right" label="原币含税单价" prop="taxPrice" min-width="120" show-overflow-tooltip>
  83. <template slot-scope="scope">
  84. {{scope.row.taxPrice | numToFixed}}
  85. </template>
  86. </el-table-column>
  87. <el-table-column align="right" label="原币金额" prop="amount" min-width="100" show-overflow-tooltip>
  88. <template slot-scope="scope">
  89. {{scope.row.amount | numToFixed}}
  90. </template>
  91. </el-table-column>
  92. <el-table-column align="right" label="原币税额" prop="entryTaxAmount" min-width="100" show-overflow-tooltip>
  93. <template slot-scope="scope">
  94. {{scope.row.entryTaxAmount | numToFixed}}
  95. </template>
  96. </el-table-column>
  97. <el-table-column align="right" label="原币价税合计" prop="allAmount" min-width="120" show-overflow-tooltip>
  98. <template slot-scope="scope">
  99. {{scope.row.allAmount | numToFixed}}
  100. </template>
  101. </el-table-column>
  102. <el-table-column align="center" label="税率" prop="entryTaxRate" min-width="100" show-overflow-tooltip></el-table-column>
  103. <el-table-column align="center" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
  104. <el-table-column align="center" label="审核人" prop="approverId" min-width="100" show-overflow-tooltip></el-table-column>
  105. <el-table-column align="center" label="操作" width="100" fixed="right">
  106. <template slot-scope="scope">
  107. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  108. </template>
  109. </el-table-column>
  110. </el-table>
  111. </div>
  112. </div>
  113. <div class="pagination clearfix">
  114. <div class="fr">
  115. <el-pagination
  116. @size-change="handleSizeChange"
  117. @current-change="handleCurrentChange"
  118. :current-page="currentPage"
  119. :page-sizes="[10, 20, 30, 50]"
  120. :page-size="10"
  121. layout="total, sizes, prev, pager, next, jumper"
  122. :total="listTotal">
  123. </el-pagination>
  124. </div>
  125. </div>
  126. </div>
  127. <EnterDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  128. </div>
  129. </template>
  130. <script>
  131. import { getEnterList } from "@/api/supply/purchase";
  132. import EnterDetail from "@/views/supply/purchase/components/enter_detail";
  133. export default {
  134. components: {
  135. EnterDetail,
  136. },
  137. data() {
  138. return {
  139. currentPage: 1, // 当前页码
  140. pageSize: 10, // 每页数量
  141. listTotal: 0, // 列表总数
  142. dataList: null, // 列表数据
  143. listLoading: false, // 列表加载loading
  144. screenForm: { // 筛选表单数据
  145. orderNum: '',
  146. chName: '',
  147. chNum: '',
  148. date: '',
  149. company: '',
  150. },
  151. queryItem: {},
  152. }
  153. },
  154. computed: {
  155. exParams() {
  156. return {
  157. billNo: this.screenForm.orderNum,
  158. materialName: this.screenForm.chName,
  159. materialCode: this.screenForm.chNum,
  160. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  161. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  162. supplyName: this.screenForm.company,
  163. }
  164. },
  165. isShowDetail() {
  166. return this.queryItem.hasOwnProperty('id');
  167. },
  168. },
  169. created() {
  170. this.getList();
  171. },
  172. methods: {
  173. // 查询按钮权限
  174. checkBtnRole(value) {
  175. // let btnRole = this.$route.meta.roles;
  176. // if(!btnRole) {return true}
  177. // let index = btnRole.indexOf(value);
  178. // return index >= 0;
  179. return true
  180. },
  181. // 查询列表
  182. getList() {
  183. this.listLoading = true;
  184. let params = {
  185. pageNum: this.currentPage,
  186. pageSize: this.pageSize,
  187. billNo: this.screenForm.orderNum,
  188. materialName: this.screenForm.chName,
  189. materialCode: this.screenForm.chNum,
  190. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  191. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  192. supplyName: this.screenForm.company,
  193. };
  194. getEnterList(params).then((res) => {
  195. res.data.records.forEach(item => {
  196. item.sums1 = ['auxUnitQty'];
  197. item.sums2 = ['taxPrice', 'amount', 'entryTaxAmount', 'allAmount'];
  198. })
  199. this.dataList = res.data.records;
  200. this.listTotal = res.data.total;
  201. this.listLoading = false;
  202. })
  203. },
  204. // 提交筛选表单
  205. submitScreenForm() {
  206. this.currentPage = 1;
  207. this.getList();
  208. },
  209. // 重置筛选表单
  210. resetScreenForm() {
  211. this.$refs.screenForm.resetFields();
  212. this.currentPage = 1;
  213. this.getList();
  214. },
  215. // 更改每页数量
  216. handleSizeChange(val) {
  217. this.pageSize = val;
  218. this.currentPage = 1;
  219. this.getList();
  220. },
  221. // 更改当前页
  222. handleCurrentChange(val) {
  223. this.currentPage = val;
  224. this.getList();
  225. },
  226. // 进入详情
  227. toDetail(item) {
  228. this.queryItem = item;
  229. },
  230. backList() {
  231. this.queryItem = {};
  232. },
  233. }
  234. }
  235. </script>
  236. <style lang="scss" scoped>
  237. </style>