Issue_list.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <!-- 退料单-->
  3. <div class="app-container">
  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="billNo">
  16. <el-input v-model="screenForm.billNo" placeholder="请输入单据编号" />
  17. </el-form-item>
  18. </el-col>
  19. <el-col :xs="24" :sm="12" :lg="6">
  20. <el-form-item label="产品名称" prop="materialName">
  21. <el-input v-model="screenForm.materialName" placeholder="请输入产品名称" />
  22. </el-form-item>
  23. </el-col>
  24. <el-col :xs="24" :sm="12" :lg="6">
  25. <el-form-item label="物料编码" prop="materialNumber">
  26. <el-input v-model="screenForm.materialNumber" placeholder="请输入物料编码" />
  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-form-item>
  41. </el-col>
  42. <!-- <el-col :xs="24" :sm="12" :lg="6">-->
  43. <!-- <el-form-item label="货主" prop="company">-->
  44. <!-- <el-input-->
  45. <!-- v-model="screenForm.company"-->
  46. <!-- placeholder="请输入供货单位"-->
  47. <!-- />-->
  48. <!-- </el-form-item>-->
  49. <!-- </el-col>-->
  50. <el-col :xs="24" :sm="12" :lg="6">
  51. <el-form-item label="仓库" prop="correspondId">
  52. <el-select
  53. v-model="screenForm.correspondId"
  54. multiple
  55. style="width: 100%"
  56. placeholder="请选择仓库"
  57. size="mini"
  58. filterable
  59. clearable
  60. >
  61. <el-option
  62. v-for="(item, index) in warehouseList"
  63. :key="index"
  64. :label="item.name"
  65. :value="item.id"
  66. />
  67. </el-select>
  68. </el-form-item>
  69. </el-col>
  70. </el-row>
  71. </el-form>
  72. </template>
  73. </Collapse>
  74. </div>
  75. <div class="mymain-container">
  76. <div class="btn-group clearfix">
  77. <!-- <div class="fr">-->
  78. <!-- <ExportButton-->
  79. <!-- :ex-url="'admin/user/mch/export'"-->
  80. <!-- :ex-params="exParams"-->
  81. <!-- />-->
  82. <!-- </div>-->
  83. </div>
  84. <div class="table">
  85. <el-table
  86. v-loading="listLoading"
  87. :data="dataList"
  88. element-loading-text="Loading"
  89. border
  90. fit
  91. highlight-current-row
  92. stripe
  93. show-summary
  94. :summary-method="$getSummaries"
  95. >
  96. <el-table-column label="序号" align="left" width="50" type="index" show-overflow-tooltip></el-table-column>
  97. <el-table-column align="left" label="单据编号" prop="billNo" min-width="130" show-overflow-tooltip>
  98. <template slot-scope="scope">
  99. <CopyButton :copy-text="scope.row.billNo" />
  100. <span>{{ scope.row.billNo }}</span>
  101. </template>
  102. </el-table-column>
  103. <el-table-column align="left" label="库存方向" prop="stockId" min-width="100" show-overflow-tooltip>
  104. <template v-slot="scope">
  105. {{ '普通' }}
  106. </template>
  107. </el-table-column>
  108. <el-table-column align="left" label="退料日期" prop="fdate" min-width="120" show-overflow-tooltip>
  109. <template slot-scope="scope">
  110. {{ scope.row.fdate | dateToDayFilter }}
  111. </template>
  112. </el-table-column>
  113. <el-table-column align="left" label="单据状态" prop="fdDocumentStatus" min-width="120" show-overflow-tooltip>
  114. <template v-slot="scope">
  115. {{ scope.row.fdDocumentStatus === 'C' ? '已审核' : '' }}
  116. </template>
  117. </el-table-column>
  118. <el-table-column align="left" label="入库类型" min-width="100" show-overflow-tooltip>
  119. <template v-slot="scope">
  120. {{ '其他入库' }}
  121. </template>
  122. </el-table-column>
  123. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="200" show-overflow-tooltip>
  124. <template slot-scope="scope">
  125. <CopyButton :copy-text="scope.row.materialOldNumber" />
  126. <span>{{ scope.row.materialOldNumber }}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="200" show-overflow-tooltip>
  130. <template slot-scope="scope">
  131. <CopyButton :copy-text="scope.row.materialNumber" />
  132. <span>{{ scope.row.materialNumber }}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column align="left" label="产品名称" prop="materialName" min-width="200" show-overflow-tooltip>
  136. <template slot-scope="scope">
  137. <CopyButton :copy-text="scope.row.materialName" />
  138. <span>{{ scope.row.materialName }}</span>
  139. </template>
  140. </el-table-column>
  141. <el-table-column align="left" label="规格型号" prop="specification" min-width="300" show-overflow-tooltip>
  142. <template slot-scope="scope">
  143. <CopyButton :copy-text="scope.row.specification" />
  144. <span>{{ scope.row.specification }}</span>
  145. </template>
  146. </el-table-column>
  147. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip>
  148. </el-table-column>
  149. <el-table-column align="right" label="实收数量" prop="qty" min-width="100" show-overflow-tooltip>
  150. </el-table-column>
  151. <el-table-column align="left" label="收货仓库" prop="stockName" min-width="100" show-overflow-tooltip>
  152. </el-table-column>
  153. <el-table-column align="center" label="操作" width="100" fixed="right">
  154. <template slot-scope="scope">
  155. <el-popconfirm title="弃审吗?" @onConfirm="handleUnapprove(scope.row.id, scope.row.billNo)">
  156. <el-button slot="reference" type="text">弃审</el-button>
  157. </el-popconfirm>
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. </div>
  162. </div>
  163. <div class="pagination clearfix">
  164. <div class="fr">
  165. <el-pagination
  166. :current-page="currentPage"
  167. :page-sizes="[10, 20, 30, 50]"
  168. :page-size="10"
  169. layout="total, sizes, prev, pager, next, jumper"
  170. :total="listTotal"
  171. @size-change="handleSizeChange"
  172. @current-change="handleCurrentChange"
  173. />
  174. </div>
  175. </div>
  176. </div>
  177. </template>
  178. <script>
  179. import { getOtherStockInList, setApprovalPurchaseOrderIn } from '@/api/supply/purchase'
  180. import { getWarehouseList } from '@/api/supply/apply'
  181. export default {
  182. name: 'MaterialList',
  183. data() {
  184. return {
  185. currentPage: 1, // 当前页码
  186. pageSize: 10, // 每页数量
  187. listTotal: 0, // 列表总数
  188. dataList: null, // 列表数据
  189. listLoading: false, // 列表加载loading
  190. screenForm: {
  191. billNo: '',
  192. correspondId: [],
  193. endTime: '',
  194. materialName: '',
  195. date: '',
  196. materialNumber: '',
  197. materialOldNumber: '',
  198. specification: '',
  199. startTime: ''
  200. },
  201. isCollapse: true,
  202. warehouseList: []
  203. }
  204. },
  205. computed: {
  206. exParams() {
  207. return {
  208. billNo: this.screenForm.billNo,
  209. correspondId: this.screenForm.correspondId.join(','),
  210. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  211. materialName: this.screenForm.materialName,
  212. materialNumber: this.screenForm.materialNumber,
  213. materialOldNumber: this.screenForm.materialOldNumber,
  214. specification: this.screenForm.specification,
  215. startTime: this.screenForm.date ? this.screenForm.date[0] : ''
  216. }
  217. },
  218. isShowDetail() {
  219. // eslint-disable-next-line no-prototype-builtins
  220. return this.queryItem.hasOwnProperty('id')
  221. }
  222. },
  223. created() {
  224. this.getWarehouseList()
  225. this.getList()
  226. },
  227. methods: {
  228. // 查询按钮权限
  229. checkBtnRole(value) {
  230. // let btnRole = this.$route.meta.roles;
  231. // if(!btnRole) {return true}
  232. // let index = btnRole.indexOf(value);
  233. // return index >= 0;
  234. return true
  235. },
  236. // 获取仓库列表
  237. getWarehouseList() {
  238. getWarehouseList({
  239. pageNum: 1,
  240. pageSize: -1
  241. }).then(res => {
  242. this.warehouseList = res.data.records
  243. })
  244. },
  245. handleUnapprove(id, billNo) {
  246. setApprovalPurchaseOrderIn({ id, billNo }).then(res => {
  247. this.$successMsg('弃审成功')
  248. this.getList()
  249. })
  250. },
  251. // 查询列表
  252. getList() {
  253. this.listLoading = true
  254. const params = {
  255. pageNum: this.currentPage,
  256. pageSize: this.pageSize,
  257. billNo: this.screenForm.billNo,
  258. correspondId: this.screenForm.correspondId.join(','),
  259. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  260. materialName: this.screenForm.materialName,
  261. materialNumber: this.screenForm.materialNumber,
  262. materialOldNumber: this.screenForm.materialOldNumber,
  263. specification: this.screenForm.specification,
  264. startTime: this.screenForm.date ? this.screenForm.date[0] : ''
  265. }
  266. getOtherStockInList(params).then(res => {
  267. res.data.records.forEach(item => {
  268. item.sums1 = ['auxUnitQty']
  269. item.sums2 = ['taxPrice', 'amount', 'entryTaxAmount', 'allAmount']
  270. })
  271. this.dataList = res.data.records
  272. this.listTotal = res.data.total
  273. this.listLoading = false
  274. })
  275. },
  276. // 提交筛选表单
  277. submitScreenForm() {
  278. this.currentPage = 1
  279. this.getList()
  280. },
  281. // 重置筛选表单
  282. resetScreenForm() {
  283. this.$refs.screenForm.resetFields()
  284. this.currentPage = 1
  285. this.getList()
  286. },
  287. // 更改每页数量
  288. handleSizeChange(val) {
  289. this.pageSize = val
  290. this.currentPage = 1
  291. this.getList()
  292. },
  293. // 更改当前页
  294. handleCurrentChange(val) {
  295. this.currentPage = val
  296. this.getList()
  297. },
  298. // 进入详情
  299. toDetail(item) {
  300. this.queryItem = item
  301. },
  302. backList() {
  303. this.queryItem = {}
  304. }
  305. }
  306. }
  307. </script>
  308. <style scoped></style>