add_quality_testing.vue 23 KB

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