edit_quality_testing.vue 25 KB

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