add_quality_testing.vue 24 KB

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