out_quality_testing.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. <template>
  2. <view>
  3. <view class='wrap'>
  4. <view class='title_b'>基本信息</view>
  5. <view class="c-row ">
  6. <view class="title">仓库</view>
  7. <view class="con-list">
  8. {{gridList.warehouseName}}
  9. </view>
  10. </view>
  11. <view class="c-row ">
  12. <view class="title">合同编号</view>
  13. <view class="con-list">
  14. {{gridList.contractNo}}
  15. </view>
  16. </view>
  17. <view class="c-row ">
  18. <view class="title">货名</view>
  19. <view class="con-list">
  20. {{gridList.goodsName}}
  21. </view>
  22. </view>
  23. <view class="c-row ">
  24. <view class="title">车牌号</view>
  25. <view class="con-list">
  26. <input v-model='gridList.carNumber' placeholder="请输入车牌号" name="input"></input>
  27. </view>
  28. </view>
  29. <view class="c-row ">
  30. <view class="title">仓位号</view>
  31. <view class="con-list">
  32. <view @click='show=true'>{{gridList.binNumber}}</view>
  33. <u-picker :range="warehouseList" range-key="binNumber" @confirm='binNumberpicker($event)'
  34. v-model="show" mode="selector">
  35. </u-picker>
  36. </view>
  37. </view>
  38. <view class="c-row ">
  39. <view class="title">囤位号</view>
  40. <view class="con-list">
  41. <input v-model='gridList.storageTagNo' placeholder="请输入囤位号" name="input"></input>
  42. </view>
  43. </view>
  44. <view class="c-row">
  45. <view class="title">出库类型</view>
  46. <view class="con-list">
  47. {{gridList.inOutType}}
  48. </view>
  49. </view>
  50. <view class="c-row ">
  51. <view class="title">出库日期</view>
  52. <view class="con-list">
  53. <view>{{gridList.inOutDate}}</view>
  54. </view>
  55. </view>
  56. <view class="c-row ">
  57. <view class="title">运输方式</view>
  58. <view class="con-list">
  59. <view>{{gridList.outType}}</view>
  60. </view>
  61. </view>
  62. <view class="c-row ">
  63. <view class="title">车队</view>
  64. <view class="con-list">
  65. <view>{{gridList.fleet}}</view>
  66. </view>
  67. </view>
  68. <view v-if="gridList.outType=='汽运'||gridList.outType == '集装箱船'" class="c-row ">
  69. <view class="title">箱号-1</view>
  70. <view class="con-list">
  71. {{gridList.boxNo}}
  72. </view>
  73. </view>
  74. <view v-if="gridList.outType== '汽运'||gridList.outType == '集装箱船'" class="c-row ">
  75. <view class="title">封号-1</view>
  76. <view class="con-list">
  77. {{gridList.titleNo}}
  78. </view>
  79. </view>
  80. <view v-if="gridList.outType=='汽运'||gridList.outType == '集装箱船'" class="c-row ">
  81. <view class="title">箱号-2</view>
  82. <view class="con-list">
  83. {{gridList.boxNoOther}}
  84. </view>
  85. </view>
  86. <view v-if="gridList.outType== '汽运'||gridList.outType == '集装箱船'" class="c-row ">
  87. <view class="title">封号-2</view>
  88. <view class="con-list">
  89. {{gridList.titleNoOther}}
  90. </view>
  91. </view>
  92. </view>
  93. <view style='margin-bottom:300rpx;'>
  94. <view class='wrap'>
  95. <view class='title_b'>化验信息</view>
  96. <view class="c-row ">
  97. <view class="title">等级</view>
  98. <view class="con-list">
  99. <view @click='show1=true'>{{gridList.grade?gridList.grade:'请选择等级'}}</view>
  100. <u-picker :range="gradeList" range-key="value" @confirm='gradepicker($event)' v-model="show1"
  101. mode="selector">
  102. </u-picker>
  103. </view>
  104. </view>
  105. <view class="c-row ">
  106. <view class="title">水分(%)</view>
  107. <view class="con-list">
  108. <input v-model='gridList.waterContent' placeholder="请输入水分占比" name="input"></input>
  109. </view>
  110. </view>
  111. <view class="c-row ">
  112. <view class="title">容重(克/升)</view>
  113. <view class="con-list">
  114. <input v-model='gridList.bulkDensity' placeholder="请输入容重" name="input"></input>
  115. </view>
  116. </view>
  117. <view class="c-row ">
  118. <view class="title">不完善粒(%)</view>
  119. <view class="con-list">
  120. <input v-model='gridList.imperfectGrain' placeholder="请输入不完整粒占比" name="input"></input>
  121. </view>
  122. </view>
  123. <view class="c-row ">
  124. <view class="title">杂质(%)</view>
  125. <view class="con-list">
  126. <input v-model='gridList.impurity' placeholder="请输入杂质占比" name="input"></input>
  127. </view>
  128. </view>
  129. <view class="c-row ">
  130. <view class="title">霉变粒(%)</view>
  131. <view class="con-list">
  132. <input v-model='gridList.mildewGrain' placeholder="请输入霉变粒占比" name="input"></input>
  133. </view>
  134. </view>
  135. <view class="c-row ">
  136. <view class="title">热损伤(%)</view>
  137. <view class="con-list">
  138. <input v-model='gridList.jiaorenli' placeholder="请输入热损伤占比" name="input"></input>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. <view class="footer">
  144. <view @click='submit' class="button">提交</view>
  145. </view>
  146. </view>
  147. </template>
  148. <script>
  149. import dragButton from "@/components/drag-button/drag-button.vue";
  150. import {
  151. mapState
  152. } from 'vuex';
  153. let startY = 0,
  154. moveY = 0,
  155. pageAtTop = true;
  156. export default {
  157. components: {
  158. dragButton
  159. },
  160. data() {
  161. return {
  162. inputShow: false,
  163. modalName: '',
  164. mycarStyle: '',
  165. feild: undefined,
  166. id: 0,
  167. show: false,
  168. selector: [],
  169. show1: false,
  170. inputContent: '',
  171. coverTransform: 'translateY(0px)',
  172. coverTransition: '0s',
  173. moving: false,
  174. footprintList: [],
  175. searchKeyWord: '',
  176. isVip: false,
  177. userInfoTmp: [],
  178. inputStatus: 'none',
  179. carInfo: [],
  180. gridCol: 4,
  181. pageSize: 10,
  182. currentPage: 1,
  183. gridBorder: false,
  184. headUrl: "../../static/img/myimg/YongHu@3x.png",
  185. userphone: "",
  186. username: "请更改昵称",
  187. gridList: {},
  188. managementType: '',
  189. warehouseName: '',
  190. warehouseList: [],
  191. showTran: true,
  192. companyId: 1,
  193. current: 4,
  194. gradeList: [{
  195. key: 1,
  196. value: '一等品'
  197. },
  198. {
  199. key: 2,
  200. value: '二等品'
  201. },
  202. {
  203. key: 3,
  204. value: '三等品'
  205. },
  206. {
  207. key: 4,
  208. value: '等外'
  209. },
  210. ],
  211. cangid: ''
  212. }
  213. },
  214. // #ifndef MP
  215. onNavigationBarButtonTap(e) {
  216. const index = e.index;
  217. if (index === 0) {
  218. this.navTo('/pages/set/set');
  219. } else if (index === 1) {
  220. // #ifdef APP-PLUS
  221. const pages = getCurrentPages();
  222. const page = pages[pages.length - 1];
  223. const currentWebview = page.$getAppWebview();
  224. currentWebview.hideTitleNViewButtonRedDot({
  225. index
  226. });
  227. // #endif
  228. uni.navigateTo({
  229. url: '/pages/notice/notice'
  230. })
  231. }
  232. },
  233. // #endif
  234. computed: {
  235. ...mapState(['hasLogin', 'userInfo']),
  236. // 手机号中间4位加*
  237. starUserphone() {
  238. let reg = /^(\d{3})\d{4}(\d{4})$/;
  239. if (this.userphone) {
  240. return this.userphone.replace(reg, "$1****$2");
  241. }
  242. }
  243. },
  244. onLoad(options) {
  245. this.id = options.id
  246. this.cangid = options.cangid
  247. this.managementType = options.managementType
  248. },
  249. onShow() {
  250. var that = this
  251. this.$api.doRequest('get', '/qualityInspectionManagement/api/getQualityInspection', {
  252. id: this.id
  253. }).then(res => {
  254. if (res.data.data) {
  255. let data = res.data.data
  256. that.gridList = data
  257. that.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  258. id: this.cangid
  259. }).then(res => {
  260. that.warehouseList = res.data.data.warehousePositionInfoList
  261. })
  262. }
  263. })
  264. },
  265. methods: {
  266. submit() {
  267. var that = this
  268. if (!this.gridList.contractNo) {
  269. this.$api.msg('编号不能为空')
  270. return
  271. }
  272. if (!this.gridList.binNumber) {
  273. this.$api.msg('仓位不能为空')
  274. return
  275. }
  276. if (!this.gridList.storageTagNo) {
  277. this.$api.msg('囤位号不能为空')
  278. return
  279. }
  280. if (this.gridList.storageTagNo.length > 10) {
  281. this.$api.msg('囤位号不超过10个字符!')
  282. return
  283. }
  284. if (!this.gridList.carNumber) {
  285. this.$api.msg('车牌号不能为空')
  286. return
  287. }
  288. if (this.gridList.carNumber.length > 7) {
  289. this.$api.msg('车牌号输入错误')
  290. return
  291. }
  292. if (!this.gridList.goodsName) {
  293. this.$api.msg('货名不能为空')
  294. return
  295. }
  296. if (!this.gridList.grade) {
  297. this.$api.msg('等级不能为空')
  298. return
  299. }
  300. if (!this.gridList.impurity) {
  301. this.$api.msg('杂质不能为空')
  302. return
  303. }
  304. if (!this.gridList.waterContent) {
  305. this.$api.msg('水分不能为空')
  306. return
  307. }
  308. if (!this.gridList.mildewGrain) {
  309. this.$api.msg('霉变粒不能为空')
  310. return
  311. }
  312. if (!this.gridList.bulkDensity) {
  313. this.$api.msg('容重不能为空')
  314. return
  315. }
  316. if (!this.gridList.jiaorenli) {
  317. this.$api.msg('热损伤不能为空')
  318. return
  319. }
  320. if (!this.gridList.imperfectGrain) {
  321. this.$api.msg('不完整粒不能为空')
  322. return
  323. }
  324. uni.showModal({
  325. content: "确定提交质检信息?",
  326. showCancel: true,
  327. confirmText: '提交',
  328. success: function(res) {
  329. if (res.confirm) {
  330. that.$api.doRequest('post',
  331. '/qualityInspectionManagement/api/addQualityInspectionOut', that.gridList)
  332. .then(res => {
  333. if (res.data.code == 200) {
  334. that.$api.msg('提交成功')
  335. uni.navigateBack({})
  336. }
  337. })
  338. }
  339. }
  340. })
  341. },
  342. gradepicker(e) {
  343. console.log(e)
  344. // this.$set(this.gradeList,'grade',this.gradeList[e[0]].value)
  345. this.gridList.grade = this.gradeList[e[0]].value
  346. this.gridList.gradeKey = this.gradeList[e[0]].key
  347. },
  348. binNumberpicker(e) {
  349. this.gridList.binNumber = this.warehouseList[e[0]].binNumber
  350. },
  351. del(item) {
  352. this.$api.doRequest('get', '/qualityInspectionManagement/api/deleteQualityInspection', {
  353. id: item.id
  354. }).then(res => {
  355. if (res.data.code == 200) {
  356. this.$api.msg('删除成功')
  357. } else {
  358. this.$api.msg('系统异常,请联系管理员')
  359. }
  360. })
  361. },
  362. fankui() {
  363. uni.navigateTo({
  364. url: `/pages/user/fankui`
  365. })
  366. },
  367. zhibo() {
  368. uni.navigateTo({
  369. url: `/pageB/video/broadcast`
  370. })
  371. },
  372. look() {
  373. uni.navigateTo({
  374. url: `/pageB/video/look`
  375. })
  376. },
  377. contactUs() {
  378. const that = this
  379. uni.makePhoneCall({
  380. // 手机号
  381. phoneNumber: '18241771147',
  382. // 成功回调
  383. success: (res) => {},
  384. // 失败回调
  385. fail: (res) => {}
  386. });
  387. },
  388. loadData() {
  389. // const that = this
  390. // if(uni.getStorageSync("PageCur")){
  391. // that.PageCur = uni.getStorageSync("PageCur");
  392. // }
  393. // that.userInfoTmp = uni.getStorageSync("userInfo")
  394. // uni.showLoading({
  395. // title: '正在加载',
  396. // mask:true
  397. // })
  398. // that.$api.request('integral', 'getIndexData', failres => {
  399. // that.$api.msg(failres.errmsg)
  400. // uni.hideLoading()
  401. // }).then(res => {
  402. // let data = res.data
  403. // uni.setStorageSync("message", data.message);
  404. // uni.setStorageSync("task", data.task);
  405. // uni.setStorageSync("contract", data.contract);
  406. // uni.setStorageSync('showTran', data.showTran);
  407. // that.showTran = data.showTran
  408. // that.gridList[4].tips = data.task
  409. // that.gridList[2].tips = data.contract
  410. // that.companyId = data.companyId
  411. // uni.hideLoading()
  412. // })
  413. },
  414. confirm() {
  415. const that = this
  416. if (!that.inputContent) {
  417. that.$api.msg('输入不能为空')
  418. return
  419. }
  420. let obj = {}
  421. obj[that.feild] = that.inputContent
  422. that.$api.request('user', 'syncUserInfo', obj).then(res => {
  423. that.userInfo.nickname = that.inputContent
  424. that.inputContent = ''
  425. that.$store.commit('login', that.userInfo)
  426. })
  427. },
  428. cancel() {
  429. this.inputShow = false
  430. this.inputStatus = 'none'
  431. this.genderShow = false
  432. },
  433. myAccount() {
  434. uni.navigateTo({
  435. url: `/pageA/pages/contract`
  436. })
  437. },
  438. /**
  439. * 统一跳转接口,拦截未登录路由
  440. * navigator标签现在默认没有转场动画,所以用view
  441. */
  442. navTo(url) {
  443. if (!this.hasLogin) {
  444. url = '/pages/public/login';
  445. }
  446. uni.navigateTo({
  447. url
  448. })
  449. },
  450. mycarClick(carNo) {
  451. this.modalName = null
  452. uni.navigateTo({
  453. url: `/pageB/car/mycar_detail?carNo=${carNo}`
  454. })
  455. },
  456. scanCode() {
  457. uni.scanCode({
  458. success: function(res) {
  459. uni.navigateTo({
  460. url: res.result
  461. })
  462. }
  463. })
  464. },
  465. hideModal(e) {
  466. this.modalName = null
  467. },
  468. }
  469. }
  470. </script>
  471. <style lang='scss' scoped>
  472. page {
  473. background: #F5F6FA;
  474. }
  475. .title_b {
  476. margin: 20rpx 20rpx 0rpx 20rpx;
  477. padding: 20rpx 10rpx 20rpx 10rpx;
  478. font-size: 18px;
  479. font-weight: 550;
  480. }
  481. .c-row {
  482. display: -webkit-box;
  483. display: -webkit-flex;
  484. display: flex;
  485. -webkit-box-align: center;
  486. -webkit-align-items: center;
  487. align-items: center;
  488. padding: 20rpx 30rpx;
  489. position: relative;
  490. }
  491. .con-list {
  492. -webkit-box-flex: 1;
  493. -webkit-flex: 1;
  494. flex: 1;
  495. display: -webkit-box;
  496. display: -webkit-flex;
  497. display: flex;
  498. -webkit-box-orient: vertical;
  499. -webkit-box-direction: normal;
  500. -webkit-flex-direction: column;
  501. flex-direction: column;
  502. color: #303133;
  503. line-height: 40rpx;
  504. text-align: right;
  505. padding-right: 20rpx;
  506. }
  507. .wrap {
  508. padding-bottom: 10px;
  509. font-size: 14px;
  510. background: #fff;
  511. margin: 10px;
  512. border-radius: 10px;
  513. input {
  514. font-size: 14px;
  515. }
  516. >.title {
  517. padding: 10px 16px;
  518. }
  519. }
  520. .footer {
  521. background: #fff;
  522. position: fixed;
  523. bottom: 0;
  524. width: 100%;
  525. padding: 20px 10px;
  526. z-index: 10;
  527. .button {
  528. background: #22C572;
  529. width: 90%;
  530. margin: 0 auto;
  531. padding: 10px;
  532. color: #fff;
  533. text-align: center;
  534. border-radius: 30px;
  535. }
  536. }
  537. </style>