add_quality_testing.vue 24 KB

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