edit_quality_testing.vue 23 KB

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