add_quality_testing.vue 24 KB

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