add_quality_testing.vue 26 KB

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