add_quality_testing.vue 25 KB

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