add_quality_testing.vue 26 KB

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