edit_quality_testing.vue 25 KB

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