add_quality_testing.vue 21 KB

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