examine_quality_testing.vue 11 KB

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