add_quality_testing.vue 47 KB

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