examine_quality_testing.vue 11 KB

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