add_check_the_weight.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. <template>
  2. <view class="warp">
  3. <view class="content">
  4. <view class="title">
  5. 基本信息
  6. </view>
  7. <view class="row">
  8. <view class="left">仓库</view>
  9. <view class="right">{{detailData.warehouseName}}</view>
  10. </view>
  11. <view class="row">
  12. <view class="left">任务编号</view>
  13. <view class="right">
  14. <view @click='show4=true'>{{detailData.inOutTaskNo?detailData.inOutTaskNo:'请选择任务编号'}}</view>
  15. <u-picker :range="taskNolist" range-key="inOutTaskNo" @confirm='tasknopicker($event)' v-model="show4"
  16. mode="selector">
  17. </u-picker>
  18. </view>
  19. </view>
  20. <view v-if="detailData.inOutType=='移库出库'" class="row">
  21. <view class="left">移库编号</view>
  22. <view>{{detailData.contractNo?detailData.contractNo:'请选择移库编号'}}</view>
  23. <!-- <view @click='show=true'>{{detailData.contractNo?detailData.contractNo:'请选择合同编号'}}</view> -->
  24. <u-picker :range="contractNoList" range-key="contractNo" @confirm='contractNopicker($event)' v-model="show" mode="selector" >
  25. </u-picker>
  26. </view>
  27. <view v-else class="row">
  28. <view class="left">合同编号</view>
  29. <view>{{detailData.contractNo?detailData.contractNo:'请选择合同编号'}}</view>
  30. <!-- <view @click='show=true'>{{detailData.contractNo?detailData.contractNo:'请选择合同编号'}}</view> -->
  31. <u-picker :range="contractNoList" range-key="contractNo" @confirm='contractNopicker($event)' v-model="show" mode="selector" >
  32. </u-picker>
  33. </view>
  34. <view style=' align-items: flex-start;' class="row">
  35. <view class="left">提示</view>
  36. <view class="right">
  37. {{detailData.tips?detailData.tips:'自动获取,不可编辑'}}
  38. </view>
  39. </view>
  40. <view class="row">
  41. <view class="left">货名</view>
  42. <view class="right">{{detailData.goodsName}}</view>
  43. </view>
  44. <view class="row">
  45. <view class="left">仓位号</view>
  46. <view @click='show1=true'>{{detailData.binNumber?detailData.binNumber:'请选择仓位号'}}</view>
  47. <u-picker :range="positionList" range-key="binNumber" @confirm='binNumberpicker($event)' v-model="show1" mode="selector" >
  48. </u-picker>
  49. </view>
  50. <view class="row" style="text-align: right;">
  51. <view class="left">囤位号</view>
  52. <input class="right-bottom" v-model='detailData.storageNumber' placeholder="输入囤位号"></input>
  53. </view>
  54. <view class="row row-bottom" @click="issueTypeClick">
  55. <view class="left">出库类型</view>
  56. <view class="right">{{issueTypeVal}}></view>
  57. </view>
  58. <view class="row ">
  59. <view class="left">出库日期</view>
  60. <view class="right">
  61. <view @click='show5=true'>{{detailData.inOutDate?detailData.inOutDate:'请选择出库日期'}}</view>
  62. <u-picker @confirm='inOutDatepicker($event)' :params="params" v-model="show5"
  63. mode="time">
  64. </u-picker>
  65. </view>
  66. </view>
  67. <view class="row ">
  68. <view class="left">运输方式</view>
  69. <view class="right">
  70. <view @click='show7=true'>{{detailData.outType?detailData.outType:'请选择运输方式'}}</view>
  71. <u-picker :range="multiSelector" range-key="name" @confirm='outtypepicker($event)' v-model="show7"
  72. mode="selector">
  73. </u-picker>
  74. </view>
  75. </view>
  76. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row" style="text-align: right;">
  77. <view class="left">车牌号</view>
  78. <input v-model='detailData.carNumber' class="right-bottom" placeholder="输入车牌号"></input>
  79. </view>
  80. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row" style="text-align: right;">
  81. <view class="left">箱号-1</view>
  82. <view class="right">
  83. <input v-model='detailData.boxNo' placeholder="请输入箱号" name="input" type="digit"></input>
  84. </view>
  85. </view>
  86. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row" style="text-align: right;">
  87. <view class="left">封号-1</view>
  88. <view class="right">
  89. <input v-model='detailData.titleNo' placeholder="请输入封号" name="input" type="digit"></input>
  90. </view>
  91. </view>
  92. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row" style="text-align: right;">
  93. <view class="left">箱号-2</view>
  94. <view class="right">
  95. <input v-model='detailData.boxNoOther' placeholder="请输入箱号" name="input" type="digit"></input>
  96. </view>
  97. </view>
  98. <view v-if='detailData.outType=="汽运"||detailData.outType=="集装箱船"' class="row" style="text-align: right;">
  99. <view class="left">封号-2</view>
  100. <view class="right">
  101. <input v-model='detailData.titleNoOther' placeholder="请输入封号" name="input" type="digit"></input>
  102. </view>
  103. </view>
  104. <view v-if='detailData.outType=="散船"' class="row" style="text-align: right;">
  105. <view class="left">船名</view>
  106. <view class="right">
  107. <input v-model='detailData.shipName' placeholder="请输入船名" name="input" type="digit"></input>
  108. </view>
  109. </view>
  110. <view v-if='detailData.outType=="散船"' class="row" style="text-align: right;">
  111. <view class="left">航次</view>
  112. <view class="right">
  113. <input v-model='detailData.shipNumber' placeholder="请输入航次" name="input" type="digit"></input>
  114. </view>
  115. </view>
  116. <view v-if='detailData.outType=="火运"' class="row" style="text-align: right;">
  117. <view class="left">车厢号-1</view>
  118. <view class="right">
  119. <input v-model='detailData.wingNumber' placeholder="请输入车厢号" name="input" type="digit"></input>
  120. </view>
  121. </view>
  122. <view v-if='detailData.outType=="火运"' class="row" style="text-align: right;">
  123. <view class="left">车厢号-2</view>
  124. <view class="right">
  125. <input v-model='detailData.wingNumberOther' placeholder="请输入车厢号" name="input" type="digit"></input>
  126. </view>
  127. </view>
  128. </view>
  129. <div class="content1">
  130. <view class="title">
  131. 检斤信息
  132. </view>
  133. <view class="row row-bottom">
  134. <view class="left">皮重(公斤)</view>
  135. <input class="right-bottom" v-model="detailData.tare" placeholder="输入皮重"></input>
  136. </view>
  137. </div>
  138. <!-- <u-select v-model="isShowContractNo" :list="contractNoList" @confirm="confirmContractNo"></u-select> -->
  139. <u-select v-model="isShowBinNo" :list="binNoList" @confirm="confirmBinNo"></u-select>
  140. <u-select v-model="isShowIssueType" :list="issueTypeList" @confirm="confirmIssueTypeNo"></u-select>
  141. <view class='footer'>
  142. <u-button type="primary" class="submit" @click="submit">提交</u-button>
  143. </view>
  144. </view>
  145. </template>
  146. <script>
  147. import helper from '@/common/helper.js';
  148. export default {
  149. data() {
  150. return {
  151. // isShowContractNo: false,
  152. isShowBinNo: false,
  153. isShowIssueType: false,
  154. issueTypeVal: "销售出库",
  155. detailData: {},
  156. id:'',
  157. cangId:'',
  158. show1:false,
  159. show:false,
  160. show4:false,
  161. show5:false,
  162. show7:false,
  163. contractNoList: [],
  164. positionList:[],
  165. binNoList: [],
  166. taskNolist:[],
  167. params:{year: true,
  168. month: true,
  169. day: true,},
  170. multiSelector: [{
  171. name: '汽运',
  172. value: '0',
  173. },
  174. {
  175. name: '火运',
  176. value: '1',
  177. },
  178. {
  179. name: '集装箱船',
  180. value: '2',
  181. },
  182. {
  183. name: '散船',
  184. value: '3',
  185. },
  186. ],
  187. issueTypeList: [{
  188. value: '1',
  189. label: '销售出库'
  190. },
  191. {
  192. value: '2',
  193. label: '移库出库'
  194. },
  195. {
  196. value: '3',
  197. label: '暂存出库'
  198. },
  199. {
  200. value: '4',
  201. label: '贸易服务出库'
  202. },
  203. ]
  204. }
  205. },
  206. onShow() {},
  207. onLoad(options) {
  208. this.cangId = options.cangId
  209. console.log(options)
  210. this.detailData.warehouseName = options.warehouseName
  211. this.getWeighingManagement()
  212. },
  213. methods: {
  214. outtypepicker(e){
  215. this.detailData.outType=this.multiSelector[e[0]].name
  216. },
  217. inOutDatepicker(e){
  218. this.detailData.inOutDate=e.year+'-'+e.month+'-'+e.day
  219. console.log(e)
  220. },
  221. tasknopicker(e){
  222. console.log(e)
  223. this.detailData.inOutTaskNo=this.taskNolist[e[0]].inOutTaskNo
  224. var data = this.taskNolist[e[0]]
  225. if (this.taskNolist[e[0]].contractNo) {
  226. this.detailData.contractNo = this.taskNolist[e[0]].contractNo
  227. }else {
  228. this.detailData.contractNo = this.taskNolist[e[0]].moveTaskNo
  229. }
  230. for (let i = 0; i < this.contractNoList.length; i++) {
  231. if(this.detailData.contractNo==this.contractNoList[i].contractNo){
  232. this.detailData.goodsName = this.contractNoList[i].goodsName
  233. this.detailData.goodsNameKey = this.contractNoList[i].goodsNameKey
  234. this.detailData.grade = this.contractNoList[i].grade
  235. this.detailData.inOutType = this.contractNoList[i].inOutType
  236. if(this.detailData.inOutType=='销售出库'){
  237. this.warehouseTradeCount = '000' + this.warehouseTradeCount
  238. this.detailData.qualityNo='XSCK'+this.getdate()+this.commonWarehouseNo+this.warehouseTradeCount.substring(this.warehouseTradeCount.length - 4)
  239. if (!this.contractNoList[i].unitContractPrice) {
  240. this.detailData.tips = '买方' + this.contractNoList[i].seller
  241. } else {
  242. this.detailData.tips ='买方' +this.contractNoList[i].seller +'( ' + this.contractNoList[i].unitContractPrice +'元/吨)'
  243. }
  244. this.detailData.inOutTypeKey = 1
  245. }else if(this.detailData.inOutType=='移库出库'){
  246. this.warehouseTradeCount = '000' + this.warehouseTradeCount
  247. this.detailData.qualityNo='YKCK'+this.getdate()+this.commonWarehouseNo+this.warehouseTradeCount.substring(this.warehouseTradeCount.length - 4)
  248. if (this.contractNoList[i].unitContractPrice) {
  249. this.detailData.tips ='入货库' +data.sendWarehouse +' (' +this.contractNoList[i].unitContractPrice +'元/吨)'
  250. } else {
  251. this.detailData.tips = '入货库' + data.sendWarehouse
  252. }
  253. this.detailData.inOutTypeKey = 3
  254. }else if (this.contractNoList[i].inOutType == '暂存入库') {
  255. this.detailData.inOutTypeKey = 4
  256. } else if (this.contractNoList[i].inOutType == '贸易服务出库') {
  257. this.detailData.inOutTypeKey = 5
  258. } else if (this.contractNoList[i].inOutType == '采购出库') {
  259. this.detailData.inOutTypeKey = 6
  260. }
  261. this.cost = this.contractNoList[i].contractPrice
  262. if (this.cost) {
  263. this.isGetCost = true
  264. this.detailData.cost =this.cost - this.detailData.deductionAmount
  265. } else {
  266. this.isGetCost = false
  267. this.detailData.cost = this.detailData.cost
  268. }
  269. if (this.contractNoList[i].inOutType == '移库入库') {
  270. this.isSelectType = false
  271. } else {
  272. this.isSelectType = true
  273. }
  274. if (this.contractNoList[i].priceType == '随行就市') {
  275. this.disabled1 = !this.disabled1
  276. }
  277. if (this.contractNoList[i].deliverType == '1') {
  278. this.carstatus = true
  279. } else {
  280. this.carstatus = false
  281. }
  282. if (this.contractNoList[i].tranCarInfoList) {
  283. this.tranCarInfoList = this.contractNoList[i].tranCarInfoList
  284. // this.carstatus = true
  285. }else{
  286. this.options2 =[]
  287. }
  288. this.fleetNameList=this.contractNoList[i].tranCarInfoList1
  289. }
  290. }
  291. console.log(this.gridList)
  292. },
  293. contractNopicker(e){
  294. this.detailData.goodsName=this.contractNoList[e[0]].goodsName
  295. this.detailData.contractNo=this.contractNoList[e[0]].contractNo
  296. },
  297. binNumberpicker(e){
  298. this.detailData.binNumber=this.positionList[e[0]].binNumber
  299. },
  300. getWeighingManagement(){
  301. console.log(this.cangId)
  302. this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse',
  303. {id: this.cangId}).then(res => {
  304. if(res.data.code==200){
  305. this.positionList = res.data.data.warehousePositionInfoList
  306. }
  307. })
  308. this.$api.doRequest('get', '/inOutWarehouseTask/selectInOutWarehouseNo', {
  309. flag: 1,
  310. warehouseName:this.detailData.warehouseName
  311. }).then(res => {
  312. console.log(res)
  313. this.taskNolist=res.data.data
  314. })
  315. this.multiSelector1=[]
  316. this.$api.doRequest('get', '/inOutWarehouseTask/getContractNo', {
  317. warehouseName:this.detailData.warehouseName
  318. }).then(res => {
  319. // console.log(res)
  320. if(res.data.data.contractManagementInfoList){
  321. for (let i = 0; i < res.data.data.contractManagementInfoList.length; i++) {
  322. res.data.data.contractMangementInfoList[i].name='自运 ('+
  323. res.data.data.contractMangementInfoList[i].contractNo+' '+res.data.data.contractMangementInfoList[i].seller+')'
  324. this.multiSelector1.push(res.data.data.contractManagementInfoList[i])
  325. }
  326. }
  327. // this.taskNolist=res.data.data
  328. })
  329. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList',{
  330. compId: '',
  331. flag:5
  332. }).then(res => {
  333. if(res.data.code==200){
  334. this.contractNoList = res.data.data
  335. }
  336. })
  337. },
  338. contractNoClick() {
  339. uni.navigateTo({
  340. url:"selectContractNo?compId="+this.detailData.compId
  341. })
  342. },
  343. issueTypeClick() {
  344. this.isShowIssueType = true
  345. },
  346. confirmContractNo(e) {},
  347. confirmBinNo(e) {},
  348. confirmIssueTypeNo(e) {
  349. console.log(e)
  350. this.detailData.inOutType=e[0].label
  351. this.issueTypeVal = e[0].label
  352. },
  353. submit(){
  354. if (!this.detailData.contractNo) {
  355. this.$api.msg('合同编号不能为空')
  356. return
  357. }
  358. if (!this.detailData.binNumber) {
  359. this.$api.msg('仓位号不能为空')
  360. return
  361. }
  362. if (!this.detailData.storageNumber) {
  363. this.$api.msg('囤位号不能为空')
  364. return
  365. }
  366. if (
  367. this.detailData.storageNumber.length < 1 ||
  368. this.detailData.storageNumber.length > 10
  369. ) {
  370. this.$api.msg('囤位号不超过10个字符!')
  371. return
  372. }
  373. if (!this.detailData.carNumber) {
  374. this.$api.msg('车牌号不能为空')
  375. return
  376. }
  377. if (this.detailData.carNumber.length != 7) {
  378. this.$api.msg('车牌号输入错误')
  379. return
  380. }
  381. if (!this.detailData.inOutType) {
  382. this.$api.msg('出库类型不能为空')
  383. return
  384. }
  385. var that = this
  386. uni.showModal({
  387. content:"确定提交检斤信息?",
  388. success(res) {
  389. if(res.confirm){
  390. that.$api.doRequest('post', '/weighingManagement/api/editTareOut',
  391. that.detailData).then(res => {
  392. if(res.data.code==200){
  393. that.$api.msg('提交成功')
  394. uni.navigateBack()
  395. }
  396. })
  397. }
  398. }
  399. })
  400. }
  401. },
  402. }
  403. </script>
  404. <style scoped lang="scss">
  405. uni-page-body {
  406. overflow: hidden;
  407. }
  408. .warp {
  409. margin: 20rpx;
  410. }
  411. .content,
  412. .content1 {
  413. border-radius: 20rpx;
  414. background: white;
  415. padding: 20rpx;
  416. .title {
  417. font-size: 28rpx;
  418. font-weight: 600;
  419. color: #333333;
  420. }
  421. .row {
  422. display: flex;
  423. justify-content: space-between;
  424. padding: 31rpx 0;
  425. .right {
  426. font-size: 28rpx;
  427. color: #333333;
  428. }
  429. }
  430. .row-bottom {
  431. border: 0;
  432. .right-bottom {
  433. width: 300rpx;
  434. text-align: right;
  435. }
  436. }
  437. }
  438. .content1 {
  439. margin-top: 20rpx;
  440. }
  441. .footer{
  442. position: fixed;
  443. bottom:0;
  444. width:100%;
  445. padding:10px;
  446. background:#fff;
  447. .submit {
  448. width: 90%;
  449. background: #22C572;
  450. border-radius: 50rpx;
  451. }
  452. }
  453. .row input{
  454. font-size:14px;
  455. }
  456. </style>