add_quality_testing.vue 47 KB

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