warehouseManagementList.vue 39 KB

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