add_quality_testing.vue 24 KB

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