warehouseManagementList.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123
  1. <!--仓库管理-->
  2. <template>
  3. <div>
  4. <BaseHeaderLayout :leftSpan="15">
  5. <template slot="left">
  6. <ws-button type="primary" @click="handleAdd()"
  7. v-hasPermission="
  8. `warehouseManagement.warehouse.warehouseInfo.add`
  9. "
  10. ><img
  11. width="11"
  12. height="11"
  13. style="position: relative; top: 1px"
  14. src="../../../public/img/header-add.png"
  15. alt=""
  16. />
  17. 添加</ws-button
  18. >
  19. <ws-button v-hasPermission="
  20. `warehouseManagement.warehouse.warehouseInfo.view`
  21. " @click="handleLook()">查看</ws-button>
  22. <ws-button v-hasPermission="
  23. `warehouseManagement.warehouse.warehouseInfo.edit`
  24. " @click="handleEdit()">编辑</ws-button>
  25. <ws-button v-hasPermission="
  26. `warehouseManagement.warehouse.warehouseInfo.delete`
  27. " @click="handleDelete()">删除</ws-button>
  28. <ws-button v-if='list.length>0'
  29. @click="handlTask()">任务</ws-button>
  30. <ws-button v-hasPermission="
  31. `warehouseManagement.warehouse.warehouseInfo.add`
  32. " @click="outData(1)">导出</ws-button>
  33. <ws-button @click="outData(2)">打印</ws-button>
  34. </template>
  35. <template slot="left">
  36. <div >
  37. <el-radio-group
  38. v-model="warehouseType"
  39. @change="changeradio"
  40. size="small"
  41. >
  42. <el-radio-button label="1">常用仓库</el-radio-button>
  43. <el-radio-button label="2">临时仓库</el-radio-button>
  44. </el-radio-group>
  45. </div>
  46. </template>
  47. <template slot="right">
  48. <ws-input
  49. v-model="warehouseName"
  50. placeholder="请输入仓库名"
  51. clearable
  52. maxlength="500"
  53. type="input"
  54. class="findValue"
  55. ></ws-input>
  56. <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
  57. <ws-button class="find" type="primary" @click="find()"
  58. ><img
  59. width="16"
  60. height="16"
  61. style="
  62. vertical-align: text-top;
  63. position: relative;
  64. top: 0px;
  65. left: -8px;
  66. "
  67. src="../../../public/img/sousuo.png"
  68. alt=""
  69. /></ws-button>
  70. </template>
  71. </BaseHeaderLayout>
  72. <div v-show="this.warehouseType == '1'" class="main_css">
  73. <el-table
  74. class="wenzi"
  75. :data="warehouseList"
  76. style="width: 100%; margin-top: 20px"
  77. height="100%"
  78. >
  79. <el-table-column prop="warehouseName" label="仓库名" >
  80. </el-table-column>
  81. <el-table-column prop="binNumber" label="仓位编号" >
  82. </el-table-column>
  83. <el-table-column prop="capacity" label="容量(吨)">
  84. <template slot-scope="scope">
  85. <div
  86. v-if="scope.row.capacity != 'null' && scope.row.capacity != null"
  87. >
  88. {{ scope.row.capacity }}
  89. </div>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="品种">
  93. <template slot-scope="scope">
  94. <div
  95. style="height: 24px"
  96. v-for="(item, i) in scope.row.warehouseNumViewList"
  97. >
  98. {{ item.goodsName }}
  99. </div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="入库量(吨)">
  103. <template slot-scope="scope">
  104. <div
  105. style="height: 24px"
  106. v-for="(item, i) in scope.row.warehouseNumViewList"
  107. >
  108. {{item.inNetWeight}}
  109. </div>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="出库量(吨)">
  113. <template slot-scope="scope">
  114. <div
  115. style="height: 24px"
  116. v-for="(item, i) in scope.row.warehouseNumViewList"
  117. >
  118. {{ item.outNetWeight }}
  119. </div>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="应余量(吨)">
  123. <template slot-scope="scope">
  124. <div
  125. style="height: 24px"
  126. v-for="(item, i) in scope.row.warehouseNumViewList"
  127. >
  128. {{ item.storage }}
  129. </div>
  130. </template>
  131. </el-table-column>
  132. <el-table-column prop="seller" label="入库" width="300">
  133. <template slot-scope="scope">
  134. <ws-button v-hasPermission="
  135. `warehouseManagement.warehouse.warehouseInfo.in`
  136. " class="putstorage" @click="warehousing1(scope.row)">
  137. 毛检
  138. </ws-button>
  139. <ws-button v-hasPermission="
  140. `warehouseManagement.warehouse.warehouseInfo.in`
  141. " class="putstorage" @click="nocomplete1(scope.row,2)">
  142. 皮检
  143. </ws-button>
  144. <!-- <ws-button v-hasPermission="
  145. `warehouseManagement.warehouse.warehouseInfo.view`
  146. " class="completed" @click="nocomplete(scope.row)">
  147. 待皮检({{ scope.row.number }})
  148. </ws-button> -->
  149. </template>
  150. </el-table-column>
  151. <el-table-column prop="seller" label="出库" width="300">
  152. <template slot-scope="scope">
  153. <ws-button v-hasPermission="
  154. `warehouseManagement.warehouse.warehouseInfo.out`
  155. " class="deliverystorage" @click="delivery1(scope.row)">
  156. 皮检
  157. </ws-button>
  158. <ws-button v-hasPermission="
  159. `warehouseManagement.warehouse.warehouseInfo.out`
  160. " class="deliverystorage" @click="nocomplete1(scope.row,3)">
  161. 毛检
  162. </ws-button>
  163. <!-- <ws-button v-hasPermission="
  164. `warehouseManagement.warehouse.warehouseInfo.view`
  165. " class="completed" @click="nocomplete(scope.row)">
  166. 待毛检({{ scope.row.number }})
  167. </ws-button> -->
  168. </template>
  169. </el-table-column>
  170. <el-table-column prop="address" label="操作" width="200">
  171. <template slot-scope="scope">
  172. <div class="record" v-hasPermission="
  173. `warehouseManagement.warehouse.warehouseInfo.view`
  174. " @click="record(scope.row)">记录</div>
  175. <div class="adjustment" v-hasPermission="
  176. `warehouseManagement.warehouse.warehouseInfo.view`
  177. " @click="loss(scope.row)">盘损</div>
  178. <div class="adjustment" v-hasPermission="
  179. `warehouseManagement.warehouse.warehouseInfo.view`
  180. " @click="mintor(scope.row)">监控</div>
  181. </template>
  182. </el-table-column>
  183. </el-table>
  184. </div>
  185. <div v-show="this.warehouseType == '2'">
  186. <el-table
  187. class="wenzi"
  188. :data="warehouseList"
  189. style="width: 100%; margin-top: 20px"
  190. height="780"
  191. >
  192. <el-table-column type="index" label="序号" width="80">
  193. <template scope="scope">
  194. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  195. <span v-else>{{ scope.$index + 1 }}</span>
  196. </template>
  197. </el-table-column>
  198. <el-table-column prop="warehouseName" label="仓库名" width="80">
  199. </el-table-column>
  200. <el-table-column prop="address" label="临时仓库地址">
  201. <template slot-scope="scope">
  202. <div
  203. v-if="scope.row.address != 'null' && scope.row.address != null"
  204. >
  205. {{ scope.row.address }}
  206. </div>
  207. </template>
  208. </el-table-column>
  209. <el-table-column label="入库量(吨)">
  210. <template slot-scope="scope">
  211. <div
  212. style="height: 24px"
  213. v-for="(item, i) in scope.row.warehouseNumViewList"
  214. >
  215. {{ item.goodsName}}({{item.inNetWeight == null ? 0 : item.inNetWeight}})
  216. </div>
  217. </template>
  218. </el-table-column>
  219. <el-table-column label="出库量(吨)">
  220. <template slot-scope="scope">
  221. <div
  222. style="height: 24px"
  223. v-for="(item, i) in scope.row.warehouseNumViewList"
  224. >
  225. {{ item.goodsName}}({{item.outNetWeight == null ? 0:item.outNetWeight}})
  226. </div>
  227. </template>
  228. </el-table-column>
  229. <el-table-column label="应余量(吨)">
  230. <template slot-scope="scope">
  231. <div
  232. style="height: 24px"
  233. v-for="(item, i) in scope.row.warehouseNumViewList"
  234. >{{ item.goodsName}}
  235. ({{ item.surplus}})
  236. {{item.storage }}
  237. </div>
  238. </template>
  239. </el-table-column>
  240. <el-table-column prop="seller" label="出入库" width="300">
  241. <template slot-scope="scope">
  242. <ws-button class="completed" @click="nocomplete(scope.row)">
  243. 待完成({{ scope.row.number }})
  244. </ws-button>
  245. <ws-button class="putstorage" @click="warehousing(scope.row)">
  246. 入库
  247. </ws-button>
  248. <ws-button
  249. class="deliverystorage"
  250. v-if="scope.row.clearStatusFlag != 3"
  251. @click="delivery(scope.row)"
  252. >
  253. 出库
  254. </ws-button>
  255. </template>
  256. </el-table-column>
  257. <el-table-column prop="address" label="操作" width="200">
  258. <template slot-scope="scope">
  259. <div class="record" @click="record(scope.row)">记录</div>
  260. <div
  261. class="adjustment"
  262. v-if="scope.row.clearStatusFlag == 1"
  263. @click="clearance(scope.row)"
  264. >
  265. 清仓
  266. </div>
  267. <div class="adjustment" v-if="scope.row.clearStatusFlag == 3">
  268. 已清仓
  269. </div>
  270. </template>
  271. </el-table-column>
  272. </el-table>
  273. </div> <div class="mask" v-show="isShowPrintType"></div>
  274. <div class="print-type" v-show="isShowPrintType">
  275. <div class="print-type-content">
  276. <div class="print-type-title">{{headerText}}</div>
  277. <div class="print-type-checkbox">
  278. <el-form ref="form" label-width="110px">
  279. <el-form-item label="类型">
  280. <el-radio-group v-model="parameter.radio" >
  281. <el-radio :label="3" >入库记录</el-radio>
  282. <el-radio :label="2">出库记录</el-radio>
  283. </el-radio-group>
  284. </el-form-item>
  285. <el-form-item label="起始日期">
  286. <el-date-picker value-format="yyyy-MM-dd" type="date" placeholder="请选择起始日期" v-model="parameter.startDate"></el-date-picker>
  287. </el-form-item>
  288. <el-form-item label="截止日期">
  289. <el-date-picker value-format="yyyy-MM-dd" type="date" placeholder="请选择截止日期" v-model="parameter.endDate"></el-date-picker>
  290. </el-form-item>
  291. <!--仓库名称-->
  292. <el-form-item label="仓库名称" span="1" prop="warehouseName" >
  293. <el-select
  294. v-model="parameter.warehouseName"
  295. placeholder="请选择仓库名称"
  296. >
  297. <el-option
  298. v-for="item in packtypeList"
  299. :key="item.constKey"
  300. :label="item.warehouseName"
  301. :value="item.warehouseName"
  302. />
  303. </el-select>
  304. </el-form-item>
  305. <el-form-item label="增量比例(%)" v-if="headerText == '打印记录'">
  306. <el-input placeholder="请输入增量比例" v-model="parameter.proportion" clearable class="proportion_css"></el-input>
  307. </el-form-item>
  308. </el-form>
  309. </div>
  310. </div>
  311. <div class="bottom-btn">
  312. <el-button @click="submitClick()">确定</el-button>
  313. <!-- <el-button @click="submitClick()" v-if="headerText == '打印记录'">确定</el-button> -->
  314. <el-button @click="removePrint">取消</el-button>
  315. </div>
  316. </div>
  317. </div>
  318. </template>
  319. <script>
  320. import {
  321. getList,
  322. getwarehousetask,
  323. export1,
  324. editstatus,
  325. billoperatehis,
  326. getsponsible,
  327. clearancee,
  328. xiala,
  329. postExport,
  330. addselectinfoList,
  331. printAdd,
  332. postExportOut
  333. } from '@/model/warehouse/index'
  334. import { downloadFile } from '@/utils/batchDown'
  335. import Pagination from '@/components/Pagination'
  336. import WsUpload from '@/components/WsUpload'
  337. // import { EventBus } from 'base-core-lib'
  338. import {dayjs,EventBus} from 'base-core-lib'
  339. export default {
  340. name: 'viewSpareMoney',
  341. components: {
  342. WsUpload,
  343. Pagination,
  344. },
  345. watch: {
  346. vesselId(val) {
  347. this.getList()
  348. },
  349. isShow(val) {
  350. this.showType = val
  351. },
  352. },
  353. data() {
  354. return {
  355. //弹出框
  356. dialogViewSpareMoney: false,
  357. dialogApproveFormVisible: false,
  358. // 船舶类型
  359. monetaryKey: null,
  360. // 表格显示数据
  361. tableDate: [],
  362. list:[],
  363. // 是否显示
  364. showType: true,
  365. // 年
  366. year: '',
  367. searchType: 1,
  368. searchTypeText: '未完成',
  369. searchKeyWord: '',
  370. contractType: 2,
  371. warehouseType: '1',
  372. // 提交类型
  373. submitType: true,
  374. size: 10,
  375. spanArr: [],
  376. warehouseName: '',
  377. compId: localStorage.getItem('ws-pf_compId'),
  378. deptCircularPage: {},
  379. warehouseList: [],
  380. deptBudgetList: {},
  381. historyList: [],
  382. deptBudgetTotal: 0,
  383. pickerBeginDateBefore: {
  384. disabledDate: (time) => {
  385. return time.getTime() > Date.now()
  386. },
  387. },
  388. accessoryTFs: false,
  389. isShowPrintType:false,//打印
  390. headerText:"",
  391. packtypeList:[],//仓库列表
  392. parameter:{
  393. radio:3,
  394. startDate:"",
  395. endDate:"",
  396. proportion:''
  397. },
  398. date: {
  399. year: dayjs().format('YYYY'),
  400. month: dayjs().format('MM'),
  401. },
  402. }
  403. },
  404. activated() {
  405. this.getList()
  406. this.showType = this.isShow
  407. },
  408. methods: {
  409. //导出、打印
  410. outData(index){
  411. if(index == 1){
  412. this.headerText = "导出记录"
  413. }else if(index == 2){
  414. this.headerText = "打印记录"
  415. }
  416. // 获取仓库
  417. xiala({
  418. compId: localStorage.getItem('ws-pf_compId'),
  419. warehouseType: this.warehouseType,
  420. })
  421. .toPromise()
  422. .then((response) => {
  423. this.packtypeList = response
  424. })
  425. let date = new Date()
  426. var year = date.getFullYear();
  427. var month = date.getMonth() + 1;
  428. var strDate = date.getDate()
  429. var pastdate=new Date(date.getTime()-24*60*60*1000)
  430. this.parameter.startDate = pastdate.getFullYear()+'-'+(pastdate.getMonth() + 1)+'-'+pastdate.getDate()
  431. this.parameter.endDate = ""+year+"-"+month+"-"+strDate
  432. this.$forceUpdate();
  433. this.isShowPrintType = true
  434. },
  435. removePrint(){
  436. this.parameter.warehouseName = ""
  437. this.parameter.proportion = ""
  438. this.isShowPrintType = false
  439. },
  440. async submitClick(){
  441. if(!this.parameter.radio && this.headerText == "打印记录"){
  442. this.$message.error("请选择打印的类型")
  443. return
  444. }
  445. if(!this.parameter.startDate){
  446. this.$message.error("请选择打印的起始日期")
  447. return
  448. }
  449. if(!this.parameter.endDate){
  450. this.$message.error("请选择打印的截止日期")
  451. return
  452. }
  453. if(new Date(this.parameter.endDate).getTime() < new Date(this.parameter.startDate).getTime()){
  454. this.$message.error("截止日期输入错误")
  455. return
  456. }
  457. if(!this.parameter.warehouseName){
  458. this.$message.error("请选择所要打印的仓库")
  459. return
  460. }
  461. if(this.headerText == "导出记录"){
  462. debugger
  463. if(this.parameter.radio == 3){
  464. const {
  465. data
  466. } = await postExport({startDate:this.parameter.startDate,endDate:this.parameter.endDate,warehouseName:this.parameter.warehouseName}, {}, {
  467. responseType: 'blob'
  468. }).toPromise()
  469. downloadFile({
  470. res: data,
  471. fileName: `${
  472. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  473. }导出入库记录`,
  474. type: 'xls',
  475. })
  476. }else if(this.parameter.radio == 2){
  477. const {
  478. data
  479. } = await postExportOut({startDate:this.parameter.startDate,endDate:this.parameter.endDate,warehouseName:this.parameter.warehouseName}, {}, {
  480. responseType: 'blob'
  481. }).toPromise()
  482. downloadFile({
  483. res: data,
  484. fileName: `${
  485. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  486. }导出出库记录`,
  487. type: 'xls',
  488. })
  489. }
  490. }else if(this.headerText == "打印记录"){
  491. console.log(this.parameter.startDate)
  492. addselectinfoList({
  493. compId: localStorage.getItem('ws-pf_compId'),
  494. startDate:this.parameter.startDate,
  495. endDate:this.parameter.endDate,
  496. warehouseName:this.parameter.warehouseName,
  497. searchType:this.parameter.radio,
  498. currentPage: 1,
  499. pageSize: 999,
  500. }).toPromise()
  501. .then((response) => {
  502. if(response.records.length == 0){
  503. this.$message.error("暂未查到所要打印的出入库信息")
  504. }else{
  505. var warehousePrint = response.records
  506. if(this.parameter.proportion){
  507. var countWeight = 0
  508. for(let i = 0 ; i < warehousePrint.length ; i++){
  509. countWeight += Number(warehousePrint[i].netWeight)
  510. }
  511. var increment = (countWeight * (Number(this.parameter.proportion)/100)).toFixed(2)//所要增加的量
  512. printAdd().toPromise()
  513. .then((response1) => {
  514. // setTimeout(function(){
  515. for(let i = 0 ; i < response1.length ; i++){
  516. increment = Number(increment)
  517. if(increment > 0){
  518. let index = Math.abs(Math.round(Math.random()*response1.length - 1))
  519. console.log(Math.abs(Math.round(Math.random()* warehousePrint.length - 1)),response1[index])
  520. let pro = response1[index] //取出假数据并设定值
  521. pro.inOutDate = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].inOutDate
  522. pro.contractNo = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].contractNo
  523. pro.companyName = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].companyName
  524. pro.goodsName = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].goodsName
  525. pro.boxNo = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].boxNo
  526. pro.netWeight = Number((Math.random()*(70-10+1)+10).toFixed(2))
  527. pro.tare = Number((Math.random()*(20-10+1)+10).toFixed(2))
  528. pro.grossWeight = Number((pro.tare + pro.netWeight).toFixed(2))
  529. if(pro.netWeight < increment){
  530. increment = (increment - pro.netWeight).toFixed(2) //所要增的量
  531. if(increment < 10 && pro.netWeight <= 60){
  532. pro.netWeight += Number(increment)
  533. pro.grossWeight = Number((pro.tare + pro.netWeight).toFixed(2))
  534. increment = 0
  535. warehousePrint.push(pro)
  536. }else{
  537. increment -= pro.netWeight
  538. warehousePrint.push(pro)
  539. }
  540. }else{
  541. pro.netWeight = Number(increment.toFixed(2))
  542. pro.grossWeight = Number((pro.tare + pro.netWeight).toFixed(2))
  543. increment = 0
  544. warehousePrint.push(pro)
  545. }
  546. response1.splice(index,1)//删除已添加过得假数据车牌号
  547. }
  548. sessionStorage.setItem("inOutWarehouse_Print",JSON.stringify(warehousePrint))
  549. let i = ""
  550. i = this.parameter.radio+"&warehouseName=" + this.parameter.warehouseName
  551. window.open('../../../../../static/warehousePrint.html?type=' + i)
  552. // return
  553. }
  554. // },2000)
  555. })
  556. }else{
  557. sessionStorage.setItem("inOutWarehouse_Print",JSON.stringify(response.records))
  558. let i = ""
  559. i = this.parameter.radio+"&warehouseName=" + this.parameter.warehouseName
  560. window.open('../../../../../static/warehousePrint.html?type=' + i)
  561. }
  562. }
  563. })
  564. }
  565. },
  566. startChane(e){
  567. console.log(e)
  568. },
  569. //清仓
  570. clearance(row) {
  571. console.log(row.outNumber)
  572. if (row.outNumber > 0) {
  573. this.$confirm(`你还有未完善的出库记录,请完善提交后再进行操作`, {
  574. cancelButtonText: '关闭',
  575. })
  576. .then(() => {})
  577. .catch(() => {
  578. return false
  579. })
  580. } else {
  581. this.$confirm(
  582. `清仓操作代表库存已清零,清仓后不可进行出库操作,是否确定清仓`,
  583. {
  584. confirmButtonText: '确定',
  585. cancelButtonText: '取消',
  586. type: 'warning',
  587. }
  588. )
  589. .then(() => {
  590. clearancee({ id: row.warehouseId })
  591. .toPromise()
  592. .then((response) => {
  593. this.$notify.success({
  594. title: '成功',
  595. message: '状态清仓成功',
  596. })
  597. this.getList()
  598. })
  599. .catch((response) => {})
  600. })
  601. .catch(() => {
  602. return false
  603. })
  604. }
  605. },
  606. //出库
  607. delivery(item) {
  608. this.$router.push({
  609. path: 'warehouseManagementDelivery',
  610. query: {
  611. baseId: item.warehouseId,
  612. positionId: item.binNumberId,
  613. warehouseName: item.warehouseName,
  614. binNumber: item.binNumber,
  615. capacity: item.capacity,
  616. warehouseType: this.warehouseType,
  617. warehouseId: item.warehouseId,
  618. },
  619. })
  620. },
  621. //入库
  622. warehousing(item) {
  623. var free = 0
  624. for (var i = 0; i < item.warehouseNumViewList.length; i++) {
  625. free += Number(item.warehouseNumViewList[i].storage)
  626. }
  627. this.$router.push({
  628. path: 'warehouseManagementPut',
  629. query: {
  630. baseId: item.warehouseId,
  631. positionId: item.binNumberId,
  632. warehouseName: item.warehouseName,
  633. binNumber: item.binNumber,
  634. capacity: item.capacity - free,
  635. id: item.id,
  636. warehouseType: this.warehouseType,
  637. createType: item.createType,
  638. },
  639. })
  640. },
  641. //毛检
  642. warehousing1(item) {
  643. var free = 0
  644. for (var i = 0; i < item.warehouseNumViewList.length; i++) {
  645. free += Number(item.warehouseNumViewList[i].storage)
  646. }
  647. this.$router.push({
  648. path: 'warehouseManagementGross',
  649. query: {
  650. baseId: item.warehouseId,
  651. positionId: item.binNumberId,
  652. warehouseName: item.warehouseName,
  653. binNumber: item.binNumber,
  654. capacity: item.capacity - free,
  655. id: item.id,
  656. warehouseType: this.warehouseType,
  657. createType: item.createType,
  658. information:'毛重检斤',
  659. allowEdit:item.allowEdit
  660. },
  661. })
  662. },
  663. //皮检
  664. delivery1(item) {
  665. this.$router.push({
  666. path: 'warehouseManagementTare',
  667. query: {
  668. baseId: item.warehouseId,
  669. positionId: item.binNumberId,
  670. warehouseName: item.warehouseName,
  671. binNumber: item.binNumber,
  672. capacity: item.capacity,
  673. warehouseType: this.warehouseType,
  674. warehouseId: item.warehouseId,
  675. information:'皮重检斤',
  676. allowEdit:item.allowEdit
  677. },
  678. })
  679. },
  680. getSpanArr(data) {
  681. let that = this
  682. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  683. that.spanArr = []
  684. that.pos = 0
  685. //遍历数据
  686. data.forEach((item, index) => {
  687. //判断是否是第一项
  688. // if (index === 0) {
  689. // this.spanArr.push(1)
  690. // this.pos = 0
  691. // } else {
  692. //不是第一项时,就根据标识去存储
  693. if (data[index].warehouseNumViewList.length > 1) {
  694. // 查找到符合条件的数据时每次要把之前存储的数据+1
  695. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  696. this.spanArr.push(0)
  697. } else {
  698. // 没有符合的数据时,要记住当前的index
  699. this.spanArr.push(1)
  700. this.pos = index
  701. }
  702. // }
  703. })
  704. },
  705. //待完成//传参
  706. nocomplete(row) {
  707. if (row.number > 0) {
  708. this.$router.push({
  709. path: 'warehouseManagementNoComplete',
  710. query: {
  711. baseId: row.warehouseId,
  712. positionId: row.binNumberId,
  713. warehouseName: row.warehouseName,
  714. binNumber: row.binNumber,
  715. warehouseType: this.warehouseType,
  716. createType: row.createType,
  717. },
  718. })
  719. }
  720. },
  721. //检斤待完成
  722. nocomplete1(row,status) {
  723. this.$router.push({
  724. path: 'warehouseManagementNoWeight',
  725. query: {
  726. baseId: row.warehouseId,
  727. positionId: row.binNumberId,
  728. warehouseName: row.warehouseName,
  729. binNumber: row.binNumber,
  730. warehouseType: this.warehouseType,
  731. createType: row.createType,
  732. status:status
  733. },
  734. })
  735. },
  736. //记录
  737. record(item) {
  738. this.$router.push({
  739. name: 'warehouseManagementRecord',
  740. query: {
  741. baseId: item.warehouseId,
  742. positionId: item.binNumberId,
  743. warehouseName: item.warehouseName,
  744. remark: item.remark,
  745. binNumber: item.binNumber,
  746. capacity: item.capacity,
  747. warehouseType: this.warehouseType,
  748. },
  749. })
  750. },
  751. //盘损
  752. loss(item) {
  753. this.$router.push({
  754. path: 'warehouseManagementIoss',
  755. query: {
  756. baseId: item.warehouseId,
  757. positionId: item.binNumberId,
  758. warehouseName: item.warehouseName,
  759. binNumber: item.binNumber,
  760. },
  761. })
  762. },
  763. mintor(){
  764. this.$router.push({ path: 'warehouseManagementMintor' })
  765. },
  766. changeradio(e) {
  767. this.getList()
  768. },
  769. //查看
  770. handleLook() {
  771. this.$router.push({ path: 'warehouseManagementLook' })
  772. },
  773. //添加
  774. handleAdd() {
  775. this.$router.push({ path: 'warehouseManagementAdd' })
  776. },
  777. //编辑
  778. handleEdit() {
  779. this.$router.push({ path: 'warehouseManagementEdit' })
  780. },
  781. handleDelete() {
  782. this.$router.push({ path: 'warehouseManagementDelete' })
  783. },
  784. //任务
  785. handlTask(){
  786. var arr=[]
  787. console.log(this.list)
  788. for (let i = 0; i < this.list.length; i++) {
  789. arr.push(this.list[i].warehouseName)
  790. }
  791. this.$router.push({ path: 'tranManagementWarehouseInOutTask',query:{stringList:arr,warehouseBaseInfoList:JSON.stringify(this.list)} })
  792. // this.$router.push({ path: 'tranManagementWarehouseInOutTask',query:{warehouseBaseInfoList:JSON.stringify(this.list)} })
  793. },
  794. dateFormat(fmt, date) {
  795. let ret
  796. const opt = {
  797. 'Y+': date.getFullYear().toString(), // 年
  798. 'm+': (date.getMonth() + 1).toString(), // 月
  799. 'd+': date.getDate().toString(), // 日
  800. 'H+': date.getHours().toString(), // 时
  801. // "M+": date.getMinutes().toString(), // 分
  802. // "S+": date.getSeconds().toString() // 秒
  803. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  804. }
  805. for (let k in opt) {
  806. ret = new RegExp('(' + k + ')').exec(fmt)
  807. if (ret) {
  808. fmt = fmt.replace(
  809. ret[1],
  810. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  811. )
  812. }
  813. }
  814. return fmt
  815. },
  816. handleClose() {
  817. this.accessoryTFs = false
  818. },
  819. handleSizeChange(val) {
  820. console.log(`每页 ${val} 条`)
  821. this.pageSize = val
  822. this.getList()
  823. },
  824. handleCurrentChange(val) {
  825. this.currentPage = val
  826. console.log(`当前页: ${val}`)
  827. this.getList()
  828. },
  829. getList() {
  830. getList({
  831. compId: localStorage.getItem('ws-pf_compId'),
  832. warehouseName: this.warehouseName,
  833. warehouseType: this.warehouseType,
  834. })
  835. .toPromise()
  836. .then((response) => {
  837. for (let i = 0; i <response.length; i++) {
  838. if(response[i].warehouseNumViewList){
  839. for (let q = 0; q < response[i].warehouseNumViewList.length; q++) {
  840. console.log(response[i].warehouseNumViewList[q])
  841. if(response[i].warehouseNumViewList[q].inNetWeight){
  842. response[i].warehouseNumViewList[q].inNetWeight=Number(response[i].warehouseNumViewList[q].inNetWeight).toFixed(3)
  843. }
  844. if(response[i].warehouseNumViewList[q].outNetWeight){
  845. response[i].warehouseNumViewList[q].outNetWeight=Number(response[i].warehouseNumViewList[q].outNetWeight).toFixed(3)
  846. }
  847. if(response[i].warehouseNumViewList[q].storage){
  848. response[i].warehouseNumViewList[q].storage=Number(response[i].warehouseNumViewList[q].storage).toFixed(3)
  849. }
  850. if(response[i].warehouseNumViewList[q].inNetWeight&&response[i].warehouseNumViewList[q].outNetWeight){
  851. response[i].warehouseNumViewList[q].surplus =(response[i].warehouseNumViewList[q].inNetWeight-response[i].warehouseNumViewList[q].outNetWeight).toFixed(3)
  852. }else if(response[i].warehouseNumViewList[q].inNetWeight){
  853. response[i].warehouseNumViewList[q].surplus=response[i].warehouseNumViewList[q].inNetWeight
  854. }
  855. }
  856. }
  857. }
  858. this.warehouseList = response
  859. })
  860. getsponsible({
  861. compId: localStorage.getItem('ws-pf_compId')
  862. }).toPromise()
  863. .then((response) => {
  864. this.list=response
  865. // console.log(response)
  866. })
  867. },
  868. editClick(row) {
  869. var status = ''
  870. if (row.status == '待执行' || row.status == '已完成') {
  871. status = '执行中'
  872. } else if (row.status == '执行中') {
  873. status = '已完成'
  874. }
  875. //cancelButtonClass: "btn-custom-cancel"
  876. this.$confirm(`是否将状态改为${status}`, {
  877. confirmButtonText: '确定',
  878. cancelButtonText: '取消',
  879. type: 'warning',
  880. })
  881. .then(() => {
  882. editstatus({ id: row.id })
  883. .toPromise()
  884. .then((response) => {
  885. this.$notify.success({
  886. title: '成功',
  887. message: '状态修改成功',
  888. })
  889. this.getList()
  890. })
  891. .catch((response) => {
  892. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  893. })
  894. })
  895. .catch(() => {
  896. return false
  897. })
  898. },
  899. selecttaskType(e) {
  900. for (var i = 0; i < this.taskTypeList.length; i++) {
  901. if (this.taskTypeList[i].value == e) {
  902. this.searchType = this.taskTypeList[i].type
  903. }
  904. }
  905. },
  906. fujian(row) {
  907. if (
  908. row.receiveAttachmentPath === null ||
  909. row.receiveAttachmentPath === ''
  910. ) {
  911. EventBus.$emit(
  912. 'warning',
  913. this.$t('system.noticeCircular.NoInformation')
  914. )
  915. } else {
  916. this.accessoryTFs = true
  917. }
  918. this.appendixIdss = row.receiveAttachmentPath
  919. },
  920. handleExamine(row) {
  921. this.$router.push({
  922. name: 'salesContractExamine',
  923. query: { id: row.id },
  924. })
  925. },
  926. // 关闭 dialog时 处理文件url 初始化upload组件
  927. handleCloe() {
  928. this.dialogViewSpareMoney = false
  929. },
  930. history(row) {
  931. billoperatehis({ id: row.id })
  932. .toPromise()
  933. .then((response) => {
  934. this.historyList = response
  935. })
  936. },
  937. find() {
  938. this.currentPage = 1
  939. this.getList()
  940. },
  941. // async exportlist() {
  942. // const { data } = await postExport(
  943. // this.parameter,
  944. // {},
  945. // { responseType: 'blob' }
  946. // ).toPromise()
  947. // downloadFile({
  948. // res: data,
  949. // fileName: `${
  950. // this.date.year + (this.date.month ? `-${this.date.month}` : '')
  951. // }_采购合同1`,
  952. // type: 'xls',
  953. // })
  954. // },
  955. },
  956. }
  957. </script>
  958. <style lang="scss" scoped>
  959. .connert {
  960. width: 90%;
  961. margin: 0 auto;
  962. }
  963. .vertical-text-left {
  964. width: 62px;
  965. text-align: right;
  966. }
  967. .el-button--primary {
  968. background-color: #5878e8;
  969. border-color: #5878e8;
  970. }
  971. .el-button--default {
  972. color: #8890b1;
  973. border-color: #e8eaf1;
  974. }
  975. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  976. width: 30px;
  977. margin-left: 0;
  978. border-top-left-radius: 0px;
  979. border-bottom-left-radius: 0px;
  980. }
  981. /deep/.findValue .el-input__inner {
  982. border-top-right-radius: 0px;
  983. border-bottom-right-radius: 0px;
  984. }
  985. .completed.el-button--default {
  986. border-color: #5878e8;
  987. background-color: #f6f7fc;
  988. color: #5878e8;
  989. }
  990. .putstorage.el-button--default,
  991. .deliverystorage.el-button--default {
  992. border-color: #8890b1;
  993. background-color: #fff;
  994. color: #8890b1;
  995. }
  996. /deep/.el-table td,
  997. /deep/.el-table th.is-leaf {
  998. border-right: 1px solid #e9ecf7;
  999. text-align: center;
  1000. }
  1001. /deep/.el-table tr td:first-child,
  1002. /deep/.el-table tr th.is-leaf:first-child {
  1003. border-left: 1px solid #e9ecf7;
  1004. }
  1005. /deep/.el-table .el-table__header .cell,
  1006. /deep/.el-table .el-table__body .cell {
  1007. -webkit-line-clamp: 10;
  1008. max-height: 400px;
  1009. }
  1010. .record,
  1011. .adjustment {
  1012. display: inline-block;
  1013. color: #5878e8;
  1014. padding: 0 4px !important;
  1015. position: relative;
  1016. }
  1017. .record:after {
  1018. position: absolute;
  1019. content: '';
  1020. display: block;
  1021. top: 5px;
  1022. right: -2px;
  1023. width: 1px;
  1024. height: 12px;
  1025. background: #e9ecf7;
  1026. }
  1027. /deep/.el-radio-button:first-child .el-radio-button__inner {
  1028. margin-left: 10px;
  1029. }
  1030. //分页
  1031. .el-pagination {
  1032. text-align: center;
  1033. white-space: nowrap;
  1034. padding: 2px 5px;
  1035. color: #303133;
  1036. font-weight: 700;
  1037. margin-bottom: 20px;
  1038. }
  1039. .main_css{
  1040. height: calc(100vh - 124px);
  1041. }
  1042. //打印弹窗
  1043. .mask {
  1044. background: black;
  1045. width: 100vw;
  1046. height: 100vh;
  1047. position: fixed;
  1048. top: 0;
  1049. z-index: 99;
  1050. opacity: 0.3;
  1051. }
  1052. .count{
  1053. text-align: center;
  1054. margin-bottom: 10px;
  1055. }
  1056. .print-type {
  1057. position: absolute;
  1058. top: 0;
  1059. bottom: 0;
  1060. left: 0;
  1061. right: 0;
  1062. margin: auto;
  1063. width: 340px;
  1064. height: 400px;
  1065. background: white;
  1066. border-radius: 10px;
  1067. z-index: 999;
  1068. .bottom-btn{
  1069. text-align: center;
  1070. }
  1071. }
  1072. .print-type-title {
  1073. text-align: center;
  1074. font-size: 18px;
  1075. // margin: 20px;
  1076. margin: 20px 20px 10px;
  1077. }
  1078. .print-type-checkbox {
  1079. padding-left: 20px;
  1080. .el-date-editor.el-input{
  1081. width: 85% !important;
  1082. }
  1083. .proportion_css{
  1084. width: 85%;
  1085. }
  1086. }
  1087. .page2-content {
  1088. border: 1px solid #d8dce6;
  1089. margin-top: 20px;
  1090. padding: 10px;
  1091. box-sizing: border-box;
  1092. text-align: center;
  1093. border-radius: 4px;
  1094. padding-bottom: 20px;
  1095. }
  1096. </style>