add_quality_testing.vue 52 KB

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