weightedsubsidiary.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. <!--仓库管理-->
  2. <template>
  3. <div>
  4. <el-row>
  5. <el-col :span="12">
  6. <h2 class="bg-left title">加权明细</h2>
  7. </el-col>
  8. <el-col :span="12" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="returnsales()"
  14. ><img
  15. width="6"
  16. height="10"
  17. style="vertical-align: bottom; margin-right: 3px"
  18. src="../../../public/img/lujing.png"
  19. alt=""
  20. />返回</el-button
  21. >
  22. </el-col>
  23. </el-row>
  24. <el-row>
  25. <el-col class='bg-left' :span="12">
  26. <div style='align-items:center;' class='flex'>
  27. <div style='align-items:center;' class='flex'>
  28. <div :class='{"forbidden":forbidden==true}' @click='minus'><i class="el-icon-arrow-left"></i></div>
  29. <ws-select
  30. v-model="year"
  31. placeholder=""
  32. @change="yearChange"
  33. :value="searchType"
  34. style="margin: 0 10px"
  35. >
  36. <ws-option
  37. v-for="item in yearList"
  38. :key="item.value"
  39. :label="item.value"
  40. :value="item.value"
  41. style="color: #8890b1"
  42. />
  43. </ws-select>
  44. <div :class='{"forbidden":forbidden1==true}' @click='add'><i class="el-icon-arrow-right"></i></div>
  45. </div>
  46. </div>
  47. </el-col>
  48. <el-col :span="12" class="bg-right">
  49. <ws-select
  50. v-model="warehouseName"
  51. placeholder=""
  52. @change="warehouseNameChange"
  53. :value="searchType"
  54. style="margin: 0 10px"
  55. >
  56. <ws-option
  57. v-for="item in warehouseList1"
  58. :key="item.value"
  59. :label="item.value"
  60. :value="item.value"
  61. style="color: #8890b1"
  62. />
  63. </ws-select>
  64. <ws-select
  65. v-model="goodsName"
  66. placeholder=""
  67. class="typeselect"
  68. @change="selectgoodsName"
  69. >
  70. <ws-option
  71. v-for="item in goodnameList"
  72. :key="item.constKey"
  73. :label="item.goodsName"
  74. :value="item.goodsName"
  75. />
  76. </ws-select>
  77. <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
  78. <ws-button class="find" type="primary" @click="find()"
  79. ><img
  80. width="16"
  81. height="16"
  82. style="
  83. vertical-align: text-top;
  84. position: relative;
  85. top: 0px;
  86. left: -8px;
  87. "
  88. src="../../../public/img/sousuo.png"
  89. alt=""
  90. /></ws-button>
  91. </el-col>
  92. </el-row>
  93. <el-table
  94. class="wenzi"
  95. :data="warehouseList.records"
  96. style="width: 100%; margin-top: 20px"
  97. height="780"
  98. >
  99. <el-table-column label="序号" type="index" show-overflow-tooltip width="50">
  100. </el-table-column>
  101. <el-table-column prop="goodsName" label="货名" >
  102. </el-table-column>
  103. <el-table-column prop="grainType" label="粮食类型" >
  104. </el-table-column>
  105. <el-table-column prop="inType" label="入库类型" >
  106. </el-table-column>
  107. <el-table-column prop="netWeight" label="净重(吨)" >
  108. </el-table-column>
  109. <el-table-column prop="pureWeight" label="纯重(吨)" >
  110. </el-table-column>
  111. <el-table-column prop="unitPrice" label="价格(元/吨)" >
  112. </el-table-column>
  113. <el-table-column prop="deductionAmount" label="扣款(元/吨)" >
  114. </el-table-column>
  115. <el-table-column prop="freight" label="运费(元/吨)" >
  116. </el-table-column>
  117. <el-table-column prop="originalStock" label="原库存量(吨)" >
  118. </el-table-column>
  119. <el-table-column prop="costBefore" label="入库前加权成本" >
  120. </el-table-column>
  121. <el-table-column prop="costAfter" label="入库后加权成本" >
  122. </el-table-column>
  123. <el-table-column prop="createDate" label="更新日期">
  124. </el-table-column>
  125. </el-table>
  126. <el-pagination
  127. @size-change="handleSizeChange"
  128. @current-change="handleCurrentChange"
  129. :current-page="currentPage"
  130. :page-size="pageSize"
  131. layout="total, sizes, prev, pager, next, jumper"
  132. :total="deptBudgetTotal"
  133. >
  134. </el-pagination>
  135. </div>
  136. </template>
  137. <script>
  138. import {
  139. selectWarehouseSelf
  140. } from '@/model/houseSelfCollect/index'
  141. import {
  142. weighteddetails,
  143. editcost,
  144. export1,
  145. editstatus,
  146. billoperatehis,
  147. } from '@/model/warehouse/index'
  148. import {
  149. packList,
  150. } from '@/model/contarct/index'
  151. import { downloadFile } from '@/utils/batchDown'
  152. import Pagination from '@/components/Pagination'
  153. import WsUpload from '@/components/WsUpload'
  154. import { EventBus } from 'base-core-lib'
  155. export default {
  156. name: 'viewSpareMoney',
  157. components: {
  158. WsUpload,
  159. Pagination,
  160. },
  161. watch: {
  162. vesselId(val) {
  163. this.getList()
  164. },
  165. isShow(val) {
  166. this.showType = val
  167. },
  168. },
  169. data() {
  170. return {
  171. currectPage:1,
  172. pageSize:10,
  173. //弹出框
  174. dialogViewSpareMoney: false,
  175. dialogApproveFormVisible: false,
  176. // 船舶类型
  177. monetaryKey: null,
  178. // 表格显示数据
  179. tableDate: [],
  180. goodnameList:[],
  181. goodsName:'玉米',
  182. goodsNameKey:1,
  183. expenseName:'',
  184. yearList:[],
  185. dialogtitle:'',
  186. appendixIdss:[],
  187. amount:'',
  188. applUrl:'',
  189. price:'',
  190. costDate:'',
  191. // 是否显示
  192. showType: true,
  193. // 年
  194. year: '',
  195. searchType: 1,
  196. searchTypeText: '未完成',
  197. searchKeyWord: '',
  198. contractType: 2,
  199. currentPage:1,
  200. warehouseType: '1',
  201. // 提交类型
  202. submitType: true,
  203. size: 10,
  204. limit:1,
  205. spanArr: [],
  206. id:0,
  207. warehouseName: '',
  208. warehouseId:'',
  209. forbidden:false,
  210. forbidden1:false,
  211. start:2021,
  212. addvisible:false,
  213. compId: sessionStorage.getItem('ws-pf_compId'),
  214. deptCircularPage: {},
  215. warehouseList: [],
  216. warehouseList1: [],
  217. deptBudgetList: {},
  218. historyList: [],
  219. count:0,
  220. deptBudgetTotal: 0,
  221. pickerBeginDateBefore: {
  222. disabledDate: (time) => {
  223. return time.getTime() > Date.now()
  224. },
  225. },
  226. accessoryTFs: false,
  227. }
  228. },
  229. activated() {
  230. this.cangid=this.$route.query.cangId
  231. // 货名
  232. // packList({ constId: 'CON2' })
  233. // .toPromise()
  234. // .then((response) => {
  235. // this.goodnameList = response
  236. // })
  237. this.year=new Date().getFullYear()
  238. for(var i=this.start;i<=this.year;i++){
  239. this.yearList.push({value:i})
  240. }
  241. if(this.year>=new Date().getFullYear()){
  242. this.forbidden1=true
  243. }
  244. if(this.year<=this.start){
  245. this.forbidden=true
  246. }
  247. this.selectWarehouse()
  248. // this.getList()
  249. this.showType = this.isShow
  250. },
  251. methods: {
  252. selectgoodsName(e) {
  253. for (var i = 0; i < this.goodnameList.length; i++) {
  254. if (this.goodnameList[i].goodsName == e) {
  255. this.goodsNameKey = this.goodnameList[i].goodsNameKey
  256. }
  257. }
  258. },
  259. returnsales(){
  260. this.$router.go(-1)
  261. },
  262. counttotal(){
  263. for (let i = 0; i < this.warehouseList.records.length; i++) {
  264. this.count+=this.warehouseList.records[i].amount
  265. }
  266. },
  267. minus(){
  268. if(this.year<=this.start){
  269. this.forbidden=true
  270. }else{
  271. this.year--
  272. }
  273. },
  274. add(){
  275. if(this.year>=new Date().getFullYear()){
  276. this.forbidden1=true
  277. }else{
  278. this.year++
  279. }
  280. },
  281. yearChange(){
  282. },
  283. warehouseNameChange(e) {
  284. for(let i = 0 ; i < this.warehouseList1.length; i++){
  285. if(this.warehouseList1[i].value == e){
  286. this.warehouseName = this.warehouseList1[i].value
  287. this.warehouseCount = this.warehouseList1[i].count
  288. this.warehouseNo = this.warehouseList1[i].No
  289. this.cangid = this.warehouseList1[i].id
  290. this.WAREHOUSE[1].payname = this.warehouseList1[i].value
  291. this.purchasePriceList = this.warehouseList1[i].purchasePriceList
  292. }
  293. }
  294. this.getList()
  295. },
  296. edit(item){
  297. this.price=item.cost
  298. this.editvisible=true
  299. this.id=item.id
  300. },
  301. //查看
  302. handleClose() {
  303. this.accessoryTFs = false
  304. },
  305. handleSizeChange(val) {
  306. console.log(`每页 ${val} 条`)
  307. this.pageSize = val
  308. this.getList()
  309. },
  310. handleCurrentChange(val) {
  311. this.currentPage = val
  312. console.log(`当前页: ${val}`)
  313. this.getList()
  314. },
  315. selectWarehouse(){
  316. selectWarehouseSelf({
  317. compId: sessionStorage.getItem('ws-pf_compId'),
  318. })
  319. .toPromise()
  320. .then((response) => {
  321. this.warehouseList1 = []
  322. for (let i = 0; i < response.length; i++) {
  323. this.warehouseList1.push({
  324. value: response[i].warehouseName,
  325. id: response[i].id,
  326. count: response[i].count,
  327. purchasePriceList: response[i].purchasePriceList,
  328. No:response[i].commonWarehouseNo,
  329. goodsNameInfos:response[i].goodsNameInfos
  330. })
  331. if (this.cangid&&this.cangid == response[i].id) {
  332. this.warehouseName = response[i].warehouseName
  333. this.warehouseCount = response[i].count
  334. this.warehouseNo = response[i].commonWarehouseNo
  335. this.purchasePriceList = response[i].purchasePriceList
  336. this.goodnameList=response[i].goodsNameInfos
  337. if(this.goodnameList){
  338. this.goodsName=this.goodnameList[0].goodsName
  339. this.goodsNameKey=this.goodnameList[0].goodsNameKey
  340. }
  341. }
  342. }
  343. if(this.warehouseList1.length > 0 && !this.cangid){
  344. this.warehouseName = this.warehouseList1[0].value
  345. this.warehouseCount = this.warehouseList1[0].count
  346. this.warehouseNo = this.warehouseList1[0].No
  347. this.cangid = this.warehouseList1[0].id
  348. this.purchasePriceList = this.warehouseList1[0].purchasePriceList
  349. this.WAREHOUSE[1].payname = this.warehouseList1[0].value
  350. this.goodnameList=this.warehouseList1[0].goodsNameInfos
  351. if(this.goodnameList){
  352. this.goodsName=this.goodnameList[0].goodsName
  353. this.goodsNameKey=this.goodnameList[0].goodsNameKey
  354. }
  355. }
  356. this.getList()
  357. })
  358. },
  359. getList() {
  360. weighteddetails({
  361. compId: sessionStorage.getItem('ws-pf_compId'),
  362. warehouseId: this.cangid,
  363. goodsNameKey:this.goodsNameKey,
  364. year: this.year,
  365. currectPage:this.currectPage,
  366. pageSize:this.pageSize
  367. })
  368. .toPromise()
  369. .then((response) => {
  370. this.warehouseList = response
  371. this.deptBudgetTotal=response.total
  372. this.counttotal()
  373. })
  374. },
  375. selecttaskType(e) {
  376. for (var i = 0; i < this.taskTypeList.length; i++) {
  377. if (this.taskTypeList[i].value == e) {
  378. this.searchType = this.taskTypeList[i].type
  379. }
  380. }
  381. },
  382. handleExamine(row) {
  383. this.$router.push({
  384. name: 'salesContractExamine',
  385. query: { id: row.id },
  386. })
  387. },
  388. // 关闭 dialog时 处理文件url 初始化upload组件
  389. handleCloe() {
  390. this.dialogViewSpareMoney = false
  391. },
  392. history(row) {
  393. billoperatehis({ id: row.id })
  394. .toPromise()
  395. .then((response) => {
  396. this.historyList = response
  397. })
  398. },
  399. find() {
  400. this.currentPage = 1
  401. this.getList()
  402. },
  403. async exportlist() {
  404. const { data } = await export1(
  405. {
  406. compId: sessionStorage.getItem('ws-pf_compId'),
  407. contractType: this.contractType,
  408. currentPage: this.currentPage,
  409. pageSize: this.pageSize,
  410. searchType: this.searchType,
  411. searchKeyWord: this.searchKeyWord,
  412. startDate: this.startDate,
  413. endDate: this.endDate,
  414. },
  415. {},
  416. { responseType: 'blob' }
  417. ).toPromise()
  418. downloadFile({
  419. res: data,
  420. fileName: `${
  421. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  422. }_采购合同`,
  423. type: 'xls',
  424. })
  425. },
  426. },
  427. }
  428. </script>
  429. <style lang="scss" scoped>
  430. .connert {
  431. width: 90%;
  432. margin: 0 auto;
  433. }
  434. .bg-left {
  435. padding-left: 30px;
  436. }
  437. .bg-right {
  438. text-align: right;
  439. padding: 16px 20px;
  440. }
  441. .el-icon-arrow-left,.el-icon-arrow-right{
  442. font-size:24px;
  443. }
  444. .vertical-text-left {
  445. width: 62px;
  446. text-align: right;
  447. }
  448. .el-button--primary {
  449. background-color: #5878e8;
  450. border-color: #5878e8;
  451. }
  452. .el-button--default {
  453. color: #8890b1;
  454. border-color: #e8eaf1;
  455. }
  456. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  457. width: 30px;
  458. margin-left: 0;
  459. border-top-left-radius: 0px;
  460. border-bottom-left-radius: 0px;
  461. }
  462. /deep/.findValue .el-input__inner {
  463. border-top-right-radius: 0px;
  464. border-bottom-right-radius: 0px;
  465. }
  466. .completed.el-button--default {
  467. border-color: #5878e8;
  468. background-color: #f6f7fc;
  469. color: #5878e8;
  470. }
  471. .putstorage.el-button--default,
  472. .deliverystorage.el-button--default {
  473. border-color: #8890b1;
  474. background-color: #fff;
  475. color: #8890b1;
  476. }
  477. /deep/.el-table td,
  478. /deep/.el-table th.is-leaf {
  479. border-right: 1px solid #e9ecf7;
  480. text-align: center;
  481. }
  482. /deep/.el-table tr td:first-child,
  483. /deep/.el-table tr th.is-leaf:first-child {
  484. border-left: 1px solid #e9ecf7;
  485. }
  486. /deep/.el-table .el-table__header .cell,
  487. /deep/.el-table .el-table__body .cell {
  488. -webkit-line-clamp: 10;
  489. max-height: 400px;
  490. }
  491. .record,
  492. .adjustment {
  493. display: inline-block;
  494. color: #5878e8;
  495. padding: 0 4px !important;
  496. position: relative;
  497. }
  498. .record:after {
  499. position: absolute;
  500. content: '';
  501. display: block;
  502. top: 5px;
  503. right: -2px;
  504. width: 1px;
  505. height: 12px;
  506. background: #e9ecf7;
  507. }
  508. /deep/.el-radio-button:first-child .el-radio-button__inner {
  509. margin-left: 10px;
  510. }
  511. //分页
  512. .el-pagination {
  513. text-align: center;
  514. white-space: nowrap;
  515. padding: 2px 5px;
  516. color: #303133;
  517. font-weight: 700;
  518. margin-bottom: 20px;
  519. }
  520. .forbidden{
  521. cursor: not-allowed;
  522. }
  523. .avatar-uploader .el-upload {
  524. border: 1px dashed #d9d9d9;
  525. border-radius: 6px;
  526. cursor: pointer;
  527. position: relative;
  528. overflow: hidden;
  529. }
  530. .avatar-uploader .el-upload:hover {
  531. border-color: #409EFF;
  532. }
  533. .avatar-uploader-icon {
  534. font-size: 28px;
  535. color: #8c939d;
  536. width: 178px;
  537. height: 178px;
  538. line-height: 178px;
  539. text-align: center;
  540. }
  541. .avatar {
  542. width: 178px;
  543. height: 178px;
  544. display: block;
  545. }
  546. </style>