material_list.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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="supplierName">
  57. <el-input
  58. v-model="screenForm.supplierName"
  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="12" 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. >
  113. <el-table-column
  114. label="序号"
  115. align="left"
  116. width="50"
  117. type="index"
  118. show-overflow-tooltip
  119. ></el-table-column>
  120. <el-table-column
  121. align="left"
  122. label="单据编号"
  123. prop="billNo"
  124. min-width="130"
  125. show-overflow-tooltip
  126. >
  127. <template slot-scope="scope">
  128. <CopyButton :copy-text="scope.row.billNo" />
  129. <span>{{ scope.row.billNo }}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column
  133. align="left"
  134. label="退料日期"
  135. prop="fdate"
  136. min-width="150"
  137. show-overflow-tooltip
  138. >
  139. </el-table-column>
  140. <el-table-column
  141. align="left"
  142. label="供货商"
  143. prop="supplierId"
  144. min-width="200"
  145. show-overflow-tooltip
  146. />
  147. <el-table-column
  148. align="left"
  149. label="单据状态"
  150. prop="fdDocumentStatus"
  151. min-width="120"
  152. show-overflow-tooltip
  153. >
  154. <template v-slot="scope">
  155. {{ scope.row.fdDocumentStatus === "C" ? "已审核" : "" }}
  156. </template>
  157. </el-table-column>
  158. <el-table-column
  159. align="left"
  160. label="厂产品编码"
  161. prop="materialOldNumber"
  162. min-width="160"
  163. show-overflow-tooltip
  164. >
  165. <template slot-scope="scope">
  166. <CopyButton :copy-text="scope.row.materialOldNumber" />
  167. <span>{{ scope.row.materialOldNumber }}</span>
  168. </template>
  169. </el-table-column>
  170. <el-table-column
  171. align="left"
  172. label="存货编码"
  173. prop="materialNumber"
  174. min-width="120"
  175. show-overflow-tooltip
  176. >
  177. <template slot-scope="scope">
  178. <CopyButton :copy-text="scope.row.materialNumber" />
  179. <span>{{ scope.row.materialNumber }}</span>
  180. </template>
  181. </el-table-column>
  182. <el-table-column
  183. align="left"
  184. label="存货名称"
  185. prop="materialName"
  186. min-width="200"
  187. show-overflow-tooltip
  188. >
  189. <template slot-scope="scope">
  190. <CopyButton :copy-text="scope.row.materialName" />
  191. <span>{{ scope.row.materialName }}</span>
  192. </template>
  193. </el-table-column>
  194. <el-table-column
  195. align="left"
  196. label="规格型号"
  197. prop="materialName"
  198. min-width="300"
  199. show-overflow-tooltip
  200. >
  201. <template slot-scope="scope">
  202. <CopyButton :copy-text="scope.row.materialName" />
  203. <span>{{ scope.row.materialName }}</span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column
  207. align="left"
  208. label="库存单位"
  209. prop="unit"
  210. min-width="300"
  211. show-overflow-tooltip
  212. >
  213. </el-table-column>
  214. <el-table-column
  215. align="right"
  216. label="实退数量"
  217. prop="qty"
  218. min-width="100"
  219. show-overflow-tooltip
  220. />
  221. <el-table-column
  222. align="right"
  223. label="仓库"
  224. prop="stockName"
  225. min-width="100"
  226. show-overflow-tooltip
  227. />
  228. <!-- <el-table-column-->
  229. <!-- align="right"-->
  230. <!-- label="开票状态"-->
  231. <!-- prop="taxPrice"-->
  232. <!-- min-width="120"-->
  233. <!-- show-overflow-tooltip-->
  234. <!-- >-->
  235. <!-- <template slot-scope="scope">-->
  236. <!-- {{ scope.row.taxPrice | numToFixed }}-->
  237. <!-- </template>-->
  238. <!-- </el-table-column>-->
  239. <el-table-column
  240. align="center"
  241. label="操作"
  242. width="100"
  243. fixed="right"
  244. >
  245. <template slot-scope="scope">
  246. <el-popconfirm
  247. title="弃审吗?"
  248. @onConfirm="handleUnapprove(scope.row.id, scope.row.billNo)"
  249. >
  250. <el-button slot="reference" type="text">弃审</el-button>
  251. </el-popconfirm>
  252. </template>
  253. </el-table-column>
  254. </el-table>
  255. </div>
  256. </div>
  257. <div class="pagination clearfix">
  258. <div class="fr">
  259. <el-pagination
  260. :current-page="currentPage"
  261. :page-sizes="[10, 20, 30, 50]"
  262. :page-size="10"
  263. layout="total, sizes, prev, pager, next, jumper"
  264. :total="listTotal"
  265. @size-change="handleSizeChange"
  266. @current-change="handleCurrentChange"
  267. />
  268. </div>
  269. </div>
  270. </div>
  271. </template>
  272. <script>
  273. import {
  274. getPurchaseOutList,
  275. setApprovalPurchaseOrderOut,
  276. } from "@/api/supply/purchase";
  277. import { getWarehouseList } from "@/api/supply/apply";
  278. export default {
  279. name: "MaterialList",
  280. data() {
  281. return {
  282. currentPage: 1, // 当前页码
  283. pageSize: 10, // 每页数量
  284. listTotal: 0, // 列表总数
  285. dataList: null, // 列表数据
  286. listLoading: false, // 列表加载loading
  287. screenForm: {
  288. billNo: "",
  289. correspondId: [],
  290. endTime: "",
  291. date: "",
  292. materialName: "",
  293. materialNumber: "",
  294. materialOldNumber: "",
  295. specification: "",
  296. startTime: "",
  297. supplierName: "",
  298. },
  299. isCollapse: true,
  300. warehouseList: [],
  301. };
  302. },
  303. computed: {
  304. exParams() {
  305. return {
  306. billNo: this.screenForm.billNo,
  307. correspondId: this.screenForm.correspondId.join(","),
  308. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  309. materialName: this.screenForm.materialName,
  310. materialNumber: this.screenForm.materialNumber,
  311. materialOldNumber: this.screenForm.materialOldNumber,
  312. specification: this.screenForm.specification,
  313. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  314. supplierName: this.screenForm.supplierName,
  315. };
  316. },
  317. isShowDetail() {
  318. // eslint-disable-next-line no-prototype-builtins
  319. return this.queryItem.hasOwnProperty("id");
  320. },
  321. },
  322. created() {
  323. this.getWarehouseList();
  324. this.getList();
  325. },
  326. methods: {
  327. // 查询按钮权限
  328. checkBtnRole(value) {
  329. // let btnRole = this.$route.meta.roles;
  330. // if(!btnRole) {return true}
  331. // let index = btnRole.indexOf(value);
  332. // return index >= 0;
  333. return true;
  334. },
  335. // 获取仓库列表
  336. getWarehouseList() {
  337. getWarehouseList({
  338. pageNum: 1,
  339. pageSize: -1,
  340. }).then((res) => {
  341. this.warehouseList = res.data.records;
  342. });
  343. },
  344. handleUnapprove(id, billNo) {
  345. setApprovalPurchaseOrderOut({ id, billNo }).then((res) => {
  346. this.$successMsg("弃审成功");
  347. });
  348. },
  349. // 查询列表
  350. getList() {
  351. this.listLoading = true;
  352. const params = {
  353. pageNum: this.currentPage,
  354. pageSize: this.pageSize,
  355. billNo: this.screenForm.billNo,
  356. correspondId: this.screenForm.correspondId.join(","),
  357. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  358. materialName: this.screenForm.materialName,
  359. materialNumber: this.screenForm.materialNumber,
  360. materialOldNumber: this.screenForm.materialOldNumber,
  361. specification: this.screenForm.specification,
  362. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  363. supplierName: this.screenForm.supplierName,
  364. };
  365. getPurchaseOutList(params).then((res) => {
  366. res.data.records.forEach((item) => {
  367. item.sums1 = ["auxUnitQty"];
  368. item.sums2 = ["taxPrice", "amount", "entryTaxAmount", "allAmount"];
  369. });
  370. this.dataList = res.data.records;
  371. this.listTotal = res.data.total;
  372. this.listLoading = false;
  373. });
  374. },
  375. // 提交筛选表单
  376. submitScreenForm() {
  377. this.currentPage = 1;
  378. this.getList();
  379. },
  380. // 重置筛选表单
  381. resetScreenForm() {
  382. this.$refs.screenForm.resetFields();
  383. this.currentPage = 1;
  384. this.getList();
  385. },
  386. // 更改每页数量
  387. handleSizeChange(val) {
  388. this.pageSize = val;
  389. this.currentPage = 1;
  390. this.getList();
  391. },
  392. // 更改当前页
  393. handleCurrentChange(val) {
  394. this.currentPage = val;
  395. this.getList();
  396. },
  397. // 进入详情
  398. toDetail(item) {
  399. this.queryItem = item;
  400. },
  401. backList() {
  402. this.queryItem = {};
  403. },
  404. },
  405. };
  406. </script>
  407. <style scoped></style>