warehouseManagementList.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122
  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. if(this.parameter.radio == 3){
  463. const {
  464. data
  465. } = await postExport({startDate:this.parameter.startDate,endDate:this.parameter.endDate,warehouseName:this.parameter.warehouseName}, {}, {
  466. responseType: 'blob'
  467. }).toPromise()
  468. downloadFile({
  469. res: data,
  470. fileName: `${
  471. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  472. }导出入库记录`,
  473. type: 'xls',
  474. })
  475. }else if(this.parameter.radio == 2){
  476. const {
  477. data
  478. } = await postExportOut({startDate:this.parameter.startDate,endDate:this.parameter.endDate,warehouseName:this.parameter.warehouseName}, {}, {
  479. responseType: 'blob'
  480. }).toPromise()
  481. downloadFile({
  482. res: data,
  483. fileName: `${
  484. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  485. }导出出库记录`,
  486. type: 'xls',
  487. })
  488. }
  489. }else if(this.headerText == "打印记录"){
  490. console.log(this.parameter.startDate)
  491. addselectinfoList({
  492. compId: localStorage.getItem('ws-pf_compId'),
  493. startDate:this.parameter.startDate,
  494. endDate:this.parameter.endDate,
  495. warehouseName:this.parameter.warehouseName,
  496. searchType:this.parameter.radio,
  497. currentPage: 1,
  498. pageSize: 999,
  499. }).toPromise()
  500. .then((response) => {
  501. if(response.records.length == 0){
  502. this.$message.error("暂未查到所要打印的出入库信息")
  503. }else{
  504. var warehousePrint = response.records
  505. if(this.parameter.proportion){
  506. var countWeight = 0
  507. for(let i = 0 ; i < warehousePrint.length ; i++){
  508. countWeight += Number(warehousePrint[i].netWeight)
  509. }
  510. var increment = (countWeight * (Number(this.parameter.proportion)/100)).toFixed(2)//所要增加的量
  511. printAdd().toPromise()
  512. .then((response1) => {
  513. // setTimeout(function(){
  514. for(let i = 0 ; i < response1.length ; i++){
  515. increment = Number(increment)
  516. if(increment > 0){
  517. let index = Math.abs(Math.round(Math.random()*response1.length - 1))
  518. console.log(Math.abs(Math.round(Math.random()* warehousePrint.length - 1)),response1[index])
  519. let pro = response1[index] //取出假数据并设定值
  520. pro.inOutDate = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].inOutDate
  521. pro.contractNo = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].contractNo
  522. pro.companyName = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].companyName
  523. pro.goodsName = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].goodsName
  524. pro.boxNo = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].boxNo
  525. pro.netWeight = Number((Math.random()*(70-10+1)+10).toFixed(2))
  526. pro.tare = Number((Math.random()*(20-10+1)+10).toFixed(2))
  527. pro.grossWeight = Number((pro.tare + pro.netWeight).toFixed(2))
  528. if(pro.netWeight < increment){
  529. increment = (increment - pro.netWeight).toFixed(2) //所要增的量
  530. if(increment < 10 && pro.netWeight <= 60){
  531. pro.netWeight += Number(increment)
  532. pro.grossWeight = Number((pro.tare + pro.netWeight).toFixed(2))
  533. increment = 0
  534. warehousePrint.push(pro)
  535. }else{
  536. increment -= pro.netWeight
  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. }
  547. sessionStorage.setItem("inOutWarehouse_Print",JSON.stringify(warehousePrint))
  548. let i = ""
  549. i = this.parameter.radio+"&warehouseName=" + this.parameter.warehouseName
  550. window.open('../../../../../static/warehousePrint.html?type=' + i)
  551. // return
  552. }
  553. // },2000)
  554. })
  555. }else{
  556. sessionStorage.setItem("inOutWarehouse_Print",JSON.stringify(response.records))
  557. let i = ""
  558. i = this.parameter.radio+"&warehouseName=" + this.parameter.warehouseName
  559. window.open('../../../../../static/warehousePrint.html?type=' + i)
  560. }
  561. }
  562. })
  563. }
  564. },
  565. startChane(e){
  566. console.log(e)
  567. },
  568. //清仓
  569. clearance(row) {
  570. console.log(row.outNumber)
  571. if (row.outNumber > 0) {
  572. this.$confirm(`你还有未完善的出库记录,请完善提交后再进行操作`, {
  573. cancelButtonText: '关闭',
  574. })
  575. .then(() => {})
  576. .catch(() => {
  577. return false
  578. })
  579. } else {
  580. this.$confirm(
  581. `清仓操作代表库存已清零,清仓后不可进行出库操作,是否确定清仓`,
  582. {
  583. confirmButtonText: '确定',
  584. cancelButtonText: '取消',
  585. type: 'warning',
  586. }
  587. )
  588. .then(() => {
  589. clearancee({ id: row.warehouseId })
  590. .toPromise()
  591. .then((response) => {
  592. this.$notify.success({
  593. title: '成功',
  594. message: '状态清仓成功',
  595. })
  596. this.getList()
  597. })
  598. .catch((response) => {})
  599. })
  600. .catch(() => {
  601. return false
  602. })
  603. }
  604. },
  605. //出库
  606. delivery(item) {
  607. this.$router.push({
  608. path: 'warehouseManagementDelivery',
  609. query: {
  610. baseId: item.warehouseId,
  611. positionId: item.binNumberId,
  612. warehouseName: item.warehouseName,
  613. binNumber: item.binNumber,
  614. capacity: item.capacity,
  615. warehouseType: this.warehouseType,
  616. warehouseId: item.warehouseId,
  617. },
  618. })
  619. },
  620. //入库
  621. warehousing(item) {
  622. var free = 0
  623. for (var i = 0; i < item.warehouseNumViewList.length; i++) {
  624. free += Number(item.warehouseNumViewList[i].storage)
  625. }
  626. this.$router.push({
  627. path: 'warehouseManagementPut',
  628. query: {
  629. baseId: item.warehouseId,
  630. positionId: item.binNumberId,
  631. warehouseName: item.warehouseName,
  632. binNumber: item.binNumber,
  633. capacity: item.capacity - free,
  634. id: item.id,
  635. warehouseType: this.warehouseType,
  636. createType: item.createType,
  637. },
  638. })
  639. },
  640. //毛检
  641. warehousing1(item) {
  642. var free = 0
  643. for (var i = 0; i < item.warehouseNumViewList.length; i++) {
  644. free += Number(item.warehouseNumViewList[i].storage)
  645. }
  646. this.$router.push({
  647. path: 'warehouseManagementGross',
  648. query: {
  649. baseId: item.warehouseId,
  650. positionId: item.binNumberId,
  651. warehouseName: item.warehouseName,
  652. binNumber: item.binNumber,
  653. capacity: item.capacity - free,
  654. id: item.id,
  655. warehouseType: this.warehouseType,
  656. createType: item.createType,
  657. information:'毛重检斤',
  658. allowEdit:item.allowEdit
  659. },
  660. })
  661. },
  662. //皮检
  663. delivery1(item) {
  664. this.$router.push({
  665. path: 'warehouseManagementTare',
  666. query: {
  667. baseId: item.warehouseId,
  668. positionId: item.binNumberId,
  669. warehouseName: item.warehouseName,
  670. binNumber: item.binNumber,
  671. capacity: item.capacity,
  672. warehouseType: this.warehouseType,
  673. warehouseId: item.warehouseId,
  674. information:'皮重检斤',
  675. allowEdit:item.allowEdit
  676. },
  677. })
  678. },
  679. getSpanArr(data) {
  680. let that = this
  681. //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
  682. that.spanArr = []
  683. that.pos = 0
  684. //遍历数据
  685. data.forEach((item, index) => {
  686. //判断是否是第一项
  687. // if (index === 0) {
  688. // this.spanArr.push(1)
  689. // this.pos = 0
  690. // } else {
  691. //不是第一项时,就根据标识去存储
  692. if (data[index].warehouseNumViewList.length > 1) {
  693. // 查找到符合条件的数据时每次要把之前存储的数据+1
  694. this.spanArr[this.pos] = data[index].warehouseNumViewList.length
  695. this.spanArr.push(0)
  696. } else {
  697. // 没有符合的数据时,要记住当前的index
  698. this.spanArr.push(1)
  699. this.pos = index
  700. }
  701. // }
  702. })
  703. },
  704. //待完成//传参
  705. nocomplete(row) {
  706. if (row.number > 0) {
  707. this.$router.push({
  708. path: 'warehouseManagementNoComplete',
  709. query: {
  710. baseId: row.warehouseId,
  711. positionId: row.binNumberId,
  712. warehouseName: row.warehouseName,
  713. binNumber: row.binNumber,
  714. warehouseType: this.warehouseType,
  715. createType: row.createType,
  716. },
  717. })
  718. }
  719. },
  720. //检斤待完成
  721. nocomplete1(row,status) {
  722. this.$router.push({
  723. path: 'warehouseManagementNoWeight',
  724. query: {
  725. baseId: row.warehouseId,
  726. positionId: row.binNumberId,
  727. warehouseName: row.warehouseName,
  728. binNumber: row.binNumber,
  729. warehouseType: this.warehouseType,
  730. createType: row.createType,
  731. status:status
  732. },
  733. })
  734. },
  735. //记录
  736. record(item) {
  737. this.$router.push({
  738. name: 'warehouseManagementRecord',
  739. query: {
  740. baseId: item.warehouseId,
  741. positionId: item.binNumberId,
  742. warehouseName: item.warehouseName,
  743. remark: item.remark,
  744. binNumber: item.binNumber,
  745. capacity: item.capacity,
  746. warehouseType: this.warehouseType,
  747. },
  748. })
  749. },
  750. //盘损
  751. loss(item) {
  752. this.$router.push({
  753. path: 'warehouseManagementIoss',
  754. query: {
  755. baseId: item.warehouseId,
  756. positionId: item.binNumberId,
  757. warehouseName: item.warehouseName,
  758. binNumber: item.binNumber,
  759. },
  760. })
  761. },
  762. mintor(){
  763. this.$router.push({ path: 'warehouseManagementMintor' })
  764. },
  765. changeradio(e) {
  766. this.getList()
  767. },
  768. //查看
  769. handleLook() {
  770. this.$router.push({ path: 'warehouseManagementLook' })
  771. },
  772. //添加
  773. handleAdd() {
  774. this.$router.push({ path: 'warehouseManagementAdd' })
  775. },
  776. //编辑
  777. handleEdit() {
  778. this.$router.push({ path: 'warehouseManagementEdit' })
  779. },
  780. handleDelete() {
  781. this.$router.push({ path: 'warehouseManagementDelete' })
  782. },
  783. //任务
  784. handlTask(){
  785. var arr=[]
  786. console.log(this.list)
  787. for (let i = 0; i < this.list.length; i++) {
  788. arr.push(this.list[i].warehouseName)
  789. }
  790. this.$router.push({ path: 'tranManagementWarehouseInOutTask',query:{stringList:arr,warehouseBaseInfoList:JSON.stringify(this.list)} })
  791. // this.$router.push({ path: 'tranManagementWarehouseInOutTask',query:{warehouseBaseInfoList:JSON.stringify(this.list)} })
  792. },
  793. dateFormat(fmt, date) {
  794. let ret
  795. const opt = {
  796. 'Y+': date.getFullYear().toString(), // 年
  797. 'm+': (date.getMonth() + 1).toString(), // 月
  798. 'd+': date.getDate().toString(), // 日
  799. 'H+': date.getHours().toString(), // 时
  800. // "M+": date.getMinutes().toString(), // 分
  801. // "S+": date.getSeconds().toString() // 秒
  802. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  803. }
  804. for (let k in opt) {
  805. ret = new RegExp('(' + k + ')').exec(fmt)
  806. if (ret) {
  807. fmt = fmt.replace(
  808. ret[1],
  809. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  810. )
  811. }
  812. }
  813. return fmt
  814. },
  815. handleClose() {
  816. this.accessoryTFs = false
  817. },
  818. handleSizeChange(val) {
  819. console.log(`每页 ${val} 条`)
  820. this.pageSize = val
  821. this.getList()
  822. },
  823. handleCurrentChange(val) {
  824. this.currentPage = val
  825. console.log(`当前页: ${val}`)
  826. this.getList()
  827. },
  828. getList() {
  829. getList({
  830. compId: localStorage.getItem('ws-pf_compId'),
  831. warehouseName: this.warehouseName,
  832. warehouseType: this.warehouseType,
  833. })
  834. .toPromise()
  835. .then((response) => {
  836. for (let i = 0; i <response.length; i++) {
  837. if(response[i].warehouseNumViewList){
  838. for (let q = 0; q < response[i].warehouseNumViewList.length; q++) {
  839. console.log(response[i].warehouseNumViewList[q])
  840. if(response[i].warehouseNumViewList[q].inNetWeight){
  841. response[i].warehouseNumViewList[q].inNetWeight=Number(response[i].warehouseNumViewList[q].inNetWeight).toFixed(3)
  842. }
  843. if(response[i].warehouseNumViewList[q].outNetWeight){
  844. response[i].warehouseNumViewList[q].outNetWeight=Number(response[i].warehouseNumViewList[q].outNetWeight).toFixed(3)
  845. }
  846. if(response[i].warehouseNumViewList[q].storage){
  847. response[i].warehouseNumViewList[q].storage=Number(response[i].warehouseNumViewList[q].storage).toFixed(3)
  848. }
  849. if(response[i].warehouseNumViewList[q].inNetWeight&&response[i].warehouseNumViewList[q].outNetWeight){
  850. response[i].warehouseNumViewList[q].surplus =(response[i].warehouseNumViewList[q].inNetWeight-response[i].warehouseNumViewList[q].outNetWeight).toFixed(3)
  851. }else if(response[i].warehouseNumViewList[q].inNetWeight){
  852. response[i].warehouseNumViewList[q].surplus=response[i].warehouseNumViewList[q].inNetWeight
  853. }
  854. }
  855. }
  856. }
  857. this.warehouseList = response
  858. })
  859. getsponsible({
  860. compId: localStorage.getItem('ws-pf_compId')
  861. }).toPromise()
  862. .then((response) => {
  863. this.list=response
  864. // console.log(response)
  865. })
  866. },
  867. editClick(row) {
  868. var status = ''
  869. if (row.status == '待执行' || row.status == '已完成') {
  870. status = '执行中'
  871. } else if (row.status == '执行中') {
  872. status = '已完成'
  873. }
  874. //cancelButtonClass: "btn-custom-cancel"
  875. this.$confirm(`是否将状态改为${status}`, {
  876. confirmButtonText: '确定',
  877. cancelButtonText: '取消',
  878. type: 'warning',
  879. })
  880. .then(() => {
  881. editstatus({ id: row.id })
  882. .toPromise()
  883. .then((response) => {
  884. this.$notify.success({
  885. title: '成功',
  886. message: '状态修改成功',
  887. })
  888. this.getList()
  889. })
  890. .catch((response) => {
  891. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  892. })
  893. })
  894. .catch(() => {
  895. return false
  896. })
  897. },
  898. selecttaskType(e) {
  899. for (var i = 0; i < this.taskTypeList.length; i++) {
  900. if (this.taskTypeList[i].value == e) {
  901. this.searchType = this.taskTypeList[i].type
  902. }
  903. }
  904. },
  905. fujian(row) {
  906. if (
  907. row.receiveAttachmentPath === null ||
  908. row.receiveAttachmentPath === ''
  909. ) {
  910. EventBus.$emit(
  911. 'warning',
  912. this.$t('system.noticeCircular.NoInformation')
  913. )
  914. } else {
  915. this.accessoryTFs = true
  916. }
  917. this.appendixIdss = row.receiveAttachmentPath
  918. },
  919. handleExamine(row) {
  920. this.$router.push({
  921. name: 'salesContractExamine',
  922. query: { id: row.id },
  923. })
  924. },
  925. // 关闭 dialog时 处理文件url 初始化upload组件
  926. handleCloe() {
  927. this.dialogViewSpareMoney = false
  928. },
  929. history(row) {
  930. billoperatehis({ id: row.id })
  931. .toPromise()
  932. .then((response) => {
  933. this.historyList = response
  934. })
  935. },
  936. find() {
  937. this.currentPage = 1
  938. this.getList()
  939. },
  940. // async exportlist() {
  941. // const { data } = await postExport(
  942. // this.parameter,
  943. // {},
  944. // { responseType: 'blob' }
  945. // ).toPromise()
  946. // downloadFile({
  947. // res: data,
  948. // fileName: `${
  949. // this.date.year + (this.date.month ? `-${this.date.month}` : '')
  950. // }_采购合同1`,
  951. // type: 'xls',
  952. // })
  953. // },
  954. },
  955. }
  956. </script>
  957. <style lang="scss" scoped>
  958. .connert {
  959. width: 90%;
  960. margin: 0 auto;
  961. }
  962. .vertical-text-left {
  963. width: 62px;
  964. text-align: right;
  965. }
  966. .el-button--primary {
  967. background-color: #5878e8;
  968. border-color: #5878e8;
  969. }
  970. .el-button--default {
  971. color: #8890b1;
  972. border-color: #e8eaf1;
  973. }
  974. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  975. width: 30px;
  976. margin-left: 0;
  977. border-top-left-radius: 0px;
  978. border-bottom-left-radius: 0px;
  979. }
  980. /deep/.findValue .el-input__inner {
  981. border-top-right-radius: 0px;
  982. border-bottom-right-radius: 0px;
  983. }
  984. .completed.el-button--default {
  985. border-color: #5878e8;
  986. background-color: #f6f7fc;
  987. color: #5878e8;
  988. }
  989. .putstorage.el-button--default,
  990. .deliverystorage.el-button--default {
  991. border-color: #8890b1;
  992. background-color: #fff;
  993. color: #8890b1;
  994. }
  995. /deep/.el-table td,
  996. /deep/.el-table th.is-leaf {
  997. border-right: 1px solid #e9ecf7;
  998. text-align: center;
  999. }
  1000. /deep/.el-table tr td:first-child,
  1001. /deep/.el-table tr th.is-leaf:first-child {
  1002. border-left: 1px solid #e9ecf7;
  1003. }
  1004. /deep/.el-table .el-table__header .cell,
  1005. /deep/.el-table .el-table__body .cell {
  1006. -webkit-line-clamp: 10;
  1007. max-height: 400px;
  1008. }
  1009. .record,
  1010. .adjustment {
  1011. display: inline-block;
  1012. color: #5878e8;
  1013. padding: 0 4px !important;
  1014. position: relative;
  1015. }
  1016. .record:after {
  1017. position: absolute;
  1018. content: '';
  1019. display: block;
  1020. top: 5px;
  1021. right: -2px;
  1022. width: 1px;
  1023. height: 12px;
  1024. background: #e9ecf7;
  1025. }
  1026. /deep/.el-radio-button:first-child .el-radio-button__inner {
  1027. margin-left: 10px;
  1028. }
  1029. //分页
  1030. .el-pagination {
  1031. text-align: center;
  1032. white-space: nowrap;
  1033. padding: 2px 5px;
  1034. color: #303133;
  1035. font-weight: 700;
  1036. margin-bottom: 20px;
  1037. }
  1038. .main_css{
  1039. height: calc(100vh - 124px);
  1040. }
  1041. //打印弹窗
  1042. .mask {
  1043. background: black;
  1044. width: 100vw;
  1045. height: 100vh;
  1046. position: fixed;
  1047. top: 0;
  1048. z-index: 99;
  1049. opacity: 0.3;
  1050. }
  1051. .count{
  1052. text-align: center;
  1053. margin-bottom: 10px;
  1054. }
  1055. .print-type {
  1056. position: absolute;
  1057. top: 0;
  1058. bottom: 0;
  1059. left: 0;
  1060. right: 0;
  1061. margin: auto;
  1062. width: 340px;
  1063. height: 400px;
  1064. background: white;
  1065. border-radius: 10px;
  1066. z-index: 999;
  1067. .bottom-btn{
  1068. text-align: center;
  1069. }
  1070. }
  1071. .print-type-title {
  1072. text-align: center;
  1073. font-size: 18px;
  1074. // margin: 20px;
  1075. margin: 20px 20px 10px;
  1076. }
  1077. .print-type-checkbox {
  1078. padding-left: 20px;
  1079. .el-date-editor.el-input{
  1080. width: 85% !important;
  1081. }
  1082. .proportion_css{
  1083. width: 85%;
  1084. }
  1085. }
  1086. .page2-content {
  1087. border: 1px solid #d8dce6;
  1088. margin-top: 20px;
  1089. padding: 10px;
  1090. box-sizing: border-box;
  1091. text-align: center;
  1092. border-radius: 4px;
  1093. padding-bottom: 20px;
  1094. }
  1095. </style>