add_quality_testing.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487
  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. <u-radio-group @change="groupChange" v-model="typevalue">
  9. <u-radio key="1" label="贸易入库" name="1">贸易入库</u-radio>
  10. <u-radio key="3" label="收购入库" name="3">收购入库</u-radio>
  11. </u-radio-group>
  12. </view>
  13. </view>
  14. <view class="c-row ">
  15. <view class="title">仓库</view>
  16. <view class="con-list">
  17. {{gridList.warehouseName}}
  18. </view>
  19. </view>
  20. <view v-if='typevalue==1' class="c-row ">
  21. <view class="title">任务编号</view>
  22. <view class="con-list">
  23. <view @click='show4=true'>{{gridList.inOutTaskNo?gridList.inOutTaskNo:'请选择任务编号'}}</view>
  24. <u-picker :range="taskNolist" range-key="inOutTaskNo" @confirm='tasknopicker($event)'
  25. v-model="show4" mode="selector">
  26. </u-picker>
  27. </view>
  28. </view>
  29. <view v-if='typevalue==1&&gridList.inOutType!="移库入库"' class="c-row ">
  30. <view class="title">合同编号</view>
  31. <view class="con-list">
  32. {{gridList.contractNo?gridList.contractNo:'自动获取,不可编辑'}}
  33. </view>
  34. </view>
  35. <view v-if='typevalue==1&&gridList.inOutType=="移库入库"' class="c-row ">
  36. <view class="title">移库编号</view>
  37. <view class="con-list">
  38. {{gridList.contractNo?gridList.contractNo:'自动获取,不可编辑'}}
  39. </view>
  40. </view>
  41. <view class="c-row ">
  42. <view class="title">业务编号</view>
  43. <view class="con-list">
  44. {{gridList.qualityNo}}
  45. </view>
  46. </view>
  47. <view v-if='typevalue==1' style=' align-items: flex-start;' class="c-row ">
  48. <view class="title">提示</view>
  49. <view class="con-list">
  50. {{gridList.tips?gridList.tips:'自动获取,不可编辑'}}
  51. </view>
  52. </view>
  53. <view v-if='typevalue==1' class="c-row ">
  54. <view class="title">成本</view>
  55. <view class="con-list">
  56. <view v-if='!coststatus'>{{gridList.cost?gridList.cost:'自动获取,不可编辑'}}</view>
  57. <view v-if='coststatus'>
  58. <input v-model='gridList.cost' placeholder="请输入成本" name="input" type="digit"></input>
  59. </view>
  60. </view>
  61. <button class='cu-btn bg-green shadow' @click="changecost">{{costtext}}</button>
  62. </view>
  63. <view v-if='typevalue==1' class="c-row ">
  64. <view class="title">运费</view>
  65. <view class="con-list flex">
  66. <view v-if='!freightstatus'>{{gridList.freight?gridList.freight:'自动获取,不可编辑'}}</view>
  67. <view v-if='freightstatus'>
  68. <input v-model='gridList.freight' placeholder="请输入运费" name="input" type="digit"></input>
  69. </view>
  70. </view>
  71. <button class='cu-btn bg-green shadow' @click="changefreight">{{freighttext}}</button>
  72. </view>
  73. <view v-if='typevalue==1' class="c-row ">
  74. <view class="title">扣款</view>
  75. <view class="con-list">
  76. <input v-model='gridList.deductionAmount' placeholder="请输入扣款" name="input" type="digit"></input>
  77. </view>
  78. </view>
  79. <view v-if='typevalue==1' class="c-row ">
  80. <view class="title">入库类型</view>
  81. <view class="con-list">
  82. {{gridList.inOutType?gridList.inOutType:'自动获取,不可编辑'}}
  83. </view>
  84. </view>
  85. <view v-if='typevalue==1' class="c-row ">
  86. <view class="title">入库日期</view>
  87. <view class="con-list">
  88. <view @click='show5=true'>{{gridList.inOutDate?gridList.inOutDate:'请选择入库日期'}}</view>
  89. <u-picker @confirm='inOutDatepicker($event)' :params="params" v-model="show5" mode="time">
  90. </u-picker>
  91. </view>
  92. </view>
  93. <view v-if='typevalue==1||typevalue==3&&gridList.outType=="自运"' class="c-row ">
  94. <view class="title">车队</view>
  95. <view class="con-list">
  96. <view @click='show6=true'>{{gridList.fleet?ridList.fleet:'非车队车辆'}}</view>
  97. <u-picker @confirm='fleetpicker($event)' :range="fleetNameList" range-key="fleetName"
  98. v-model="show5" mode="selector">
  99. </u-picker>
  100. </view>
  101. </view>
  102. <view v-if='typevalue==1' class="c-row ">
  103. <view class="title">运输方式</view>
  104. <view class="con-list">
  105. <view @click='show7=true'>{{gridList.outType?gridList.outType:'请选择运输方式'}}</view>
  106. <u-picker :range="multiSelector" range-key="name" @confirm='outtypepicker($event,0)' v-model="show7"
  107. mode="selector">
  108. </u-picker>
  109. </view>
  110. </view>
  111. <view v-if='typevalue==3' class="c-row ">
  112. <view class="title">运输方式</view>
  113. <view class="con-list">
  114. <view @click='show8=true'>{{outType?outType:'请选择运输方式'}}</view>
  115. <u-picker :range="multiSelector1" range-key="name" @confirm='outtypepicker($event,1)'
  116. v-model="show8" mode="selector">
  117. </u-picker>
  118. </view>
  119. </view>
  120. <view v-if="gridList.outType=='汽运'&&typevalue==1 ||gridList.outType == '集装箱船'&&typevalue==1" class="c-row ">
  121. <view class="title">箱号-1</view>
  122. <view class="con-list">
  123. <input v-model='gridList.boxNo' placeholder="请输入箱号" name="input" type="digit"></input>
  124. </view>
  125. </view>
  126. <view v-if="gridList.outType== '汽运'&&typevalue==1 ||gridList.outType == '集装箱船'&&typevalue==1"
  127. class="c-row ">
  128. <view class="title">封号-1</view>
  129. <view class="con-list">
  130. <input v-model='gridList.titleNo' placeholder="请输入封号" name="input" type="digit"></input>
  131. </view>
  132. </view>
  133. <view v-if="gridList.outType=='汽运'&&typevalue==1 ||gridList.outType == '集装箱船'&&typevalue==1" class="c-row ">
  134. <view class="title">箱号-2</view>
  135. <view class="con-list">
  136. <input v-model='gridList.boxNoOther' placeholder="请输入箱号" name="input" type="digit"></input>
  137. </view>
  138. </view>
  139. <view v-if="gridList.outType== '汽运'&&typevalue==1 ||gridList.outType == '集装箱船'&&typevalue==1"
  140. class="c-row ">
  141. <view class="title">封号-2</view>
  142. <view class="con-list">
  143. <input v-model='gridList.titleNoOther' placeholder="请输入封号" name="input" type="digit"></input>
  144. </view>
  145. </view>
  146. <view v-if="gridList.paramType != '1'" class="c-row ">
  147. <view class="title">扣重比</view>
  148. <view class="con-list">
  149. <input v-model='gridList.buckleWeightRatio' 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. <view v-if='goodsdisabled'>{{gridList.goodsName}}</view>
  156. <view v-if='!goodsdisabled' @click='show2=true'>{{gridList.goodsName}}</view>
  157. <u-picker :range="goodsList" range-key="goodsName" @confirm='goodspicker($event)' v-model="show2"
  158. mode="selector">
  159. </u-picker>
  160. </view>
  161. </view>
  162. <view v-if='typevalue==3' class="c-row ">
  163. <view class="title">客户</view>
  164. <view class="con-list">
  165. <view @click='gocustomer' v-if='gridList.customerName'>
  166. {{gridList.customerName}}({{gridList.customerPhone}})
  167. </view>
  168. <view @click='gocustomer' v-else>
  169. 选择客户
  170. </view>
  171. </view>
  172. </view>
  173. <view class="c-row ">
  174. <view class="title">车牌号</view>
  175. <view class="con-list">
  176. <input v-model='gridList.carNumber' @click.stop="handleShowKeyboard" :disabled="true"
  177. placeholder="请输入车牌号" name="input"></input>
  178. <master-keyboard ref="keyboard" keyboardtype="car" :randomNumber="true" :newCar="false"
  179. :defaultValue="gridList.carNumber" @keyboardClick="handleClick"></master-keyboard>
  180. </view>
  181. </view>
  182. <view v-if="gridList.paramType != '1'" class="c-row ">
  183. <view class="title">扣重比</view>
  184. <view class="con-list">
  185. <input v-model='gridList.buckleWeightRatio' placeholder="请输入扣重比" name="input" type="digit"></input>
  186. </view>
  187. </view>
  188. <!-- <view v-else class="c-row ">
  189. <view class="title">扣杂</view>
  190. <view class="con-list">
  191. <input v-model='gridList.buckleMiscellaneous' placeholder="初检扣杂" @input="waterContentChange"
  192. name="input" type="digit"></input>
  193. <input v-model='gridList.reBuckleMiscellaneous' placeholder="复检扣杂" @input="waterContentChange"
  194. name="input" type="digit"></input>
  195. </view>
  196. </view> -->
  197. <view v-if='typevalue==3' class="c-row ">
  198. <view class="title">购粮性质</view>
  199. <view class="con-list">
  200. <input v-model='gridList.natureOfGrainPurchase' placeholder="请输入购粮性质" name="input"></input>
  201. </view>
  202. </view>
  203. <view class="c-row ">
  204. <view class="title">仓位号</view>
  205. <view class="con-list">
  206. <view @click='show=true'>{{gridList.binNumber?gridList.binNumber:'请选择仓位号'}}</view>
  207. <u-picker :range="warehouseList" range-key="binNumber" @confirm='binNumberpicker($event)'
  208. v-model="show" mode="selector">
  209. </u-picker>
  210. </view>
  211. </view>
  212. <view class="c-row ">
  213. <view class="title">囤位号</view>
  214. <view class="con-list">
  215. <input type="digit" v-model='gridList.storageTagNo' placeholder="请输入囤位号" name="input"></input>
  216. </view>
  217. </view>
  218. <view class="c-row ">
  219. <view class="title">类型</view>
  220. <view v-if="!edit" class="con-list">
  221. <view @click='show3=true'>{{gridList.type}}</view>
  222. <u-picker :range="typeList" @confirm='typepicker($event)' v-model="show3" mode="selector">
  223. </u-picker>
  224. </view>
  225. <view v-else class="con-list">{{gridList.type}}</view>
  226. </view>
  227. <view v-if="gridList.type == '潮粮'" class="c-row">
  228. <view class="title">净重单价(元/公斤)</view>
  229. <view class="con-list" @click="setPrice">
  230. <!-- <input v-model='gridList.tidalGrainPrice' :disabled='pricedisabled' @blur='inputprice'
  231. placeholder="自动获取,不可编辑" name="input" type="digit"></input> -->
  232. {{gridList.tidalGrainPrice ? gridList.tidalGrainPrice:"请输入潮粮单价"}}
  233. </view>
  234. <button class='cu-btn bg-green shadow' @click="changeprice">{{pricetext}}</button>
  235. </view>
  236. <view v-if="gridList.type == '干粮'" class="c-row">
  237. <view class="title">干粮单价(元/公斤)</view>
  238. <view class="con-list" @click="setPrice">
  239. <!-- <input v-model='gridList.dryGrainPrice' :disabled='pricedisabled' @blur='inputprice'
  240. placeholder="请输入干粮单价" name="input" type="digit"></input>
  241. -->
  242. {{gridList.dryGrainPrice ? gridList.dryGrainPrice:"请输入干粮单价"}}
  243. </view>
  244. <button class='cu-btn bg-green shadow' @click="changeprice">{{pricetext}}</button>
  245. </view>
  246. <view v-if="typevalue==3" class="c-row">
  247. <view class="title">箱号-1</view>
  248. <view class="con-list">
  249. <input v-model='gridList.boxNo' placeholder="请输入箱号" name="input" type="digit"></input>
  250. </view>
  251. </view>
  252. <view v-if="typevalue==3" class="c-row">
  253. <view class="title">封号-1</view>
  254. <view class="con-list">
  255. <input v-model='gridList.titleNo' placeholder="请输入封号" name="input" type="digit"></input>
  256. </view>
  257. </view>
  258. <view v-if="typevalue==3" class="c-row">
  259. <view class="title">箱号-2</view>
  260. <view class="con-list">
  261. <input v-model='gridList.boxNoOther' placeholder="请输入箱号" name="input" type="digit"></input>
  262. </view>
  263. </view>
  264. <view v-if="typevalue==3" class="c-row">
  265. <view class="title">封号-2</view>
  266. <view class="con-list">
  267. <input v-model='gridList.titleNoOther' placeholder="请输入封号" name="input" type="digit"></input>
  268. </view>
  269. </view>
  270. </view>
  271. <view style='padding-bottom:300rpx;'>
  272. <view class='wrap'>
  273. <view style='margin-right:10px;' class='flex justify-between align-item-center'>
  274. <view class='title_b'>化验信息</view>
  275. <view class='flex justify-between align-item-center'>补录:<u-switch activeColor="#22C572"
  276. v-model="value" @change="change"></u-switch>
  277. </view>
  278. </view>
  279. <view class="c-row ">
  280. <view class="title">等级</view>
  281. <view class="con-list">
  282. <view @click='show1=true'>{{gridList.grade?gridList.grade:'请选择等级'}}</view>
  283. <u-picker :range="gradeList" range-key="value" @confirm='gradepicker($event)' v-model="show1"
  284. mode="selector">
  285. </u-picker>
  286. </view>
  287. </view>
  288. <view class="c-row ">
  289. <view class="title">水分(%)</view>
  290. <view class="con-list">
  291. <input v-model='gridList.waterContent' placeholder="初检水分" @input="waterContentChange"
  292. name="input" type="digit"></input>
  293. <input v-model='gridList.rewaterContent' placeholder="复检水分" @input="waterContentChange"
  294. name="input" type="digit"></input>
  295. </view>
  296. </view>
  297. <view class="c-row ">
  298. <view class="title">容重(克/升)</view>
  299. <view class="con-list">
  300. <input v-model='gridList.bulkDensity' placeholder="请输入容重" name="input" type="digit"></input>
  301. </view>
  302. </view>
  303. <view class="c-row ">
  304. <view class="title">不完善粒(%)</view>
  305. <view class="con-list">
  306. <input v-model='gridList.imperfectGrain' placeholder="请输入不完整粒占比" name="input"
  307. type="digit"></input>
  308. </view>
  309. </view>
  310. <view class="c-row ">
  311. <view class="title">杂质(%)</view>
  312. <view class="con-list">
  313. <input v-model='gridList.impurity' placeholder="请输入杂质占比" name="input" type="digit"></input>
  314. </view>
  315. </view>
  316. <view class="c-row ">
  317. <view class="title">霉变粒(%)</view>
  318. <view class="con-list">
  319. <input v-model='gridList.mildewGrain' placeholder="请输入霉变粒占比" name="input" type="digit"></input>
  320. </view>
  321. </view>
  322. <view class="c-row">
  323. <view class="title">热损伤(%)</view>
  324. <view class="con-list">
  325. <input v-model='gridList.jiaorenli' placeholder="请输入热损伤占比" name="input" type="digit"></input>
  326. </view>
  327. </view>
  328. </view>
  329. </view>
  330. <view class="footer">
  331. <!-- <view @click='confirmInfo' class="button">确认初检信息</view> -->
  332. <view @click='submit' class="button">提交</view>
  333. </view>
  334. <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
  335. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
  336. showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
  337. <u-popup v-model="isShowPrint" class="popup" @close="close" mode="bottom" border-radius="30" :closeable="true">
  338. <view class="buns_item">
  339. <view class="but_css" @click="print">打印小票</view>
  340. <view class="but_css" @click="close">返回</view>
  341. </view>
  342. </u-popup>
  343. <u-popup v-model="alterPrice" :round="10" @close="alterClose" mode="center" border-radius="10">
  344. <view style="padding: 20px 20px; display: flex;">
  345. <span style="line-height: 35px;">单价(元/公斤):</span>
  346. <u-input v-if="gridList.type == '潮粮'" placeholder="请输入内容" :border="true" name="input" type="digit" clearable v-model="gridList.tidalGrainPrice" style="width: 170px;">
  347. </u-input>
  348. <u-input v-if="gridList.type == '干粮'" placeholder="请输入内容" :border="true" name="input" type="digit" clearable v-model="gridList.dryGrainPrice" style="width: 170px;">
  349. </u-input>
  350. </view>
  351. <u-button type="success" style="width: 50%;margin-bottom: 10px;" @click="good">确定</u-button>
  352. </u-popup>
  353. </view>
  354. </template>
  355. <script>
  356. import dragButton from "@/components/drag-button/drag-button.vue";
  357. import keyboard from "@/components/master-keyboard/master-keyboard.vue";
  358. import {
  359. mapState
  360. } from 'vuex';
  361. let startY = 0,
  362. moveY = 0,
  363. pageAtTop = true;
  364. export default {
  365. components: {
  366. dragButton,
  367. keyboard
  368. },
  369. data() {
  370. return {
  371. isShowPrint: false,
  372. isShowAlert: false,
  373. content: '确认初检信息后,初检员不需要再次确认质检信息,是否确定提交?',
  374. inputShow: false,
  375. params: {
  376. year: true,
  377. month: true,
  378. day: true,
  379. },
  380. modalName: '',
  381. pricetext: '锁定',
  382. pricedisabled: false,
  383. show8: false,
  384. mycarStyle: '',
  385. feild: undefined,
  386. id: 0,
  387. outType: '他运',
  388. show: false,
  389. show4: false,
  390. show5: false,
  391. show6: false,
  392. show7: false,
  393. edit: true,
  394. goodsdisabled: false,
  395. freighttext: '手动填写',
  396. costtext: '手动填写',
  397. selector: [],
  398. show1: false,
  399. inputContent: '',
  400. multiSelector1: [{
  401. name: '他运',
  402. value: '他运'
  403. }],
  404. typevalue: '3',
  405. coverTransform: 'translateY(0px)',
  406. coverTransition: '0s',
  407. moving: false,
  408. footprintList: [],
  409. searchKeyWord: '',
  410. isVip: false,
  411. userInfoTmp: [],
  412. inputStatus: 'none',
  413. carInfo: [],
  414. gridCol: 4,
  415. freightstatus: false,
  416. coststatus: false,
  417. pageSize: 10,
  418. show3: false,
  419. show2: false,
  420. goodsList: [],
  421. currentPage: 1,
  422. value: false,
  423. gridBorder: false,
  424. headUrl: "../../static/img/myimg/YongHu@3x.png",
  425. userphone: "",
  426. username: "请更改昵称",
  427. gridList: {
  428. natureOfGrainPurchase: '贸易粮',
  429. type: '',
  430. tidalGrainPrice: '',
  431. dryGrainPrice: '',
  432. buckleMiscellaneous: '',
  433. carNumber: '',
  434. customerName: '',
  435. customerPhone: '',
  436. bulkDensity: "",
  437. imperfectGrain: "",
  438. waterContent: "",
  439. jiaorenli: "",
  440. impurity: "",
  441. mildewGrain: "",
  442. compName: "",
  443. type: '',
  444. freight: 0,
  445. cost: '',
  446. addressUrl: '',
  447. tidalGrainPrice: 0,
  448. buckleWeightRatio: 0,
  449. buckleMiscellaneous: 0,
  450. paramType: 1,
  451. warehouseInOutDetail: {
  452. grade: '',
  453. reGrade: '',
  454. imperfectGrain: '',
  455. reImperfectGrain: '',
  456. impurity: '',
  457. reImpurity: '',
  458. jiaorenli: '',
  459. reJiaorenli: '',
  460. bulkDensity: '',
  461. reBulkDensity: '',
  462. mildewGrain: '',
  463. reMildewGrain: '',
  464. },
  465. disablednotarize: false,
  466. deductionAmount: 0,
  467. deductionWeight: 0,
  468. grossWeight: 0,
  469. tare: 0,
  470. grade: '',
  471. inOutDate: new Date().toISOString().slice(0, 10),
  472. netWeight: 0,
  473. pureWeight: 0,
  474. deductionWeight: 0,
  475. waterContent: '',
  476. reWaterContent: '',
  477. reGrade: '',
  478. imperfectGrain: '',
  479. reImperfectGrain: '',
  480. impurity: '',
  481. reImpurity: '',
  482. jiaorenli: '',
  483. reJiaorenli: '',
  484. bulkDensity: '',
  485. reBulkDensity: '',
  486. reMemo: '',
  487. storageTagNo: '',
  488. mildewGrain: '',
  489. reMildewGrain: '',
  490. boxNo: '',
  491. boxNoOther: '',
  492. titleNo: '',
  493. titleNoOther: '',
  494. statusFlag: 1
  495. },
  496. typeList: ['潮粮', '干粮'],
  497. managementType: '',
  498. warehouseName: '',
  499. warehouseList: [],
  500. warehouseCount: '',
  501. commonWarehouseNo: '',
  502. tranCarInfoList: [],
  503. warehouseTradeCount: 0,
  504. showTran: true,
  505. companyId: 1,
  506. contractNolist: [],
  507. current: 4,
  508. taskNolist: [],
  509. fleetNameList: [],
  510. multiSelector: [{
  511. name: '汽运',
  512. value: '0',
  513. },
  514. {
  515. name: '火运',
  516. value: '1',
  517. },
  518. {
  519. name: '集装箱船',
  520. value: '2',
  521. },
  522. {
  523. name: '散船',
  524. value: '3',
  525. },
  526. ],
  527. gradeList: [{
  528. key: 1,
  529. value: '一等品'
  530. },
  531. {
  532. key: 2,
  533. value: '二等品'
  534. },
  535. {
  536. key: 3,
  537. value: '三等品'
  538. },
  539. {
  540. key: 4,
  541. value: '等外'
  542. },
  543. ],
  544. cangid: '',
  545. alterPrice: false,
  546. Price: "",
  547. }
  548. },
  549. // #ifndef MP
  550. onNavigationBarButtonTap(e) {
  551. const index = e.index;
  552. if (index === 0) {
  553. this.navTo('/pages/set/set');
  554. } else if (index === 1) {
  555. // #ifdef APP-PLUS
  556. const pages = getCurrentPages();
  557. const page = pages[pages.length - 1];
  558. const currentWebview = page.$getAppWebview();
  559. currentWebview.hideTitleNViewButtonRedDot({
  560. index
  561. });
  562. // #endif
  563. uni.navigateTo({
  564. url: '/pages/notice/notice'
  565. })
  566. }
  567. },
  568. // #endif
  569. computed: {
  570. ...mapState(['hasLogin', 'userInfo']),
  571. // 手机号中间4位加*
  572. starUserphone() {
  573. let reg = /^(\d{3})\d{4}(\d{4})$/;
  574. if (this.userphone) {
  575. return this.userphone.replace(reg, "$1****$2");
  576. }
  577. }
  578. },
  579. onLoad(options) {
  580. this.commonWarehouseNo = options.commonWarehouseNo
  581. this.warehouseCount = Number(options.warehouseCount) + 1
  582. this.warehouseTradeCount = Number(options.warehouseTradeCount) + 1
  583. let number = '000' + this.warehouseCount
  584. number = number.substring(number.length - 4, number.length)
  585. this.gridList.warehouseName = options.warehouseName
  586. this.gridList.qualityNo = 'SGRK' + this.getdate() + this.commonWarehouseNo + number
  587. this.cangid = options.cangid
  588. this.gridList.compName = uni.getStorageSync('compName')
  589. this.gridList.person = options.personCharge
  590. this.gridList.personPhone = options.personPhone
  591. this.gridList.qualityInspector = uni.getStorageSync("userInfo").userName
  592. // this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
  593. // warehouseId: this.cangid
  594. // }).then(res => {
  595. // if (res.data.data) {
  596. // this.setGoodName([0])
  597. // }
  598. // })
  599. this.managementType = options.managementType
  600. let that = this
  601. this.purchasePriceList = uni.getStorageSync('purchasePriceList')
  602. // if (uni.getStorageSync('checkcustomer')) {
  603. // let _customerInfo = uni.getStorageSync('checkcustomer')
  604. // if (_customerInfo.shipperName) {
  605. // this.gridList.identityId = _customerInfo.id
  606. // //点击登记客户
  607. // this.gridList.customerName = _customerInfo.shipperName
  608. // this.gridList.customerPhone = _customerInfo.shipperPhone
  609. // this.gridList.carNumber=_customerInfo.carNo
  610. // } else {
  611. // //点击搜索客户
  612. // this.gridList.customerName = _customerInfo.customerName
  613. // this.gridList.customerPhone = _customerInfo.customerPhone
  614. // }
  615. // this.gridList.customerNumberCard = _customerInfo.customerNumberCard
  616. // }
  617. this.gridList.grade = this.gradeList[0].value
  618. this.gridList.gradeKey = this.gradeList[0].key
  619. this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
  620. id: this.cangid
  621. }).then(res => {
  622. this.warehouseList = res.data.data.warehousePositionInfoList
  623. })
  624. this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
  625. warehouseId: this.cangid
  626. }).then(res => {
  627. if (res.data.data) {
  628. that.goodsList = res.data.data
  629. if (that.goodsList.length > 0) {
  630. that.gridList.goodsName = that.goodsList[0].goodsName
  631. this.setGoodName([0], 1)
  632. uni.setStorageSync('purchasePriceList', that.goodsList)
  633. that.purchasePriceList = uni.getStorageSync('purchasePriceList')
  634. }
  635. // for (let i = 0; i < res.data.data.length; i++) {
  636. // this.goodsList.push(res.data.data[i].goodsName)
  637. // }
  638. // if(this.goodsList.some(item=>{return item.goodsName=='玉米'})){
  639. // this.gridList.goodsName='玉米'
  640. // uni.setStorageSync('goodsName',this.gridList.goodsName)
  641. // }else{
  642. // this.gridList.goodsName=this.goodsList[0].goodsName
  643. // uni.setStorageSync('goodsName',this.gridList.goodsName)
  644. // }
  645. }
  646. })
  647. },
  648. onShow() {
  649. uni.showLoading({
  650. title: '加载中',
  651. mask: true
  652. })
  653. this.$api.doRequest('get', '/inOutWarehouseTask/selectInOutWarehouseNo', {
  654. flag: 2,
  655. warehouseName: this.gridList.warehouseName
  656. }).then(res => {
  657. console.log(res)
  658. this.taskNolist = res.data.data
  659. })
  660. this.multiSelector1 = []
  661. this.$api.doRequest('get', '/inOutWarehouseTask/getContractNo', {
  662. warehouseName: this.gridList.warehouseName
  663. }).then(res => {
  664. // console.log(res)
  665. if (res.data.data.contractManagementInfoList) {
  666. for (let i = 0; i < res.data.data.contractManagementInfoList.length; i++) {
  667. res.data.data.contractMangementInfoList[i].name = '自运 (' +
  668. res.data.data.contractMangementInfoList[i].contractNo + ' ' + res.data.data
  669. .contractMangementInfoList[i].seller + ')'
  670. this.multiSelector1.push(res.data.data.contractManagementInfoList[i])
  671. }
  672. }
  673. // this.taskNolist=res.data.data
  674. })
  675. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
  676. flag: 7,
  677. }).then(res => {
  678. if (res.data.data) {
  679. console.log(res.data.data)
  680. uni.hideLoading();
  681. }
  682. this.contractNolist = res.data.data
  683. })
  684. if (uni.getStorageSync('checkcustomer')) {
  685. let _customerInfo = uni.getStorageSync('checkcustomer')
  686. if (_customerInfo.shipperName) {
  687. this.gridList.identityId = _customerInfo.id
  688. //点击登记客户
  689. this.gridList.customerName = _customerInfo.shipperName
  690. this.gridList.customerPhone = _customerInfo.shipperPhone
  691. this.gridList.carNumber = _customerInfo.carNo
  692. } else {
  693. //点击搜索客户
  694. this.gridList.customerName = _customerInfo.customerName
  695. this.gridList.customerPhone = _customerInfo.customerPhone
  696. }
  697. this.gridList.customerNumberCard = _customerInfo.customerNumberCard
  698. }
  699. },
  700. methods: {
  701. setPrice() {
  702. if (this.pricetext == "锁定") {
  703. this.alterPrice = true
  704. } else {
  705. this.$api.msg('锁定状态单价不能编辑')
  706. return
  707. }
  708. },
  709. good() {
  710. this.alterPrice = false
  711. },
  712. alterClose() {
  713. this.Price = ""
  714. this.alterPrice = false
  715. },
  716. changeprice() {
  717. if (this.pricetext == '解锁') {
  718. this.pricedisabled = false
  719. this.pricetext = '锁定'
  720. } else {
  721. this.pricedisabled = true
  722. this.pricetext = '解锁'
  723. }
  724. },
  725. inputprice() {
  726. if (this.pricetext == '锁定') {
  727. this.pricedisabled = true
  728. this.pricetext = '解锁'
  729. }
  730. },
  731. groupChange(e) {
  732. this.gridList.serviceManagementType = e
  733. if (e == 1) {
  734. this.gridList.qualityNo = ''
  735. } else {
  736. let number = '000' + this.warehouseCount
  737. number = number.substring(number.length - 4, number.length)
  738. this.gridList.qualityNo = 'SGRK' + this.getdate() + this.commonWarehouseNo + number
  739. }
  740. },
  741. outtypepicker(e, status) {
  742. if (status == 0) {
  743. this.gridList.outType = this.multiSelector[e[0]].name
  744. } else {
  745. if (this.multiSelector[e[0]].name == '他运') {
  746. this.goodsdisabled = false
  747. this.gridList.outType = this.multiSelector1[e[0]].name
  748. } else {
  749. this.gridList.outType = '自运'
  750. this.goodsdisabled = true
  751. this.outType = this.multiSelector[e[0]].name
  752. this.gridList.contractNo = this.multiSelector1[i].contractNo
  753. for (let i = 0; i < this.contractNolist.length; i++) {
  754. if (this.gridList.contractNo == this.contractNolist[i].contractNo) {
  755. this.gridList.goodsName = this.outContractNo[q].goodsName
  756. this.gridList.goodsNameKey = this.outContractNo[q].goodsNameKey
  757. }
  758. }
  759. this.waterContentChange()
  760. }
  761. }
  762. console.log(this.gridList.outType)
  763. },
  764. changefreight() {
  765. this.freightstatus = !this.freightstatus
  766. if (this.freightstatus) {
  767. this.freighttext = '自动获取'
  768. } else {
  769. this.freighttext = '手动填写'
  770. }
  771. },
  772. changecost() {
  773. this.coststatus = !this.coststatus
  774. if (this.coststatus) {
  775. this.costtext = '自动获取'
  776. } else {
  777. this.costtext = '手动填写'
  778. }
  779. },
  780. inOutDatepicker(e) {
  781. this.gridList.inOutDate = e.year + '-' + e.month + '-' + e.day
  782. console.log(e)
  783. },
  784. fleetpicker(e) {
  785. this.gridList.fleet = this.fleetNameList[e[0]].fleetName
  786. },
  787. change(e) {
  788. if (e) {
  789. this.gridList.supplementaryRecording = 1
  790. } else {
  791. this.gridList.supplementaryRecording = 0
  792. }
  793. },
  794. tasknopicker(e) {
  795. console.log(e)
  796. this.gridList.inOutTaskNo = this.taskNolist[e[0]].inOutTaskNo
  797. var data = this.taskNolist[e[0]]
  798. if (this.taskNolist[e[0]].contractNo) {
  799. this.gridList.contractNo = this.taskNolist[e[0]].contractNo
  800. } else {
  801. this.gridList.contractNo = this.taskNolist[e[0]].moveTaskNo
  802. }
  803. for (let i = 0; i < this.contractNolist.length; i++) {
  804. if (this.gridList.contractNo == this.contractNolist[i].contractNo) {
  805. console.log(this.contractNolist[i])
  806. this.gridList.goodsName = this.contractNolist[i].goodsName
  807. this.gridList.goodsNameKey = this.contractNolist[i].goodsNameKey
  808. this.gridList.grade = this.contractNolist[i].grade
  809. this.gridList.inOutType = this.contractNolist[i].inOutType
  810. if (this.gridList.inOutType == '采购入库') {
  811. this.warehouseTradeCount = '000' + this.warehouseTradeCount
  812. this.gridList.qualityNo = 'CGRK' + this.getdate() + this.commonWarehouseNo + this
  813. .warehouseTradeCount.substring(this.warehouseTradeCount.length - 4)
  814. if (!this.contractNolist[i].unitContractPrice) {
  815. this.gridList.tips = '卖方' + this.contractNolist[i].seller
  816. } else {
  817. this.gridList.tips = '卖方' + this.contractNolist[i].seller + '( ' + this.contractNolist[i]
  818. .unitContractPrice + '元/吨)'
  819. }
  820. this.gridList.inOutTypeKey = 1
  821. } else if (this.gridList.inOutType == '移库入库') {
  822. this.warehouseTradeCount = '000' + this.warehouseTradeCount
  823. this.gridList.qualityNo = 'YKRK' + this.getdate() + this.commonWarehouseNo + this
  824. .warehouseTradeCount.substring(this.warehouseTradeCount.length - 4)
  825. if (this.contractNolist[i].unitContractPrice) {
  826. this.gridList.tips = '出货库' + data.sendWarehouse + ' (' + this.contractNolist[i]
  827. .unitContractPrice + '元/吨)'
  828. } else {
  829. this.gridList.tips = '出货库' + data.sendWarehouse
  830. }
  831. this.gridList.inOutTypeKey = 3
  832. } else if (this.contractNolist[i].inOutType == '移库出库') {
  833. this.gridList.tips = '入货库' + data.receiveWarehouse
  834. } else if (this.contractNolist[i].inOutType == '暂存入库') {
  835. this.gridList.inOutTypeKey = 4
  836. } else if (this.contractNolist[i].inOutType == '贸易服务入库') {
  837. this.gridList.inOutTypeKey = 5
  838. } else if (this.contractNolist[i].inOutType == '退库') {
  839. if (this.contractNolist[i].contractNo) {
  840. this.gridList.tips = '买方' + this.contractNolist[i].buyer
  841. } else {
  842. this.gridList.tips = '出货库' + data.sendWarehouse
  843. }
  844. this.gridList.inOutTypeKey = 6
  845. }
  846. this.cost = this.contractNolist[i].contractPrice
  847. if (this.cost) {
  848. this.isGetCost = true
  849. this.gridList.cost = this.cost - this.gridList.deductionAmount
  850. } else {
  851. this.isGetCost = false
  852. this.gridList.cost = this.gridList.cost
  853. }
  854. if (this.contractNolist[i].inOutType == '移库入库') {
  855. this.isSelectType = false
  856. } else {
  857. this.isSelectType = true
  858. }
  859. if (this.contractNolist[i].priceType == '随行就市') {
  860. this.disabled1 = !this.disabled1
  861. }
  862. if (this.contractNolist[i].deliverType == '1') {
  863. this.carstatus = true
  864. } else {
  865. this.carstatus = false
  866. }
  867. if (this.contractNolist[i].tranCarInfoList) {
  868. this.tranCarInfoList = this.contractNolist[i].tranCarInfoList
  869. // this.carstatus = true
  870. } else {
  871. this.options2 = []
  872. }
  873. this.fleetNameList = this.contractNolist[i].tranCarInfoList1
  874. }
  875. }
  876. console.log(this.gridList)
  877. },
  878. print() {
  879. uni.navigateTo({
  880. url: '/pages/erpbusiness/bleConnect'
  881. })
  882. },
  883. close() {
  884. this.isShowPrint = false
  885. uni.navigateBack({})
  886. },
  887. hidden() {
  888. this.$refs.keyboard.open(false)
  889. },
  890. handleShowKeyboard() {
  891. if (this.$refs.keyboard.open) {
  892. this.$refs.keyboard.open(true) //true 键盘显示 false 键盘隐藏
  893. } else {
  894. this.$refs.keyboard[0].open(true)
  895. }
  896. },
  897. handleClick(e) {
  898. this.gridList.carNumber = e.value //键盘输入值
  899. },
  900. // confirmInfo() {
  901. // this.isShowAlert = true
  902. // },
  903. // alertBtn() {
  904. // this.$api.doRequest('get', '/qualityInspectionManagement/api/editQualityInspection', {
  905. // id: this.id,
  906. // flag:2
  907. // }).then(res => {
  908. // if(res.data.code=="200"){
  909. // this.$api.msg('提交成功!')
  910. // }else{
  911. // this.$api.msg('提交失败')
  912. // }
  913. // })
  914. // },
  915. cancelClick() {
  916. this.isShowAlert = false
  917. },
  918. waterContentChange() {
  919. var that = this
  920. if (this.gridList.goodsName && this.cangid) {
  921. if (!this.gridList.dryGrainPrice || this.gridList.dryGrainPrice == 0) {
  922. this.$api.doRequest('get', '/purchasePrice/dryGrainPrice', {
  923. warehouseId: this.cangid,
  924. goodsName: this.gridList.goodsName
  925. }).then(res => {
  926. that.gridList.dryGrainPrice = res.data.data
  927. })
  928. }
  929. }
  930. if (this.gridList.goodsName) {
  931. for (var i = 0; i < this.purchasePriceList.length; i++) {
  932. if (this.purchasePriceList[i].goodsName == this.gridList.goodsName) {
  933. this.gridList.buckleWeightRatio = this.purchasePriceList[i].deductWeight
  934. this.gridList.paramType = this.purchasePriceList[i].paramType
  935. }
  936. }
  937. }
  938. var numReg = /^[0-9]*$/
  939. var numRe = new RegExp(numReg)
  940. //潮粮单价改变事件
  941. if (
  942. this.gridList.goodsName &&
  943. this.gridList.waterContent &&
  944. this.gridList.grade &&
  945. numRe.test(this.gridList.waterContent)
  946. ) {
  947. this.$api.doRequest('get', '/purchasePrice/tidalGrainPrice', {
  948. warehouseId: this.cangid,
  949. goodsName: this.gridList.goodsName,
  950. waterContent: this.gridList.waterContent,
  951. grade: this.gridList.grade,
  952. }).then(res => {
  953. if (that.gridList.paramType == '1') {
  954. that.gridList.tidalGrainPrice = parseFloat(parseFloat(res.data.data) - parseFloat(that
  955. .gridList.buckleMiscellaneous) / 100 * parseFloat(that.gridList
  956. .dryGrainPrice)).toFixed(4)
  957. if (!that.gridList.tidalGrainPrice) {
  958. that.gridList.tidalGrainPrice = ''
  959. }
  960. } else {
  961. if (that.gridList.type == '干粮') {
  962. that.gridList.dryGrainPrice = res.data.data
  963. } else {
  964. that.gridList.tidalGrainPrice = res.data.data
  965. }
  966. }
  967. })
  968. }
  969. },
  970. gocustomer() {
  971. uni.navigateTo({
  972. url: '/pages/erpbusiness/customer?cangid=' + this.cangid + '&warehouseName=' + this.gridList
  973. .warehouseName + '&goodsName=' + this.gridList.goodsName
  974. })
  975. },
  976. getdate() {
  977. var date = new Date()
  978. var year = date.getFullYear() //获取完整的年份(4位)
  979. var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  980. var datetime = date.getDate() //获取当前日(1-31)
  981. if (mouth < 10) {
  982. mouth = '0' + mouth
  983. }
  984. if (datetime < 10) {
  985. datetime = '0' + datetime
  986. }
  987. return year + '' + mouth + '' + datetime
  988. },
  989. submit() {
  990. if (this.typevalue == 3) {
  991. if (this.outType) {
  992. this.gridList.outType = this.outType
  993. }
  994. }
  995. var that = this
  996. this.gridList.carNo = this.gridList.carNumber
  997. this.gridList.baseId = this.cangid
  998. this.gridList.warehouseId = this.cangid
  999. if (!this.gridList.qualityNo) {
  1000. this.$api.msg('编号不能为空')
  1001. return
  1002. }
  1003. if (!this.gridList.binNumber) {
  1004. this.$api.msg('仓位不能为空')
  1005. return
  1006. }
  1007. if (this.typevalue == 3) {
  1008. if (!this.gridList.customerName) {
  1009. this.$api.msg('客户不能为空')
  1010. return
  1011. }
  1012. if (!this.gridList.natureOfGrainPurchase) {
  1013. this.$api.msg('购粮性质不能为空')
  1014. return
  1015. }
  1016. }
  1017. // if (!this.gridList.storageTagNo) {
  1018. // this.$api.msg('囤位号不能为空')
  1019. // return
  1020. // }
  1021. // if (this.gridList.storageTagNo&&this.gridList.storageTagNo.length > 10) {
  1022. // this.$api.msg('囤位号不能为空')
  1023. // return
  1024. // }
  1025. if (!this.gridList.carNumber) {
  1026. this.$api.msg('车牌号不能为空')
  1027. return
  1028. }
  1029. if (this.gridList.carNumber.length != 7) {
  1030. this.$api.msg('车牌号输入错误')
  1031. return
  1032. }
  1033. if (!this.gridList.goodsName) {
  1034. this.$api.msg('货名不能为空')
  1035. return
  1036. }
  1037. // if (this.gridList.buckleWeightRatio < 0 || this.gridList.buckleWeightRatio > 2) {
  1038. // this.$api.msg('扣重比输入错误')
  1039. // return
  1040. // }
  1041. // if (
  1042. // String(this.gridList.buckleWeightRatio).indexOf('.') != -1 &&
  1043. // String(this.gridList.buckleWeightRatio).length -
  1044. // (String(this.gridList.buckleWeightRatio).indexOf('.') + 1) > 2) {
  1045. // this.$api.msg('扣重比输入错误')
  1046. // return
  1047. // }
  1048. if (!this.gridList.type) {
  1049. this.$api.msg('类型不能为空')
  1050. return
  1051. }
  1052. if (this.value == false) {
  1053. if (!this.gridList.grade) {
  1054. this.$api.msg('等级不能为空')
  1055. return
  1056. }
  1057. if (!this.gridList.impurity) {
  1058. this.$api.msg('杂质不能为空')
  1059. return
  1060. }
  1061. if (!this.gridList.waterContent) {
  1062. this.$api.msg('初检水分不能为空')
  1063. return
  1064. }
  1065. // if (!this.gridList.reWaterContent) {
  1066. // this.$api.msg('复检水分不能为空')
  1067. // return
  1068. // }
  1069. if (!this.gridList.mildewGrain) {
  1070. this.$api.msg('霉变粒不能为空')
  1071. return
  1072. }
  1073. if (!this.gridList.bulkDensity) {
  1074. this.$api.msg('容重不能为空')
  1075. return
  1076. }
  1077. if (!this.gridList.jiaorenli) {
  1078. this.$api.msg('热损伤不能为空')
  1079. return
  1080. }
  1081. if (!this.gridList.imperfectGrain) {
  1082. this.$api.msg('不完整粒不能为空')
  1083. return
  1084. }
  1085. }
  1086. uni.showModal({
  1087. content: "确定提交质检信息?",
  1088. showCancel: true,
  1089. confirmText: '提交',
  1090. success: function(res) {
  1091. if (res.confirm) {
  1092. that.gridList.serviceManagementType = that.typevalue
  1093. if (that.typevalue == 3) {
  1094. that.$api.doRequest('get', '/paymentManagement/cumulant', {
  1095. compId: uni.getStorageSync('pcUserInfo').compId,
  1096. customerNumberCard: that.gridList.customerNumberCard,
  1097. goodsName: that.gridList.goodsName,
  1098. })
  1099. .then(response => {
  1100. if (response.data.code == 200) {
  1101. for (let i = 0; i < that.purchasePriceList.length; i++) {
  1102. if (
  1103. that.gridList.goodsName == that.purchasePriceList[i]
  1104. .goodsName
  1105. ) {
  1106. let count = (that.purchasePriceList[i].saleLimit -
  1107. response.data.data / 1000).toFixed(2)
  1108. console.log(count, that.purchasePriceList[i].saleLimit,
  1109. response.data.data)
  1110. if (Number(count) <= 0) {
  1111. count = 0
  1112. that.$api.msg('该客户累计销售' + that.gridList.goodsName +
  1113. (
  1114. response.data.data / 1000).toFixed(2) +
  1115. '吨,还可售粮' +
  1116. count + '吨', )
  1117. } else {
  1118. that.$api.doRequest('post',
  1119. '/warehouseInOutInfo/InOutWarehouse',
  1120. that.gridList)
  1121. .then(res => {
  1122. that.gridList.warehouseInOutId = res
  1123. .data.data
  1124. that.$api.doRequest('post',
  1125. '/qualityInspectionManagement/api/addQualityInspection',
  1126. that.gridList)
  1127. .then(res => {
  1128. if (res.data.code == 200) {
  1129. that.$api.msg('提交成功')
  1130. that.isShowPrint = true
  1131. that.gridList
  1132. .warehouseId = that
  1133. .cangid
  1134. that.gridList.compId =
  1135. uni.getStorageSync(
  1136. 'pcUserInfo')
  1137. .compId
  1138. uni.setStorageSync(
  1139. "quality_print",
  1140. that.gridList)
  1141. console.log(
  1142. 'that.gridList',
  1143. that.gridList)
  1144. // uni.navigateBack({})
  1145. } else {
  1146. that.$api.msg('提交失败')
  1147. }
  1148. })
  1149. })
  1150. }
  1151. }
  1152. }
  1153. }
  1154. })
  1155. } else {
  1156. that.$api.doRequest('post',
  1157. '/warehouseInOutInfo/InOutWarehouse',
  1158. that.gridList)
  1159. .then(res => {
  1160. that.gridList.warehouseInOutId = res.data.data
  1161. that.$api.doRequest('post',
  1162. '/qualityInspectionManagement/api/addQualityInspection',
  1163. that.gridList)
  1164. .then(res => {
  1165. if (res.data.code == 200) {
  1166. that.$api.msg('提交成功')
  1167. that.isShowPrint = true
  1168. that.gridList.warehouseId = that.cangid
  1169. that.gridList.compId = uni.getStorageSync(
  1170. 'pcUserInfo').compId
  1171. uni.setStorageSync("quality_print", that.gridList)
  1172. console.log('that.gridList', that.gridList)
  1173. // uni.navigateBack({})
  1174. } else {
  1175. hat.$api.msg('提交失败')
  1176. }
  1177. })
  1178. })
  1179. }
  1180. }
  1181. }
  1182. })
  1183. },
  1184. gradepicker(e) {
  1185. console.log(e)
  1186. // this.$set(this.gradeList,'grade',this.gradeList[e[0]].value)
  1187. this.gridList.grade = this.gradeList[e[0]].value
  1188. this.gridList.gradeKey = this.gradeList[e[0]].key
  1189. this.waterContentChange()
  1190. },
  1191. setGoodName(e, status) {
  1192. //
  1193. // [e[0]] = 0
  1194. // this.$set(this.gradeList,'grade',this.gradeList[e[0]].value)
  1195. if (this.goodsList[e[0]].goodsName == '玉米') {
  1196. this.gridList.type = '干粮'
  1197. this.edit = true
  1198. } else if (this.goodsList[e[0]].goodsName == '玉米(潮粮)') {
  1199. this.gridList.type = '潮粮'
  1200. this.edit = true
  1201. } else {
  1202. this.gridList.type = '干粮'
  1203. this.edit = false
  1204. }
  1205. var that = this
  1206. this.gridList.goodsName = this.goodsList[e[0]].goodsName
  1207. // this.$api.doRequest('get', '/identityAuthenticationInfo/identityAuthenticationInfoCustomer', {
  1208. // warehouseId: this.cangid,
  1209. // goodsName: this.gridList.goodsName
  1210. // }).then(res => {
  1211. // if (res.data.data) {
  1212. // uni.hideLoading()
  1213. // // let data = res.data.data
  1214. // // that.gridList =data
  1215. // }
  1216. // })
  1217. uni.setStorageSync('goodsName', this.gridList.goodsName)
  1218. if (this.gridList.type == "干粮" && this.gridList.goodsName) {
  1219. if (!status) {
  1220. uni.showLoading({
  1221. title: '加载中',
  1222. mask: true
  1223. })
  1224. }
  1225. this.$api.doRequest('get', '/purchasePrice/dryGrainPrice', {
  1226. warehouseId: this.cangid,
  1227. goodsName: this.gridList.goodsName
  1228. }).then(res => {
  1229. this.gridList.dryGrainPrice = res.data.data
  1230. if (!status) {
  1231. uni.hideLoading()
  1232. }
  1233. })
  1234. }
  1235. this.waterContentChange()
  1236. },
  1237. goodspicker(e) {
  1238. console.log(e)
  1239. this.setGoodName(e)
  1240. },
  1241. typepicker(e) {
  1242. var that = this
  1243. this.gridList.type = this.typeList[e[0]]
  1244. if (this.gridList.type == "干粮" && this.gridList.goodsName) {
  1245. this.$api.doRequest('get', '/purchasePrice/dryGrainPrice', {
  1246. warehouseId: this.cangid,
  1247. goodsName: this.gridList.goodsName
  1248. }).then(res => {
  1249. that.gridList.dryGrainPrice = res.data.data
  1250. })
  1251. }
  1252. },
  1253. binNumberpicker(e) {
  1254. console.log(this.warehouseList[e[0]])
  1255. this.gridList.binNumber = this.warehouseList[e[0]].binNumber
  1256. this.gridList.positionId = this.warehouseList[e[0]].id
  1257. },
  1258. del(item) {
  1259. this.$api.doRequest('get', '/qualityInspectionManagement/api/deleteQualityInspection', {
  1260. id: item.id
  1261. }).then(res => {
  1262. if (res.data.code == 200) {
  1263. this.$api.msg('删除成功')
  1264. } else {
  1265. this.$api.msg('系统异常,请联系管理员')
  1266. }
  1267. })
  1268. },
  1269. contactUs() {
  1270. const that = this
  1271. uni.makePhoneCall({
  1272. // 手机号
  1273. phoneNumber: '18241771147',
  1274. // 成功回调
  1275. success: (res) => {},
  1276. // 失败回调
  1277. fail: (res) => {}
  1278. });
  1279. },
  1280. loadData() {
  1281. // const that = this
  1282. // if(uni.getStorageSync("PageCur")){
  1283. // that.PageCur = uni.getStorageSync("PageCur");
  1284. // }
  1285. // that.userInfoTmp = uni.getStorageSync("userInfo")
  1286. // uni.showLoading({
  1287. // title: '正在加载',
  1288. // mask:true
  1289. // })
  1290. // that.$api.request('integral', 'getIndexData', failres => {
  1291. // that.$api.msg(failres.errmsg)
  1292. // uni.hideLoading()
  1293. // }).then(res => {
  1294. // let data = res.data
  1295. // uni.setStorageSync("message", data.message);
  1296. // uni.setStorageSync("task", data.task);
  1297. // uni.setStorageSync("contract", data.contract);
  1298. // uni.setStorageSync('showTran', data.showTran);
  1299. // that.showTran = data.showTran
  1300. // that.gridList[4].tips = data.task
  1301. // that.gridList[2].tips = data.contract
  1302. // that.companyId = data.companyId
  1303. // uni.hideLoading()
  1304. // })
  1305. },
  1306. confirm() {
  1307. const that = this
  1308. if (!that.inputContent) {
  1309. that.$api.msg('输入不能为空')
  1310. return
  1311. }
  1312. let obj = {}
  1313. obj[that.feild] = that.inputContent
  1314. that.$api.request('user', 'syncUserInfo', obj).then(res => {
  1315. that.userInfo.nickname = that.inputContent
  1316. that.inputContent = ''
  1317. that.$store.commit('login', that.userInfo)
  1318. })
  1319. },
  1320. cancel() {
  1321. this.inputShow = false
  1322. this.inputStatus = 'none'
  1323. this.genderShow = false
  1324. },
  1325. myAccount() {
  1326. uni.navigateTo({
  1327. url: `/pageA/pages/contract`
  1328. })
  1329. },
  1330. /**
  1331. * 统一跳转接口,拦截未登录路由
  1332. * navigator标签现在默认没有转场动画,所以用view
  1333. */
  1334. navTo(url) {
  1335. if (!this.hasLogin) {
  1336. url = '/pages/public/login';
  1337. }
  1338. uni.navigateTo({
  1339. url
  1340. })
  1341. },
  1342. mycarClick(carNo) {
  1343. this.modalName = null
  1344. uni.navigateTo({
  1345. url: `/pageB/car/mycar_detail?carNo=${carNo}`
  1346. })
  1347. },
  1348. scanCode() {
  1349. uni.scanCode({
  1350. success: function(res) {
  1351. uni.navigateTo({
  1352. url: res.result
  1353. })
  1354. }
  1355. })
  1356. },
  1357. hideModal(e) {
  1358. this.modalName = null
  1359. },
  1360. }
  1361. }
  1362. </script>
  1363. <style lang='scss' scoped>
  1364. page {
  1365. background: #F5F6FA;
  1366. }
  1367. .title_b {
  1368. margin: 20rpx 20rpx 0rpx 20rpx;
  1369. padding: 20rpx 10rpx 20rpx 10rpx;
  1370. font-size: 18px;
  1371. font-weight: 550;
  1372. }
  1373. .c-row {
  1374. display: -webkit-box;
  1375. display: -webkit-flex;
  1376. display: flex;
  1377. -webkit-box-align: center;
  1378. -webkit-align-items: center;
  1379. align-items: center;
  1380. padding: 20rpx 30rpx;
  1381. position: relative;
  1382. }
  1383. .con-list {
  1384. -webkit-box-flex: 1;
  1385. -webkit-flex: 1;
  1386. flex: 1;
  1387. display: -webkit-box;
  1388. display: -webkit-flex;
  1389. display: flex;
  1390. -webkit-box-orient: vertical;
  1391. -webkit-box-direction: normal;
  1392. -webkit-flex-direction: column;
  1393. flex-direction: column;
  1394. color: #303133;
  1395. line-height: 40rpx;
  1396. text-align: right;
  1397. padding-right: 20rpx;
  1398. }
  1399. .wrap {
  1400. padding-bottom: 10px;
  1401. font-size: 14px;
  1402. background: #fff;
  1403. margin: 10px;
  1404. border-radius: 10px;
  1405. input {
  1406. font-size: 14px;
  1407. }
  1408. >.title {
  1409. padding: 10px 16px;
  1410. }
  1411. }
  1412. .footer {
  1413. background: #fff;
  1414. position: fixed;
  1415. bottom: 0;
  1416. width: 100%;
  1417. padding: 20px 10px;
  1418. z-index: 10;
  1419. .button {
  1420. background: #22C572;
  1421. width: 90%;
  1422. margin: 20rpx auto;
  1423. padding: 10px;
  1424. color: #fff;
  1425. text-align: center;
  1426. border-radius: 30px;
  1427. }
  1428. }
  1429. .buns_item {
  1430. display: flex;
  1431. padding: 80rpx 0 50rpx 0;
  1432. justify-content: space-around;
  1433. }
  1434. .but_css {
  1435. background: #22C572;
  1436. width: 40%;
  1437. padding: 20rpx;
  1438. color: #fff;
  1439. text-align: center;
  1440. border-radius: 20rpx;
  1441. }
  1442. /deep/.u-radio-group {
  1443. flex-direction: row-reverse;
  1444. }
  1445. </style>