add_quality_testing.vue 24 KB

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