add_quality_testing.vue 48 KB

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