out_quality_testing.vue 12 KB

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