add_quality_testing.vue 56 KB

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