add_quality_testing.vue 71 KB

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