add_quality_testing.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  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. this.gridList.carNumber=uni.getStorageSync('carNo')
  303. } else {
  304. //点击搜索客户
  305. this.gridList.customerName = _customerInfo.customerName
  306. this.gridList.customerPhone = _customerInfo.customerPhone
  307. }
  308. this.gridList.customerNumberCard = _customerInfo.customerNumberCard
  309. }
  310. this.gridList.grade = this.gradeList[0].value
  311. this.gridList.gradeKey = this.gradeList[0].key
  312. this.$api.doRequest('get', '/identityAuthenticationInfo/identityAuthenticationInfoCustomer', {
  313. compId: '',
  314. authenticationStatusKey: 7
  315. }).then(res => {
  316. if (res.data.data) {
  317. // let data = res.data.data
  318. // that.gridList =data
  319. that.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  320. id: this.cangid
  321. }).then(res => {
  322. that.warehouseList = res.data.data.warehousePositionInfoList
  323. })
  324. }
  325. })
  326. this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
  327. warehouseId: this.cangid
  328. }).then(res => {
  329. if (res.data.data) {
  330. that.goodsList = res.data.data
  331. if (that.goodsList.length > 0) {
  332. that.gridList.goodsName = that.goodsList[0].goodsName
  333. if (that.goodsList[0].goodsName == '玉米') {
  334. that.gridList.type = '干粮'
  335. that.edit = true
  336. } else if (that.goodsList[0].goodsName == '玉米(潮粮)') {
  337. that.gridList.type = '潮粮'
  338. that.edit = true
  339. } else {
  340. that.edit = false
  341. }
  342. uni.setStorageSync('purchasePriceList', that.goodsList)
  343. that.purchasePriceList = uni.getStorageSync('purchasePriceList')
  344. that.waterContentChange()
  345. }
  346. // for (let i = 0; i < res.data.data.length; i++) {
  347. // this.goodsList.push(res.data.data[i].goodsName)
  348. // }
  349. // if(this.goodsList.some(item=>{return item.goodsName=='玉米'})){
  350. // this.gridList.goodsName='玉米'
  351. // uni.setStorageSync('goodsName',this.gridList.goodsName)
  352. // }else{
  353. // this.gridList.goodsName=this.goodsList[0].goodsName
  354. // uni.setStorageSync('goodsName',this.gridList.goodsName)
  355. // }
  356. }
  357. })
  358. },
  359. methods: {
  360. // confirmInfo() {
  361. // this.isShowAlert = true
  362. // },
  363. // alertBtn() {
  364. // this.$api.doRequest('get', '/qualityInspectionManagement/api/editQualityInspection', {
  365. // id: this.id,
  366. // flag:2
  367. // }).then(res => {
  368. // if(res.data.code=="200"){
  369. // this.$api.msg('提交成功!')
  370. // }else{
  371. // this.$api.msg('提交失败')
  372. // }
  373. // })
  374. // },
  375. cancelClick() {
  376. this.isShowAlert = false
  377. },
  378. waterContentChange() {
  379. var that = this
  380. if (this.gridList.goodsName && this.cangid) {
  381. if (!this.gridList.dryGrainPrice || this.gridList.dryGrainPrice == 0) {
  382. this.$api.doRequest('get', '/purchasePrice/dryGrainPrice', {
  383. warehouseId: this.cangid,
  384. goodsName: this.gridList.goodsName
  385. }).then(res => {
  386. that.gridList.dryGrainPrice = res.data.data
  387. })
  388. }
  389. }
  390. if (this.gridList.goodsName) {
  391. for (var i = 0; i < this.purchasePriceList.length; i++) {
  392. if (this.purchasePriceList[i].goodsName == this.gridList.goodsName) {
  393. this.gridList.buckleWeightRatio = this.purchasePriceList[i].deductWeight
  394. this.gridList.paramType = this.purchasePriceList[i].paramType
  395. }
  396. }
  397. }
  398. var numReg = /^[0-9]*$/
  399. var numRe = new RegExp(numReg)
  400. //潮粮单价改变事件
  401. if (
  402. this.gridList.goodsName &&
  403. this.gridList.waterContent &&
  404. this.gridList.grade &&
  405. numRe.test(this.gridList.waterContent)
  406. ) {
  407. this.$api.doRequest('get', '/purchasePrice/tidalGrainPrice', {
  408. warehouseId: this.cangid,
  409. goodsName: this.gridList.goodsName,
  410. waterContent: this.gridList.waterContent,
  411. grade: this.gridList.grade,
  412. }).then(res => {
  413. if (that.gridList.paramType == '1') {
  414. that.gridList.tidalGrainPrice = parseFloat(parseFloat(res.data.data) - parseFloat(that
  415. .gridList.buckleMiscellaneous) / 100 * parseFloat(that.gridList
  416. .dryGrainPrice)).toFixed(4)
  417. if (!that.gridList.tidalGrainPrice) {
  418. that.gridList.tidalGrainPrice = ''
  419. }
  420. } else {
  421. that.gridList.tidalGrainPrice = res.data.data
  422. }
  423. })
  424. }
  425. },
  426. gocustomer() {
  427. uni.navigateTo({
  428. url: '/pages/erpbusiness/customer?cangid=' + this.cangid + '&warehouseName=' + this.gridList
  429. .warehouseName
  430. })
  431. },
  432. getdate() {
  433. var date = new Date()
  434. var year = date.getFullYear() //获取完整的年份(4位)
  435. var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  436. var datetime = date.getDate() //获取当前日(1-31)
  437. if (mouth < 10) {
  438. mouth = '0' + mouth
  439. }
  440. if (datetime < 10) {
  441. datetime = '0' + datetime
  442. }
  443. return year + '' + mouth + '' + datetime
  444. },
  445. submit() {
  446. var that = this
  447. if (!this.gridList.qualityNo) {
  448. this.$api.msg('编号不能为空')
  449. return
  450. }
  451. if (!this.gridList.binNumber) {
  452. this.$api.msg('仓位不能为空')
  453. return
  454. }
  455. if (!this.gridList.customerName) {
  456. this.$api.msg('客户不能为空')
  457. return
  458. }
  459. if (!this.gridList.storageTagNo) {
  460. this.$api.msg('囤位号不能为空')
  461. return
  462. }
  463. if (this.gridList.storageTagNo.length > 10) {
  464. this.$api.msg('囤位号不能为空')
  465. return
  466. }
  467. if (!this.gridList.carNumber) {
  468. this.$api.msg('车牌号不能为空')
  469. return
  470. }
  471. if (this.gridList.carNumber.length != 7) {
  472. this.$api.msg('车牌号输入错误')
  473. return
  474. }
  475. if (!this.gridList.goodsName) {
  476. this.$api.msg('货名不能为空')
  477. return
  478. }
  479. if (this.gridList.buckleWeightRatio < 0 || this.gridList.buckleWeightRatio > 2) {
  480. this.$api.msg('扣重比输入错误')
  481. return
  482. }
  483. if (
  484. String(this.gridList.buckleWeightRatio).indexOf('.') != -1 &&
  485. String(this.gridList.buckleWeightRatio).length -
  486. (String(this.gridList.buckleWeightRatio).indexOf('.') + 1) > 2) {
  487. this.$api.msg('扣重比输入错误')
  488. return
  489. }
  490. if (!this.gridList.type) {
  491. this.$api.msg('类型不能为空')
  492. return
  493. }
  494. if (!this.gridList.natureOfGrainPurchase) {
  495. this.$api.msg('购粮性质不能为空')
  496. return
  497. }
  498. if (!this.gridList.grade) {
  499. this.$api.msg('等级不能为空')
  500. return
  501. }
  502. if (!this.gridList.impurity) {
  503. this.$api.msg('杂质不能为空')
  504. return
  505. }
  506. if (!this.gridList.waterContent) {
  507. this.$api.msg('水分不能为空')
  508. return
  509. }
  510. if (!this.gridList.mildewGrain) {
  511. this.$api.msg('霉变粒不能为空')
  512. return
  513. }
  514. if (!this.gridList.bulkDensity) {
  515. this.$api.msg('容重不能为空')
  516. return
  517. }
  518. if (!this.gridList.jiaorenli) {
  519. this.$api.msg('热损伤不能为空')
  520. return
  521. }
  522. if (!this.gridList.imperfectGrain) {
  523. this.$api.msg('不完整粒不能为空')
  524. return
  525. }
  526. uni.showModal({
  527. content: "确定提交质检信息?",
  528. showCancel: true,
  529. confirmText: '提交',
  530. success: function(res) {
  531. if (res.confirm) {
  532. that.$api.doRequest('get', '/paymentManagement/cumulant', {
  533. compId: uni.getStorageSync('pcUserInfo').compId,
  534. customerNumberCard: that.gridList.customerNumberCard,
  535. goodsName: that.gridList.goodsName,
  536. })
  537. .then(response => {
  538. if (response.data.code == 200) {
  539. for (let i = 0; i < that.purchasePriceList.length; i++) {
  540. if (
  541. that.gridList.goodsName == that.purchasePriceList[i]
  542. .goodsName
  543. ) {
  544. debugger
  545. let count = (that.purchasePriceList[i].saleLimit -
  546. response.data.data / 1000).toFixed(2)
  547. console.log(count,that.purchasePriceList[i].saleLimit,
  548. response.data.data)
  549. if (Number(count) <= 0) {
  550. count = 0
  551. that.$api.msg('该客户累计销售' + that.gridList.goodsName + (
  552. response.data.data / 1000).toFixed(2) +
  553. '吨,还可售粮' +
  554. count + '吨', )
  555. } else {
  556. that.$api.doRequest('post',
  557. '/qualityInspectionManagement/api/addQualityInspection',
  558. that.gridList)
  559. .then(res => {
  560. if (res.data.code == 200) {
  561. that.$api.msg('提交成功')
  562. uni.navigateBack({})
  563. } else {
  564. hat.$api.msg('提交失败')
  565. }
  566. })
  567. }
  568. }
  569. }
  570. }
  571. })
  572. }
  573. }
  574. })
  575. },
  576. gradepicker(e) {
  577. console.log(e)
  578. // this.$set(this.gradeList,'grade',this.gradeList[e[0]].value)
  579. this.gridList.grade = this.gradeList[e[0]].value
  580. this.gridList.gradeKey = this.gradeList[e[0]].key
  581. this.waterContentChange()
  582. },
  583. setGoodName(e) {
  584. // [e[0]] = 0
  585. // this.$set(this.gradeList,'grade',this.gradeList[e[0]].value)
  586. if (this.goodsList[e[0]].goodsName == '玉米') {
  587. this.gridList.type = '干粮'
  588. this.edit = true
  589. } else if (this.goodsList[e[0]].goodsName == '玉米(潮粮)') {
  590. this.gridList.type = '潮粮'
  591. this.edit = true
  592. } else {
  593. this.gridList.type = '干粮'
  594. this.edit = false
  595. }
  596. this.gridList.goodsName = this.goodsList[e[0]].goodsName
  597. uni.setStorageSync('goodsName', this.gridList.goodsName)
  598. if (this.gridList.type == "干粮" && this.gridList.goodsName) {
  599. this.$api.doRequest('get', '/purchasePrice/dryGrainPrice', {
  600. warehouseId: this.cangid,
  601. goodsName: this.gridList.goodsName
  602. }).then(res => {
  603. this.gridList.dryGrainPrice = res.data.data
  604. })
  605. }
  606. this.waterContentChange()
  607. },
  608. goodspicker(e) {
  609. console.log(e)
  610. this.setGoodName(e)
  611. },
  612. typepicker(e) {
  613. var that = this
  614. this.gridList.type = this.typeList[e[0]]
  615. if (this.gridList.type == "干粮" && this.gridList.goodsName) {
  616. this.$api.doRequest('get', '/purchasePrice/dryGrainPrice', {
  617. warehouseId: this.cangid,
  618. goodsName: this.gridList.goodsName
  619. }).then(res => {
  620. that.gridList.dryGrainPrice = res.data.data
  621. })
  622. }
  623. },
  624. binNumberpicker(e) {
  625. this.gridList.binNumber = this.warehouseList[e[0]].binNumber
  626. },
  627. del(item) {
  628. this.$api.doRequest('get', '/qualityInspectionManagement/api/deleteQualityInspection', {
  629. id: item.id
  630. }).then(res => {
  631. if (res.data.code == 200) {
  632. this.$api.msg('删除成功')
  633. } else {
  634. this.$api.msg('系统异常,请联系管理员')
  635. }
  636. })
  637. },
  638. contactUs() {
  639. const that = this
  640. uni.makePhoneCall({
  641. // 手机号
  642. phoneNumber: '18241771147',
  643. // 成功回调
  644. success: (res) => {},
  645. // 失败回调
  646. fail: (res) => {}
  647. });
  648. },
  649. loadData() {
  650. // const that = this
  651. // if(uni.getStorageSync("PageCur")){
  652. // that.PageCur = uni.getStorageSync("PageCur");
  653. // }
  654. // that.userInfoTmp = uni.getStorageSync("userInfo")
  655. // uni.showLoading({
  656. // title: '正在加载',
  657. // mask:true
  658. // })
  659. // that.$api.request('integral', 'getIndexData', failres => {
  660. // that.$api.msg(failres.errmsg)
  661. // uni.hideLoading()
  662. // }).then(res => {
  663. // let data = res.data
  664. // uni.setStorageSync("message", data.message);
  665. // uni.setStorageSync("task", data.task);
  666. // uni.setStorageSync("contract", data.contract);
  667. // uni.setStorageSync('showTran', data.showTran);
  668. // that.showTran = data.showTran
  669. // that.gridList[4].tips = data.task
  670. // that.gridList[2].tips = data.contract
  671. // that.companyId = data.companyId
  672. // uni.hideLoading()
  673. // })
  674. },
  675. confirm() {
  676. const that = this
  677. if (!that.inputContent) {
  678. that.$api.msg('输入不能为空')
  679. return
  680. }
  681. let obj = {}
  682. obj[that.feild] = that.inputContent
  683. that.$api.request('user', 'syncUserInfo', obj).then(res => {
  684. that.userInfo.nickname = that.inputContent
  685. that.inputContent = ''
  686. that.$store.commit('login', that.userInfo)
  687. })
  688. },
  689. cancel() {
  690. this.inputShow = false
  691. this.inputStatus = 'none'
  692. this.genderShow = false
  693. },
  694. myAccount() {
  695. uni.navigateTo({
  696. url: `/pageA/pages/contract`
  697. })
  698. },
  699. /**
  700. * 统一跳转接口,拦截未登录路由
  701. * navigator标签现在默认没有转场动画,所以用view
  702. */
  703. navTo(url) {
  704. if (!this.hasLogin) {
  705. url = '/pages/public/login';
  706. }
  707. uni.navigateTo({
  708. url
  709. })
  710. },
  711. mycarClick(carNo) {
  712. this.modalName = null
  713. uni.navigateTo({
  714. url: `/pageB/car/mycar_detail?carNo=${carNo}`
  715. })
  716. },
  717. scanCode() {
  718. uni.scanCode({
  719. success: function(res) {
  720. uni.navigateTo({
  721. url: res.result
  722. })
  723. }
  724. })
  725. },
  726. hideModal(e) {
  727. this.modalName = null
  728. },
  729. }
  730. }
  731. </script>
  732. <style lang='scss' scoped>
  733. page {
  734. background: #F5F6FA;
  735. }
  736. .title_b {
  737. margin: 20rpx 20rpx 0rpx 20rpx;
  738. padding: 20rpx 10rpx 20rpx 10rpx;
  739. font-size: 18px;
  740. font-weight: 550;
  741. }
  742. .c-row {
  743. display: -webkit-box;
  744. display: -webkit-flex;
  745. display: flex;
  746. -webkit-box-align: center;
  747. -webkit-align-items: center;
  748. align-items: center;
  749. padding: 20rpx 30rpx;
  750. position: relative;
  751. }
  752. .con-list {
  753. -webkit-box-flex: 1;
  754. -webkit-flex: 1;
  755. flex: 1;
  756. display: -webkit-box;
  757. display: -webkit-flex;
  758. display: flex;
  759. -webkit-box-orient: vertical;
  760. -webkit-box-direction: normal;
  761. -webkit-flex-direction: column;
  762. flex-direction: column;
  763. color: #303133;
  764. line-height: 40rpx;
  765. text-align: right;
  766. padding-right: 20rpx;
  767. }
  768. .wrap {
  769. padding-bottom: 10px;
  770. font-size: 14px;
  771. background: #fff;
  772. margin: 10px;
  773. border-radius: 10px;
  774. input {
  775. font-size: 14px;
  776. }
  777. >.title {
  778. padding: 10px 16px;
  779. }
  780. }
  781. .footer {
  782. background: #fff;
  783. position: fixed;
  784. bottom: 0;
  785. width: 100%;
  786. padding: 20px 10px;
  787. z-index: 10;
  788. .button {
  789. background: #22C572;
  790. width: 90%;
  791. margin: 20rpx auto;
  792. padding: 10px;
  793. color: #fff;
  794. text-align: center;
  795. border-radius: 30px;
  796. }
  797. }
  798. </style>