add_quality_testing.vue 46 KB

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