enter_list.vue 12 KB

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