add_quality_testing.vue 51 KB

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