enter_list.vue 12 KB

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