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