add_quality_testing.vue 25 KB

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