add_quality_testing.vue 56 KB

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