out_quality_testing.vue 12 KB

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