warehousing_list.vue 11 KB

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