add_quality_testing.vue 68 KB

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