add_quality_testing.vue 68 KB

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