add_quality_testing.vue 52 KB

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