add_quality_testing.vue 24 KB

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