edit_quality_testing.vue 23 KB

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