Issue_list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. <template>
  2. <!-- 退料单-->
  3. <div class="app-container">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <Collapse :is-collapse="isCollapse" :screen-form="screenForm">
  7. <template #right_btn> </template>
  8. <template #search> </template>
  9. </Collapse>
  10. <el-form
  11. ref="screenForm"
  12. :model="screenForm"
  13. label-width="70px"
  14. size="mini"
  15. label-position="left"
  16. >
  17. <el-row :gutter="20">
  18. <el-col :xs="24" :sm="12" :lg="6">
  19. <el-form-item label="单据编号" prop="billNo">
  20. <el-input
  21. v-model="screenForm.billNo"
  22. placeholder="请输入单据编号"
  23. />
  24. </el-form-item>
  25. </el-col>
  26. <el-col :xs="24" :sm="12" :lg="6">
  27. <el-form-item label="产品名称" prop="materialName">
  28. <el-input
  29. v-model="screenForm.materialName"
  30. placeholder="请输入产品名称"
  31. />
  32. </el-form-item>
  33. </el-col>
  34. <el-col :xs="24" :sm="12" :lg="6">
  35. <el-form-item label="物料编码" prop="materialNumber">
  36. <el-input
  37. v-model="screenForm.materialNumber"
  38. placeholder="请输入物料编码"
  39. />
  40. </el-form-item>
  41. </el-col>
  42. <el-col :xs="24" :sm="12" :lg="6">
  43. <el-form-item label="日期" prop="date">
  44. <el-date-picker
  45. v-model="screenForm.date"
  46. type="datetimerange"
  47. range-separator="至"
  48. style="width: 100%"
  49. value-format="yyyy-MM-dd HH:mm:ss"
  50. start-placeholder="开始日期"
  51. end-placeholder="结束日期"
  52. />
  53. </el-form-item>
  54. </el-col>
  55. <!-- <el-col :xs="24" :sm="12" :lg="6">-->
  56. <!-- <el-form-item label="货主" prop="company">-->
  57. <!-- <el-input-->
  58. <!-- v-model="screenForm.company"-->
  59. <!-- placeholder="请输入供货单位"-->
  60. <!-- />-->
  61. <!-- </el-form-item>-->
  62. <!-- </el-col>-->
  63. <el-col :xs="24" :sm="12" :lg="6">
  64. <el-form-item label="仓库" prop="correspondId">
  65. <el-select
  66. v-model="screenForm.correspondId"
  67. multiple
  68. style="width: 100%"
  69. placeholder="请选择仓库"
  70. size="mini"
  71. filterable
  72. clearable
  73. >
  74. <el-option
  75. v-for="(item, index) in warehouseList"
  76. :key="index"
  77. :label="item.name"
  78. :value="item.id"
  79. />
  80. </el-select>
  81. </el-form-item>
  82. </el-col>
  83. <el-col :xs="24" :sm="12" :lg="18" class="tr">
  84. <el-form-item>
  85. <el-button size="mini" @click="resetScreenForm">清空</el-button>
  86. <el-button size="mini" type="primary" @click="submitScreenForm"
  87. >搜索</el-button
  88. >
  89. </el-form-item>
  90. </el-col>
  91. </el-row>
  92. </el-form>
  93. </div>
  94. <div class="mymain-container">
  95. <div class="btn-group clearfix">
  96. <!-- <div class="fr">-->
  97. <!-- <ExportButton-->
  98. <!-- :ex-url="'admin/user/mch/export'"-->
  99. <!-- :ex-params="exParams"-->
  100. <!-- />-->
  101. <!-- </div>-->
  102. </div>
  103. <div class="table">
  104. <el-table
  105. v-loading="listLoading"
  106. :data="dataList"
  107. element-loading-text="Loading"
  108. border
  109. fit
  110. highlight-current-row
  111. stripe
  112. show-summary
  113. :summary-method="$getSummaries"
  114. >
  115. <el-table-column
  116. label="序号"
  117. align="left"
  118. width="50"
  119. type="index"
  120. show-overflow-tooltip
  121. ></el-table-column>
  122. <el-table-column
  123. align="left"
  124. label="单据编号"
  125. prop="billNo"
  126. min-width="130"
  127. show-overflow-tooltip
  128. >
  129. <template slot-scope="scope">
  130. <CopyButton :copy-text="scope.row.billNo" />
  131. <span>{{ scope.row.billNo }}</span>
  132. </template>
  133. </el-table-column>
  134. <el-table-column
  135. align="left"
  136. label="库存方向"
  137. prop="stockId"
  138. min-width="100"
  139. show-overflow-tooltip
  140. >
  141. <template v-slot="scope">
  142. {{ "普通" }}
  143. </template>
  144. </el-table-column>
  145. <el-table-column
  146. align="left"
  147. label="退料日期"
  148. prop="fdate"
  149. min-width="120"
  150. show-overflow-tooltip
  151. >
  152. <template slot-scope="scope">
  153. {{ scope.row.fdate | dateToDayFilter }}
  154. </template>
  155. </el-table-column>
  156. <el-table-column
  157. align="left"
  158. label="单据状态"
  159. prop="fdDocumentStatus"
  160. min-width="120"
  161. show-overflow-tooltip
  162. >
  163. <template v-slot="scope">
  164. {{ scope.row.fdDocumentStatus === "C" ? "已审核" : "" }}
  165. </template>
  166. </el-table-column>
  167. <el-table-column
  168. align="left"
  169. label="入库类型"
  170. min-width="100"
  171. show-overflow-tooltip
  172. >
  173. <template v-slot="scope">
  174. {{ "其他入库" }}
  175. </template>
  176. </el-table-column>
  177. <el-table-column
  178. align="left"
  179. label="产品编码"
  180. prop="materialOldNumber"
  181. min-width="200"
  182. show-overflow-tooltip
  183. >
  184. <template slot-scope="scope">
  185. <CopyButton :copy-text="scope.row.materialOldNumber" />
  186. <span>{{ scope.row.materialOldNumber }}</span>
  187. </template>
  188. </el-table-column>
  189. <el-table-column
  190. align="left"
  191. label="物料编码"
  192. prop="materialNumber"
  193. min-width="200"
  194. show-overflow-tooltip
  195. >
  196. <template slot-scope="scope">
  197. <CopyButton :copy-text="scope.row.materialNumber" />
  198. <span>{{ scope.row.materialNumber }}</span>
  199. </template>
  200. </el-table-column>
  201. <el-table-column
  202. align="left"
  203. label="产品名称"
  204. prop="materialName"
  205. min-width="200"
  206. show-overflow-tooltip
  207. >
  208. <template slot-scope="scope">
  209. <CopyButton :copy-text="scope.row.materialName" />
  210. <span>{{ scope.row.materialName }}</span>
  211. </template>
  212. </el-table-column>
  213. <el-table-column
  214. align="left"
  215. label="规格型号"
  216. prop="specification"
  217. min-width="300"
  218. show-overflow-tooltip
  219. >
  220. <template slot-scope="scope">
  221. <CopyButton :copy-text="scope.row.specification" />
  222. <span>{{ scope.row.specification }}</span>
  223. </template>
  224. </el-table-column>
  225. <el-table-column
  226. align="left"
  227. label="单位"
  228. prop="unit"
  229. min-width="100"
  230. show-overflow-tooltip
  231. >
  232. </el-table-column>
  233. <el-table-column
  234. align="right"
  235. label="实收数量"
  236. prop="qty"
  237. min-width="100"
  238. show-overflow-tooltip
  239. >
  240. </el-table-column>
  241. <el-table-column
  242. align="left"
  243. label="收货仓库"
  244. prop="stockName"
  245. min-width="100"
  246. show-overflow-tooltip
  247. >
  248. </el-table-column>
  249. <el-table-column
  250. align="center"
  251. label="操作"
  252. width="100"
  253. fixed="right"
  254. >
  255. <template slot-scope="scope">
  256. <el-popconfirm
  257. title="弃审吗?"
  258. @onConfirm="handleUnapprove(scope.row.id, scope.row.billNo)"
  259. >
  260. <el-button slot="reference" type="text">弃审</el-button>
  261. </el-popconfirm>
  262. </template>
  263. </el-table-column>
  264. </el-table>
  265. </div>
  266. </div>
  267. <div class="pagination clearfix">
  268. <div class="fr">
  269. <el-pagination
  270. :current-page="currentPage"
  271. :page-sizes="[10, 20, 30, 50]"
  272. :page-size="10"
  273. layout="total, sizes, prev, pager, next, jumper"
  274. :total="listTotal"
  275. @size-change="handleSizeChange"
  276. @current-change="handleCurrentChange"
  277. />
  278. </div>
  279. </div>
  280. </div>
  281. </template>
  282. <script>
  283. import {
  284. getOtherStockInList,
  285. setApprovalPurchaseOrderIn,
  286. } from "@/api/supply/purchase";
  287. import { getWarehouseList } from "@/api/supply/apply";
  288. export default {
  289. name: "MaterialList",
  290. data() {
  291. return {
  292. currentPage: 1, // 当前页码
  293. pageSize: 10, // 每页数量
  294. listTotal: 0, // 列表总数
  295. dataList: null, // 列表数据
  296. listLoading: false, // 列表加载loading
  297. screenForm: {
  298. billNo: "",
  299. correspondId: [],
  300. endTime: "",
  301. materialName: "",
  302. date: "",
  303. materialNumber: "",
  304. materialOldNumber: "",
  305. specification: "",
  306. startTime: "",
  307. },
  308. isCollapse: true,
  309. warehouseList: [],
  310. };
  311. },
  312. computed: {
  313. exParams() {
  314. return {
  315. billNo: this.screenForm.billNo,
  316. correspondId: this.screenForm.correspondId.join(","),
  317. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  318. materialName: this.screenForm.materialName,
  319. materialNumber: this.screenForm.materialNumber,
  320. materialOldNumber: this.screenForm.materialOldNumber,
  321. specification: this.screenForm.specification,
  322. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  323. };
  324. },
  325. isShowDetail() {
  326. // eslint-disable-next-line no-prototype-builtins
  327. return this.queryItem.hasOwnProperty("id");
  328. },
  329. },
  330. created() {
  331. this.getWarehouseList();
  332. this.getList();
  333. },
  334. methods: {
  335. // 查询按钮权限
  336. checkBtnRole(value) {
  337. // let btnRole = this.$route.meta.roles;
  338. // if(!btnRole) {return true}
  339. // let index = btnRole.indexOf(value);
  340. // return index >= 0;
  341. return true;
  342. },
  343. // 获取仓库列表
  344. getWarehouseList() {
  345. getWarehouseList({
  346. pageNum: 1,
  347. pageSize: -1,
  348. }).then((res) => {
  349. this.warehouseList = res.data.records;
  350. });
  351. },
  352. handleUnapprove(id, billNo) {
  353. setApprovalPurchaseOrderIn({ id, billNo }).then((res) => {
  354. this.$successMsg("弃审成功");
  355. this.getList();
  356. });
  357. },
  358. // 查询列表
  359. getList() {
  360. this.listLoading = true;
  361. const params = {
  362. pageNum: this.currentPage,
  363. pageSize: this.pageSize,
  364. billNo: this.screenForm.billNo,
  365. correspondId: this.screenForm.correspondId.join(","),
  366. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  367. materialName: this.screenForm.materialName,
  368. materialNumber: this.screenForm.materialNumber,
  369. materialOldNumber: this.screenForm.materialOldNumber,
  370. specification: this.screenForm.specification,
  371. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  372. };
  373. getOtherStockInList(params).then((res) => {
  374. res.data.records.forEach((item) => {
  375. item.sums1 = ["auxUnitQty"];
  376. item.sums2 = ["taxPrice", "amount", "entryTaxAmount", "allAmount"];
  377. });
  378. this.dataList = res.data.records;
  379. this.listTotal = res.data.total;
  380. this.listLoading = false;
  381. });
  382. },
  383. // 提交筛选表单
  384. submitScreenForm() {
  385. this.currentPage = 1;
  386. this.getList();
  387. },
  388. // 重置筛选表单
  389. resetScreenForm() {
  390. this.$refs.screenForm.resetFields();
  391. this.currentPage = 1;
  392. this.getList();
  393. },
  394. // 更改每页数量
  395. handleSizeChange(val) {
  396. this.pageSize = val;
  397. this.currentPage = 1;
  398. this.getList();
  399. },
  400. // 更改当前页
  401. handleCurrentChange(val) {
  402. this.currentPage = val;
  403. this.getList();
  404. },
  405. // 进入详情
  406. toDetail(item) {
  407. this.queryItem = item;
  408. },
  409. backList() {
  410. this.queryItem = {};
  411. },
  412. },
  413. };
  414. </script>
  415. <style scoped></style>