add_quality_testing.vue 46 KB

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