examine_quality_testing.vue 11 KB

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