add_quality_testing.vue 68 KB

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