add_quality_testing.vue 52 KB

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