edit_quality_testing.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  1. <template>
  2. <view ref="all-input">
  3. <view @click='hidden' 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.qualityNo}}
  15. </view>
  16. </view>
  17. <view class="c-row ">
  18. <view class="title">客户</view>
  19. <view class="con-list">
  20. {{gridList.customerName}}({{gridList.customerPhone}})
  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' @click.stop="handleShowKeyboard":disabled="true" placeholder="请输入车牌号" name="input"></input>
  27. <master-keyboard ref="keyboard" keyboardtype="car" :randomNumber="true" :newCar="false" :defaultValue="gridList.carNumber" @keyboardClick="handleClick"></master-keyboard>
  28. <!-- <input :disabled='flag==1' v-model='gridList.carNumber' placeholder="请输入车牌号" name="input"></input> -->
  29. </view>
  30. </view>
  31. <view v-if="gridList.paramType != '1'" class="c-row ">
  32. <view class="title">扣重比</view>
  33. <view class="con-list">
  34. <input :disabled='flag==1' v-model='gridList.buckleWeightRatio' placeholder="请输入扣重比"
  35. name="input"></input>
  36. </view>
  37. </view>
  38. <view v-else class="c-row ">
  39. <view class="title">扣杂</view>
  40. <view class="con-list">
  41. <input :disabled='flag==1' v-model='gridList.buckleMiscellaneous' placeholder="初检扣杂"
  42. @input="waterContentChange" name="input"></input>
  43. <input v-if='flag==0' value='未复检' disabled placeholder="复检扣杂" name="input"></input>
  44. <input v-else :disabled='flag!=1' v-model='gridList.reBuckleMiscellaneous' placeholder="复检扣杂"
  45. name="input"></input>
  46. </view>
  47. </view>
  48. <view class="c-row ">
  49. <view class="title">购粮性质</view>
  50. <view class="con-list">
  51. <input :disabled='flag==1' v-model='gridList.natureOfGrainPurchase' placeholder="请输入购粮性质"
  52. name="input"></input>
  53. </view>
  54. </view>
  55. <view class="c-row ">
  56. <view class="title">仓位号</view>
  57. <view class="con-list">
  58. <u-picker :range="warehouseList" range-key="binNumber" @confirm='binNumberpicker($event)'
  59. v-model="show" mode="selector">
  60. </u-picker>
  61. <view v-if='flag!=1' @click='show=true'>{{gridList.binNumber}}</view>
  62. <view v-else>{{gridList.binNumber}}</view>
  63. </view>
  64. </view>
  65. <view class="c-row ">
  66. <view class="title">囤位号</view>
  67. <view class="con-list">
  68. <input v-model='gridList.storageTagNo' placeholder="请输入囤位号"
  69. name="input"></input>
  70. </view>
  71. </view>
  72. <view class="c-row ">
  73. <view class="title">货名</view>
  74. <view class="con-list">
  75. <view v-if="flag == '1'||flag == '0'">
  76. {{gridList.goodsName}}
  77. </view>
  78. <view @click='goodsName = true' v-if="flag == '2'">{{gridList.goodsName}}</view>
  79. <u-picker :range="goodsList" range-key="goodsName" @confirm='goodsPicker($event)' v-model="goodsName" mode="selector" v-if="flag == '2'">
  80. </u-picker>
  81. </view>
  82. </view>
  83. <view class="c-row ">
  84. <view class="title">类型</view>
  85. <view class="con-list">
  86. {{gridList.type}}
  87. </view>
  88. </view>
  89. <view v-if="gridList.type == '潮粮'" class="c-row">
  90. <view class="title">净重单价(元/公斤)</view>
  91. <view class="con-list">
  92. <input :disabled='flag==1' v-model='gridList.tidalGrainPrice' disabled placeholder="自动获取,不可编辑"
  93. name="input"></input>
  94. </view>
  95. </view>
  96. <view v-if="gridList.type == '干粮'" class="c-row">
  97. <view class="title">干粮单价(元/公斤)</view>
  98. <view class="con-list">
  99. <input v-model='gridList.dryGrainPrice' placeholder="请输入干粮单价" name="input"></input>
  100. </view>
  101. </view>
  102. <view class="c-row-fj" v-if="flag==2">
  103. <view style="margin: 0px 0px 30rpx 10rpx;">复检备注</view>
  104. <textarea class='textarea-style' v-model='gridList.reMemo' placeholder="请输入复检备注" maxlength="300"></textarea>
  105. </view>
  106. </view>
  107. <view style='padding-bottom:300rpx;'>
  108. <view class='wrap'>
  109. <view style='margin-right:10px;' class='flex justify-between align-item-center'>
  110. <view class='title_b'>化验信息</view>
  111. <u-switch v-if='flag!=1' v-model="value" @change="change"></u-switch>
  112. </view>
  113. <view class="c-row ">
  114. <view class="title">等级</view>
  115. <view class="con-list">
  116. <u-picker :range="gradeList" range-key="value" @confirm='gradepicker($event)' v-model="show1"
  117. mode="selector">
  118. </u-picker>
  119. <view v-if='flag!=1' @click='show1=true'>{{gridList.grade?gridList.grade:'请选择等级'}}</view>
  120. <view v-else>{{gridList.grade}}</view>
  121. </view>
  122. </view>
  123. <view class="c-row ">
  124. <view class="title">水分(%)</view>
  125. <view class="con-list">
  126. <input :disabled='flag==1' v-model='gridList.waterContent' placeholder="初检水分"
  127. @input="waterContentChange" name="input"></input>
  128. <input v-if='flag==0' value='未复检' disabled placeholder="复检水分" name="input"></input>
  129. <input :disabled='flag!=1' v-else v-model='gridList.reWaterContent' placeholder="复检水分"
  130. name="input"></input>
  131. </view>
  132. </view>
  133. <view class="c-row ">
  134. <view class="title">容重(克/升)</view>
  135. <view class="con-list">
  136. <input :disabled='flag==1' v-model='gridList.bulkDensity' placeholder="请输入容重"
  137. name="input"></input>
  138. </view>
  139. </view>
  140. <view class="c-row ">
  141. <view class="title">不完善粒(%)</view>
  142. <view class="con-list">
  143. <input :disabled='flag==1' v-model='gridList.imperfectGrain' placeholder="请输入不完整粒占比"
  144. name="input"></input>
  145. </view>
  146. </view>
  147. <view class="c-row ">
  148. <view class="title">杂质(%)</view>
  149. <view class="con-list">
  150. <input :disabled='flag==1' v-model='gridList.impurity' placeholder="请输入杂质占比"
  151. name="input"></input>
  152. </view>
  153. </view>
  154. <view class="c-row ">
  155. <view class="title">霉变粒(%)</view>
  156. <view class="con-list">
  157. <input :disabled='flag==1' v-model='gridList.mildewGrain' placeholder="请输入霉变粒占比"
  158. name="input"></input>
  159. </view>
  160. </view>
  161. <view class="c-row ">
  162. <view class="title">热损伤(%)</view>
  163. <view class="con-list">
  164. <!-- <input :disabled='flag==1' v-model='gridList.jiaorenli' placeholder="请输入热损伤占比"
  165. name="input"></input> -->
  166. <input v-model='gridList.jiaorenli' @click.stop="handleShowKeyboard1":disabled="true" placeholder="请输入热损伤占比" name="input"></input>
  167. <master-keyboard :fatherMethod="focusConfig" ref="keyboard1" keyboardtype="digit" :randomNumber="true" :newCar="false" :defaultValue="gridList.jiaorenli" @keyboardClick="handleClick1"></master-keyboard>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. <view class="footer">
  173. <view v-if='!value&&flag==1' @click='confirmInfo' class="button">确认初检信息</view>
  174. <view @click='submit' class="button">提交</view>
  175. </view>
  176. <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
  177. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
  178. showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
  179. </view>
  180. </template>
  181. <script>
  182. import dragButton from "@/components/drag-button/drag-button.vue";
  183. import keyboard from "@/components/master-keyboard/master-keyboard.vue";
  184. import {
  185. mapState
  186. } from 'vuex';
  187. let startY = 0,
  188. moveY = 0,
  189. pageAtTop = true;
  190. export default {
  191. components: {
  192. dragButton,
  193. keyboard
  194. },
  195. data() {
  196. return {
  197. inputShow: false,
  198. modalName: '',
  199. mycarStyle: '',
  200. feild: undefined,
  201. id: 0,
  202. show: false,
  203. selector: [],
  204. show1: false,
  205. goodsName:false,
  206. inputContent: '',
  207. coverTransform: 'translateY(0px)',
  208. coverTransition: '0s',
  209. moving: false,
  210. footprintList: [],
  211. searchKeyWord: '',
  212. isVip: false,
  213. flag: 0,
  214. userInfoTmp: [],
  215. inputStatus: 'none',
  216. carInfo: [],
  217. gridCol: 4,
  218. pageSize: 10,
  219. currentPage: 1,
  220. gridBorder: false,
  221. headUrl: "../../static/img/myimg/YongHu@3x.png",
  222. userphone: "",
  223. username: "请更改昵称",
  224. gridList: {
  225. natureOfGrainPurchase: '贸易粮',
  226. type: '潮粮',
  227. tidalGrainPrice: '',
  228. dryGrainPrice: '',
  229. carNumber:''
  230. },
  231. managementType: '',
  232. warehouseName: '',
  233. warehouseList: [],
  234. showTran: true,
  235. companyId: 1,
  236. current: 4,
  237. value:false,
  238. gradeList: [{
  239. key: 1,
  240. value: '一等品'
  241. },
  242. {
  243. key: 2,
  244. value: '二等品'
  245. },
  246. {
  247. key: 3,
  248. value: '三等品'
  249. },
  250. {
  251. key: 4,
  252. value: '等外'
  253. },
  254. ],
  255. cangid: '',
  256. goodsList:[],
  257. isShowAlert:false,
  258. content: '确认初检信息后,初检员不需要再次确认质检信息,是否确定提交?',
  259. }
  260. },
  261. // #ifndef MP
  262. onNavigationBarButtonTap(e) {
  263. const index = e.index;
  264. if (index === 0) {
  265. this.navTo('/pages/set/set');
  266. } else if (index === 1) {
  267. // #ifdef APP-PLUS
  268. const pages = getCurrentPages();
  269. const page = pages[pages.length - 1];
  270. const currentWebview = page.$getAppWebview();
  271. currentWebview.hideTitleNViewButtonRedDot({
  272. index
  273. });
  274. // #endif
  275. uni.navigateTo({
  276. url: '/pages/notice/notice'
  277. })
  278. }
  279. },
  280. // #endif
  281. computed: {
  282. ...mapState(['hasLogin', 'userInfo']),
  283. // 手机号中间4位加*
  284. starUserphone() {
  285. let reg = /^(\d{3})\d{4}(\d{4})$/;
  286. if (this.userphone) {
  287. return this.userphone.replace(reg, "$1****$2");
  288. }
  289. }
  290. },
  291. onLoad(options) {
  292. this.id = options.id
  293. this.flag = options.flag
  294. this.cangid = options.cangid
  295. this.managementType = options.managementType
  296. },
  297. onShow() {
  298. console.log(this.flag)
  299. var that = this
  300. this.$api.doRequest('get', '/qualityInspectionManagement/api/getQualityInspection', {
  301. id: this.id
  302. }).then(res => {
  303. if (res.data.data) {
  304. let data = res.data.data
  305. if(data.supplementaryRecording==1){
  306. that.value=true
  307. }else{
  308. that.value=false
  309. }
  310. that.gridList = data
  311. that.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  312. id: this.cangid
  313. }).then(res => {
  314. that.warehouseList = res.data.data.warehousePositionInfoList
  315. })
  316. }
  317. })
  318. //质检货名下拉
  319. this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
  320. warehouseId: this.cangid
  321. }).then(res => {
  322. if (res.data.data) {
  323. this.goodsList = res.data.data
  324. }
  325. })
  326. this.gridList.grade = this.gradeList[0].value
  327. this.gridList.gradeKey = this.gradeList[0].key
  328. },
  329. methods: {
  330. focusConfig(type){
  331. console.log('childclick',type)
  332. // 0是上一项
  333. if(type==0){
  334. }else{}
  335. },
  336. hidden(){
  337. this.$refs.keyboard.open(false)
  338. },
  339. handleShowKeyboard(){
  340. if(this.flag==0){
  341. if(this.$refs.keyboard.open){
  342. this.$refs.keyboard.open(true)//true 键盘显示 false 键盘隐藏
  343. }else{
  344. this.$refs.keyboard[0].open(true)
  345. }
  346. }
  347. },
  348. handleShowKeyboard1(){
  349. if(this.flag==0){
  350. if(this.$refs.keyboard1.open){
  351. this.$refs.keyboard1.open(true)//true 键盘显示 false 键盘隐藏
  352. }else{
  353. this.$refs.keyboard1[0].open(true)
  354. }
  355. }
  356. },
  357. handleClick(e){
  358. this.gridList.carNumber = e.value //键盘输入值
  359. },
  360. handleClick1(e){
  361. this.gridList.jiaorenli = e.value //键盘输入值
  362. },
  363. change(e){
  364. if(e){
  365. this.gridList.supplementaryRecording=1
  366. }else{
  367. this.gridList.supplementaryRecording=0
  368. }
  369. },
  370. confirmInfo() {
  371. this.isShowAlert = true
  372. },
  373. alertBtn() {
  374. var that = this
  375. this.$api.doRequest('post', '/qualityInspectionManagement/api/editQualityInspection', {
  376. id: this.id,
  377. flag:2
  378. }).then(res => {
  379. if(res.data.code=="200"){
  380. that.gridList.flag=1
  381. that.$api.doRequest('post', '/qualityInspectionManagement/api/editQualityInspection', that.gridList).then(res => {
  382. if(res.data.code=="200"){
  383. that.$api.msg('提交成功!')
  384. setTimeout(function(){
  385. uni.navigateBack({})
  386. },1000)
  387. }else{
  388. that.$api.msg('提交失败')
  389. }
  390. })
  391. }else{
  392. that.$api.msg('提交失败')
  393. }
  394. })
  395. },
  396. waterContentChange() {
  397. var that = this
  398. if (this.gridList.goodsName && this.cangid) {
  399. if (!this.gridList.dryGrainPrice || this.gridList.dryGrainPrice == 0) {
  400. this.$api.doRequest('get', '/purchasePrice/dryGrainPrice', {
  401. warehouseId: this.cangid,
  402. goodsName: this.gridList.goodsName
  403. }).then(res => {
  404. that.gridList.dryGrainPrice = res.data.data
  405. })
  406. }
  407. }
  408. if (this.gridList.goodsName) {
  409. for (var i = 0; i < this.purchasePriceList.length; i++) {
  410. if (this.purchasePriceList[i].goodsName == this.gridList.goodsName) {
  411. this.gridList.buckleWeightRatio = this.purchasePriceList[i].deductWeight
  412. this.gridList.paramType = this.purchasePriceList[i].paramType
  413. }
  414. }
  415. }
  416. var numReg = /^[0-9]*$/
  417. var numRe = new RegExp(numReg)
  418. //潮粮单价改变事件
  419. if (
  420. this.gridList.goodsName &&
  421. this.gridList.waterContent &&
  422. this.gridList.grade &&
  423. numRe.test(this.gridList.waterContent)
  424. ) {
  425. this.$api.doRequest('get', '/purchasePrice/tidalGrainPrice', {
  426. warehouseId: this.cangid,
  427. goodsName: this.gridList.goodsName,
  428. waterContent: this.gridList.waterContent,
  429. grade: this.gridList.grade,
  430. }).then(res => {
  431. if (that.gridList.paramType == '1') {
  432. that.gridList.tidalGrainPrice = parseFloat(parseFloat(res.data.data) - parseFloat(that
  433. .gridList.buckleMiscellaneous) / 100 * parseFloat(that.gridList
  434. .dryGrainPrice)).toFixed(4)
  435. if (!that.gridList.tidalGrainPrice) {
  436. that.gridList.tidalGrainPrice = ''
  437. }
  438. } else {
  439. that.gridList.tidalGrainPrice = res.data.data
  440. }
  441. })
  442. }
  443. },
  444. goodsPicker(e){
  445. this.gridList.goodsName = this.goodsList[e[0]].goodsName
  446. },
  447. submit() {
  448. this.gridList.flag = this.flag
  449. // if(this.flag==2){
  450. // this.gridList.reInspector=this.userInfo.userName
  451. // }
  452. var that = this
  453. if (!this.gridList.qualityNo) {
  454. this.$api.msg('编号不能为空')
  455. return
  456. }
  457. if (!this.gridList.binNumber) {
  458. this.$api.msg('仓位不能为空')
  459. return
  460. }
  461. if (!this.gridList.customerName) {
  462. this.$api.msg('客户不能为空')
  463. return
  464. }
  465. if (!this.gridList.storageTagNo) {
  466. this.$api.msg('囤位号不能为空')
  467. return
  468. }
  469. if (this.gridList.storageTagNo.length > 10) {
  470. this.$api.msg('囤位号不能为空')
  471. return
  472. }
  473. if (!this.gridList.carNumber) {
  474. this.$api.msg('车牌号不能为空')
  475. return
  476. }
  477. if (this.gridList.carNumber.length > 7) {
  478. this.$api.msg('车牌号输入错误')
  479. return
  480. }
  481. if (!this.gridList.goodsName) {
  482. this.$api.msg('货名不能为空')
  483. return
  484. }
  485. if (this.gridList.paramType != 1 && this.gridList.buckleWeightRatio < 0 || this.gridList.paramType != 1 &&
  486. this.gridList.buckleWeightRatio > 2) {
  487. this.$api.msg('扣重比输入错误')
  488. return
  489. }
  490. if (
  491. this.gridList.paramType != 1 && String(this.gridList.buckleWeightRatio).indexOf('.') != -1 &&
  492. String(this.gridList.buckleWeightRatio).length -
  493. (String(this.gridList.buckleWeightRatio).indexOf('.') + 1) > 2) {
  494. this.$api.msg('扣重比输入错误')
  495. return
  496. }
  497. if (this.flag == 0 && this.gridList.paramType == 1 && this.gridList.buckleMiscellaneous < 0 || this.flag ==
  498. 0 && this.gridList.paramType == 1 && this.gridList.buckleMiscellaneous > 50) {
  499. this.$api.msg('初检扣杂输入错误')
  500. return
  501. }
  502. if (this.flag == 1 && this.gridList.paramType == 1 && this.gridList.reBuckleMiscellaneous < 0 || this
  503. .flag == 0 && this.gridList.paramType == 1 && this.gridList.reBuckleMiscellaneous > 50) {
  504. this.$api.msg('复检扣杂输入错误')
  505. return
  506. }
  507. if (!this.gridList.type) {
  508. this.$api.msg('类型不能为空')
  509. return
  510. }
  511. if (!this.gridList.natureOfGrainPurchase) {
  512. this.$api.msg('购粮性质不能为空')
  513. return
  514. }
  515. if(this.value==false){
  516. if (!this.gridList.grade) {
  517. this.$api.msg('等级不能为空')
  518. return
  519. }
  520. if (!this.gridList.impurity) {
  521. this.$api.msg('杂质不能为空')
  522. return
  523. }
  524. if (!this.gridList.waterContent) {
  525. this.$api.msg('初检水分不能为空')
  526. return
  527. }
  528. // if (!this.gridList.reWaterContent) {
  529. // this.$api.msg('复检水分不能为空')
  530. // return
  531. // }
  532. if (!this.gridList.mildewGrain) {
  533. this.$api.msg('霉变粒不能为空')
  534. return
  535. }
  536. if (!this.gridList.bulkDensity) {
  537. this.$api.msg('容重不能为空')
  538. return
  539. }
  540. if (!this.gridList.jiaorenli) {
  541. this.$api.msg('热损伤不能为空')
  542. return
  543. }
  544. if (!this.gridList.imperfectGrain) {
  545. this.$api.msg('不完整粒不能为空')
  546. return
  547. }
  548. }
  549. uni.showModal({
  550. content: "确定提交质检信息?",
  551. showCancel: true,
  552. confirmText: '提交',
  553. success: function(res) {
  554. if (res.confirm) {
  555. that.$api.doRequest('post',
  556. '/qualityInspectionManagement/api/editQualityInspection', that.gridList)
  557. .then(res => {
  558. if (res.data.code == 200) {
  559. that.$api.msg('编辑质检成功')
  560. uni.navigateBack({})
  561. }
  562. })
  563. }
  564. }
  565. })
  566. },
  567. gradepicker(e) {
  568. console.log(e)
  569. // this.$set(this.gradeList,'grade',this.gradeList[e[0]].value)
  570. this.gridList.grade = this.gradeList[e[0]].value
  571. this.gridList.gradeKey = this.gradeList[e[0]].key
  572. this.waterContentChange()
  573. },
  574. binNumberpicker(e) {
  575. this.gridList.binNumber = this.warehouseList[e[0]].binNumber
  576. },
  577. del(item) {
  578. this.$api.doRequest('get', '/qualityInspectionManagement/api/deleteQualityInspection', {
  579. id: item.id
  580. }).then(res => {
  581. if (res.data.code == 200) {
  582. this.$api.msg('删除成功')
  583. } else {
  584. this.$api.msg('系统异常,请联系管理员')
  585. }
  586. })
  587. },
  588. contactUs() {
  589. const that = this
  590. uni.makePhoneCall({
  591. // 手机号
  592. phoneNumber: '18241771147',
  593. // 成功回调
  594. success: (res) => {},
  595. // 失败回调
  596. fail: (res) => {}
  597. });
  598. },
  599. loadData() {
  600. // const that = this
  601. // if(uni.getStorageSync("PageCur")){
  602. // that.PageCur = uni.getStorageSync("PageCur");
  603. // }
  604. // that.userInfoTmp = uni.getStorageSync("userInfo")
  605. // uni.showLoading({
  606. // title: '正在加载',
  607. // mask:true
  608. // })
  609. // that.$api.request('integral', 'getIndexData', failres => {
  610. // that.$api.msg(failres.errmsg)
  611. // uni.hideLoading()
  612. // }).then(res => {
  613. // let data = res.data
  614. // uni.setStorageSync("message", data.message);
  615. // uni.setStorageSync("task", data.task);
  616. // uni.setStorageSync("contract", data.contract);
  617. // uni.setStorageSync('showTran', data.showTran);
  618. // that.showTran = data.showTran
  619. // that.gridList[4].tips = data.task
  620. // that.gridList[2].tips = data.contract
  621. // that.companyId = data.companyId
  622. // uni.hideLoading()
  623. // })
  624. },
  625. confirm() {
  626. const that = this
  627. if (!that.inputContent) {
  628. that.$api.msg('输入不能为空')
  629. return
  630. }
  631. let obj = {}
  632. obj[that.feild] = that.inputContent
  633. that.$api.request('user', 'syncUserInfo', obj).then(res => {
  634. that.userInfo.nickname = that.inputContent
  635. that.inputContent = ''
  636. that.$store.commit('login', that.userInfo)
  637. })
  638. },
  639. cancel() {
  640. this.inputShow = false
  641. this.inputStatus = 'none'
  642. this.genderShow = false
  643. },
  644. myAccount() {
  645. uni.navigateTo({
  646. url: `/pageA/pages/contract`
  647. })
  648. },
  649. /**
  650. * 统一跳转接口,拦截未登录路由
  651. * navigator标签现在默认没有转场动画,所以用view
  652. */
  653. navTo(url) {
  654. if (!this.hasLogin) {
  655. url = '/pages/public/login';
  656. }
  657. uni.navigateTo({
  658. url
  659. })
  660. },
  661. mycarClick(carNo) {
  662. this.modalName = null
  663. uni.navigateTo({
  664. url: `/pageB/car/mycar_detail?carNo=${carNo}`
  665. })
  666. },
  667. scanCode() {
  668. uni.scanCode({
  669. success: function(res) {
  670. uni.navigateTo({
  671. url: res.result
  672. })
  673. }
  674. })
  675. },
  676. hideModal(e) {
  677. this.modalName = null
  678. },
  679. }
  680. }
  681. </script>
  682. <style lang='scss' scoped>
  683. .title_b {
  684. margin: 20rpx 20rpx 0rpx 20rpx;
  685. padding: 20rpx 10rpx 20rpx 10rpx;
  686. font-size: 18px;
  687. font-weight: 550;
  688. }
  689. page {
  690. background: #F5F6FA;
  691. }
  692. .wrap {
  693. padding-bottom: 10px;
  694. font-size: 14px;
  695. background: #fff;
  696. margin: 10px;
  697. border-radius: 10px;
  698. input {
  699. font-size: 14px;
  700. }
  701. >.title {
  702. padding: 10px 16px;
  703. }
  704. .b-b:after {
  705. border-bottom: 1px solid #eee;
  706. }
  707. }
  708. .footer {
  709. background: #fff;
  710. position: fixed;
  711. bottom: 0;
  712. width: 100%;
  713. padding: 20px 10px;
  714. z-index: 10;
  715. .button {
  716. background: #22C572;
  717. width: 90%;
  718. margin: 20rpx auto;
  719. padding: 10px;
  720. color: #fff;
  721. text-align: center;
  722. border-radius: 30px;
  723. }
  724. }
  725. .c-row {
  726. display: -webkit-box;
  727. display: -webkit-flex;
  728. display: flex;
  729. -webkit-box-align: center;
  730. -webkit-align-items: center;
  731. align-items: center;
  732. padding: 20rpx 30rpx;
  733. position: relative;
  734. }
  735. .con-list {
  736. -webkit-box-flex: 1;
  737. -webkit-flex: 1;
  738. flex: 1;
  739. display: -webkit-box;
  740. display: -webkit-flex;
  741. display: flex;
  742. -webkit-box-orient: vertical;
  743. -webkit-box-direction: normal;
  744. -webkit-flex-direction: column;
  745. flex-direction: column;
  746. color: #303133;
  747. line-height: 40rpx;
  748. text-align: right;
  749. padding-right: 20rpx;
  750. }
  751. input:disabled {
  752. color: #ccc;
  753. }
  754. .textarea-style{
  755. border: 1px solid #EEEEEE;
  756. width: 100%;
  757. padding:20rpx;
  758. border-radius: 20rpx;
  759. }
  760. .c-row-fj{
  761. padding:20rpx
  762. }
  763. </style>