warehouseManagementList.vue 39 KB

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