warehouseManagementPerfectput.vue 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661
  1. // 完善入库信息
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="20">
  6. <h2 class="bg-left title">完善入库登记</h2>
  7. </el-col>
  8. <el-col :span="4" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="revert()"
  14. ><img
  15. width="6"
  16. height="10"
  17. style="vertical-align: bottom; margin-right: 3px"
  18. src="../../../public/img/lujing.png"
  19. alt=""
  20. />返回</el-button
  21. >
  22. </el-col>
  23. </el-row>
  24. <ws-form ref="dataList" :model="dataList" :rules="rules">
  25. <div class="basicInformation">
  26. <h2>
  27. {{ deptBudgetList1.warehouseName }}
  28. <span class="position" v-show="this.$route.query.warehouseType == 1">
  29. {{ deptBudgetList1.binNumber }}仓位
  30. </span>
  31. <span v-show="this.$route.query.warehouseType == 2">(临)</span>
  32. </h2>
  33. <div class="small-title">基本信息</div>
  34. <ws-info-table>
  35. <ws-form-item label="合同编号" span="1" prop="contractNo">
  36. <el-select
  37. filterable
  38. :filter-method="dataFilter1"
  39. v-model="dataList.contractNo"
  40. placeholder="请选择合同编号或移库任务编号"
  41. class="typeselect"
  42. @change='contractNoChange'
  43. >
  44. <el-option
  45. v-for="item in options1"
  46. :key="item.constKey"
  47. :label="item.contractNo"
  48. :value="item.contractNo"
  49. />
  50. </el-select>
  51. </ws-form-item>
  52. <!-- 货名 -->
  53. <ws-form-item label="货名" span="1">
  54. <ws-select
  55. disabled
  56. v-model="dataList.goodsName"
  57. placeholder
  58. class="typeselect"
  59. @change="selectgoodsName"
  60. >
  61. <ws-option
  62. v-for="item in goodnameList"
  63. :key="item.constKey"
  64. :label="item.constValue"
  65. :value="item.constValue"
  66. />
  67. </ws-select>
  68. </ws-form-item>
  69. <ws-form-item label="类型" span="1" prop="type">
  70. <ws-select disabled v-model="dataList.type" @change="typeChange">
  71. <ws-option v-for="item in typeList" :key="item" :label="item" :value="item" />
  72. </ws-select>
  73. </ws-form-item>
  74. <!--毛重(吨)-->
  75. <ws-form-item label="毛重(吨)" span="1" prop="grossWeight">
  76. <ws-input
  77. @input="grossWeightchange"
  78. v-model="dataList.grossWeight"
  79. placeholder="请输入毛重"
  80. maxlength="20"
  81. size="small"
  82. />
  83. </ws-form-item>
  84. <!--皮重(吨)-->
  85. <ws-form-item label="皮重(吨)" span="1" prop="tare" class="readonly">
  86. <ws-input
  87. @input="tarechange"
  88. v-model="dataList.tare"
  89. placeholder="请输入皮重"
  90. maxlength="100"
  91. size="small"
  92. />
  93. </ws-form-item>
  94. <ws-form-item label="扣重(吨)" span="1" prop="deductionWeight" class="readonly">
  95. <ws-input
  96. @input="tarechange"
  97. v-model="dataList.deductionWeight"
  98. placeholder="请输入扣重"
  99. maxlength="100"
  100. size="small"
  101. />
  102. </ws-form-item>
  103. <!--净重(吨)-->
  104. <ws-form-item label="净重(吨)" span="1" prop="netWeight">
  105. <ws-input
  106. readonly="readonly"
  107. v-model="dataList.netWeight"
  108. placeholder="不可编辑,自动计算"
  109. maxlength="120"
  110. size="small"
  111. />
  112. </ws-form-item>
  113. <ws-form-item v-if='dataList.type=="潮粮"' label="扣重比" span="1" prop="buckleWeightRatio" class="readonly">
  114. <ws-input
  115. @input='pureweight'
  116. v-model="dataList.buckleWeightRatio"
  117. placeholder="请输入扣重比"
  118. maxlength="100"
  119. size="small"
  120. />
  121. </ws-form-item>
  122. <ws-form-item v-if='dataList.type=="潮粮"' label="干粮水分占比" span="1" prop="solidGrainWater" class="readonly">
  123. <ws-input
  124. @input='pureweight'
  125. v-model="dataList.solidGrainWater"
  126. placeholder="请输入干粮水分占比"
  127. maxlength="100"
  128. size="small"
  129. />
  130. </ws-form-item>
  131. <ws-form-item v-if='dataList.type=="潮粮"' label="潮粮水分占比" span="1" prop="tidalGrainWater" class="readonly">
  132. <ws-input
  133. @input='pureweight'
  134. v-model="dataList.tidalGrainWater"
  135. placeholder="请输入潮粮水分占比"
  136. maxlength="100"
  137. size="small"
  138. />
  139. </ws-form-item>
  140. <ws-form-item v-if='dataList.type=="潮粮"' label="纯重" span="1" prop="pureWeight" class="readonly">
  141. <ws-input
  142. disabled
  143. v-model="dataList.pureWeight"
  144. placeholder="不可编辑,自动计算"
  145. maxlength="100"
  146. size="small"
  147. />
  148. </ws-form-item>
  149. <!--净重(吨)-->
  150. <ws-form-item label="扣款(元/吨)" span="1" prop="deductionAmount">
  151. <ws-input
  152. @input="kkInput(dataList.deductionAmount)"
  153. v-model="dataList.deductionAmount"
  154. placeholder="请输入扣款金额"
  155. maxlength="120"
  156. size="small"
  157. />
  158. </ws-form-item>
  159. <!-- 品级 -->
  160. <ws-form-item label="品级" span="1" class="readonly">
  161. <ws-select
  162. v-model="dataList.grade"
  163. placeholder
  164. class="typeselect"
  165. @change="selectpackingMethod"
  166. >
  167. <ws-option
  168. v-for="item in gradeList"
  169. :key="item.constKey"
  170. :label="item.constValue"
  171. :value="item.constValue"
  172. />
  173. </ws-select>
  174. </ws-form-item>
  175. <!--经办人-->
  176. <ws-form-item label="经办人" span="1" prop="agent">
  177. <el-select
  178. v-model="dataList.agent"
  179. placeholder="请选择经办人"
  180. filterable
  181. clearable
  182. @change="selectstaff"
  183. >
  184. <el-option
  185. v-for="item in options"
  186. :key="item.value"
  187. :label="item.staffName"
  188. :value="item.staffName"
  189. />
  190. </el-select>
  191. </ws-form-item>
  192. <!--出库日期-->
  193. <ws-form-item label="入库日期" span="1" prop="inOutDate" class="deliverydate">
  194. <el-date-picker
  195. v-model="dataList.inOutDate"
  196. placeholder="请选择入库日期"
  197. type="date"
  198. value-format="yyyy-MM-dd"
  199. ></el-date-picker>
  200. </ws-form-item>
  201. <!-- 入库类型 -->
  202. <ws-form-item label="入库类型" span="1">
  203. <ws-select
  204. v-model="dataList.inOutType"
  205. placeholder
  206. class="typeselect"
  207. @change="selectstorageType"
  208. :disabled="isSelectType"
  209. >
  210. <ws-option
  211. v-for="item in storageType"
  212. :key="item.constKey"
  213. :label="item.constValue"
  214. :value="item.constValue"
  215. />
  216. </ws-select>
  217. </ws-form-item>
  218. <!--车牌号 -->
  219. <ws-form-item label="车牌号" span="1" prop="carNo">
  220. <ws-input
  221. v-if='!carstatus'
  222. v-model="dataList.carNo"
  223. placeholder="请输入车牌号"
  224. maxlength="7"
  225. size="small"
  226. />
  227. <el-select
  228. v-if='carstatus'
  229. filterable
  230. :filter-method="dataFilter2"
  231. v-model="dataList.carNo"
  232. placeholder="请选择车牌号"
  233. class="typeselect"
  234. @change='carChange'
  235. >
  236. <el-option
  237. v-for="item in options2"
  238. :key="item.constKey"
  239. :label="item.carNo+'('+item.tranCarNo+')'"
  240. :value="item.carNo"
  241. />
  242. </el-select>
  243. </ws-form-item>
  244. <ws-form-item label="箱号-1" span="1" prop="boxNo">
  245. <ws-input v-model="dataList.boxNo" placeholder="请输入箱号" maxlength="20"
  246. size="small" />
  247. </ws-form-item>
  248. <ws-form-item label="箱号-2" span="1" prop="boxNoOther">
  249. <ws-input v-model="dataList.boxNoOther" placeholder="请输入箱号" maxlength="20"
  250. size="small" />
  251. </ws-form-item>
  252. <ws-form-item label="封号-1" span="1" prop="titleNo">
  253. <ws-input v-model="dataList.titleNo" placeholder="请输入封号" maxlength="20"
  254. size="small" />
  255. </ws-form-item>
  256. <ws-form-item label="封号-2" span="1" prop="titleNoOther">
  257. <ws-input v-model="dataList.titleNoOther" placeholder="请输入封号" maxlength="20"
  258. size="small" />
  259. </ws-form-item>
  260. <ws-form-item label="成本" span="1" prop="cost">
  261. <ws-input
  262. :disabled='disabled1'
  263. v-model="dataList.cost"
  264. placeholder="请输入成本"
  265. size="small"
  266. />
  267. <img
  268. width="17"
  269. height="18"
  270. style="vertical-align: text-top; position: relative; top: -1px"
  271. src="../../../public/img/edit.png"
  272. @click="editClick(1)"
  273. alt=""
  274. />
  275. </ws-form-item>
  276. <ws-form-item label="运费" span="1" prop="freight">
  277. <ws-input
  278. :disabled='disabled2'
  279. v-model="dataList.freight"
  280. placeholder="请输入运费"
  281. size="small"
  282. />
  283. <img
  284. width="17"
  285. height="18"
  286. style="vertical-align: text-top; position: relative; top: -1px"
  287. src="../../../public/img/edit.png"
  288. @click="editClick(2)"
  289. alt=""
  290. />
  291. </ws-form-item>
  292. </ws-info-table>
  293. <div v-show="this.$route.query.warehouseType == 2 && this.$route.query.createType == 2">
  294. <el-checkbox v-model="checked" checked>退库并出库</el-checkbox>
  295. <ws-info-table v-show="checked == true">
  296. <!-- 出库类型 -->
  297. <ws-form-item label="出库类型" span="1">
  298. <ws-select
  299. v-model="dataList.temporaryOutType"
  300. placeholder=""
  301. class="typeselect"
  302. >
  303. <ws-option
  304. v-for="item in deliveryType"
  305. :key="item.constKey"
  306. :label="item.constValue"
  307. :value="item.constValue"
  308. />
  309. </ws-select>
  310. </ws-form-item>
  311. <!-- 出库合同编号 -->
  312. <ws-form-item label="出库合同编号" span="1">
  313. <ws-select
  314. v-model="dataList.contractNo"
  315. placeholder="请选择合同编号或移库任务编号"
  316. class="typeselect"
  317. >
  318. <ws-option
  319. v-for="item in outContractNo"
  320. :key="item.constKey"
  321. :label="item.contractNo"
  322. :value="item.contractNo"
  323. />
  324. </ws-select>
  325. </ws-form-item>
  326. </ws-info-table>
  327. </div>
  328. </div>
  329. <div class="small-title">上传磅单照片</div>
  330. <el-upload
  331. action="https://www.zthymaoyi.com/upload/admin"
  332. :show-file-list="false"
  333. :on-success="
  334. (res) => {
  335. uploadSuccessHandle1(res)
  336. }
  337. "
  338. class="avatar-uploader"
  339. accept=".jpg, .jpeg, .png, .gif"
  340. ><el-button size="small" type="primary">点击上传</el-button>
  341. </el-upload>
  342. <div @click='imgBig(dataList.addressUrl)'>
  343. <img v-if='dataList.addressUrl' style='width:100px;height:100px;' :src="dataList.addressUrl" alt="">
  344. </div>
  345. <div class="small-title">化验数据(选填)</div>
  346. <div class="inspector">
  347. <!--质检员-->
  348. <!-- <ws-form-item label="质检员" span="1" prop="qualityInspector">
  349. <ws-input
  350. v-model="dataList.warehouseInOutDetail.qualityInspector"
  351. placeholder="请输入质检员姓名"
  352. maxlength="120"
  353. size="small"
  354. />
  355. </ws-form-item> -->
  356. <ws-form-item label="质检员" span="1" prop="qualityInspector">
  357. <el-select
  358. v-model="dataList.warehouseInOutDetail.qualityInspector"
  359. placeholder="请选择质检员"
  360. filterable
  361. clearable
  362. @change="qualityInspectorChange"
  363. >
  364. <el-option
  365. v-for="item in qualityInspectorList"
  366. :key="item.value"
  367. :label="item.staffName"
  368. :value="item.staffName"
  369. />
  370. </el-select>
  371. </ws-form-item>
  372. </div>
  373. <div class="neifor">
  374. <ws-info-table>
  375. <!--水分(%)<=-->
  376. <ws-form-item label="水分(%)<=" span="1" prop="waterContent">
  377. <ws-input
  378. v-model="dataList.warehouseInOutDetail.waterContent"
  379. placeholder="请输入水分占比"
  380. maxlength="120"
  381. size="small"
  382. />
  383. </ws-form-item>
  384. <!--杂质(%)<=-->
  385. <ws-form-item label="杂质(%)<=" span="1" prop="impurity">
  386. <ws-input
  387. v-model="dataList.warehouseInOutDetail.impurity"
  388. placeholder="请输入杂质占比"
  389. maxlength="120"
  390. size="small"
  391. />
  392. </ws-form-item>
  393. <!--容重(克/升)>=-->
  394. <ws-form-item label="容重(克/升)>=" span="1" prop="bulkDensity">
  395. <ws-input
  396. v-model="dataList.warehouseInOutDetail.bulkDensity"
  397. placeholder="请输入容重"
  398. maxlength="120"
  399. size="small"
  400. />
  401. </ws-form-item>
  402. <!--霉变粒(%)<=-->
  403. <ws-form-item label="霉变粒(%)<=" span="1" prop="mildewGrain">
  404. <ws-input
  405. v-model="dataList.warehouseInOutDetail.mildewGrain"
  406. placeholder="请输入霉变粒占比"
  407. maxlength="120"
  408. size="small"
  409. />
  410. </ws-form-item>
  411. <!--热损伤(%)<=-->
  412. <ws-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
  413. <ws-input
  414. v-model="dataList.warehouseInOutDetail.jiaorenli"
  415. placeholder="请输入热损伤占比"
  416. maxlength="120"
  417. size="small"
  418. />
  419. </ws-form-item>
  420. <!--不完善粒(%)<=-->
  421. <ws-form-item label="不完善粒(%)<=" span="1" prop="imperfectGrain">
  422. <ws-input
  423. v-model="dataList.warehouseInOutDetail.imperfectGrain"
  424. placeholder="请输入不完善粒占比"
  425. maxlength="120"
  426. size="small"
  427. />
  428. </ws-form-item>
  429. </ws-info-table>
  430. </div>
  431. <div style="text-align: right; padding: 10px">
  432. <el-button
  433. class="bg-bottom-up"
  434. type="primary"
  435. size="small"
  436. @click="temporaryStorage()"
  437. >暂存</el-button
  438. >
  439. <el-button
  440. class="bg-bottom-up"
  441. type="primary"
  442. size="small"
  443. @click="submit()"
  444. >提交</el-button
  445. >
  446. </div>
  447. </ws-form>
  448. <div @click='imgshow=false' style='overflow:scroll;position:fixed;left:0;top:0;background:rgba(0,0,0,0.1);width:100%;height:100%;z-index:1030;' v-if='imgshow'>
  449. <img style='position:absolute;left:50%;top:50%;transform: translateX(-50%) translateY(-50%);height:80%;' :src="img" alt="">
  450. </div>
  451. </div>
  452. </template>
  453. <script>
  454. import {
  455. pullDown,
  456. addstorageputList,
  457. xialaNo,
  458. getstaff,
  459. } from '@/model/warehouse/index'
  460. import { downloadFile } from '@/utils/batchDown'
  461. import Pagination from '@/components/Pagination'
  462. import { mapActions, mapGetters, mapState } from 'vuex'
  463. import WsUpload from '@/components/WsUpload'
  464. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  465. import { dayjs, EventBus } from 'base-core-lib'
  466. export default {
  467. name: 'viewSpareMoney',
  468. components: {
  469. WsUpload,
  470. Pagination,
  471. },
  472. watch: {
  473. // vesselId(val) {
  474. // this.getList()
  475. // },
  476. isShow(val) {
  477. this.showType = val
  478. },
  479. },
  480. computed: {
  481. ...mapGetters(['dataList']),
  482. },
  483. data() {
  484. return {
  485. isSelectType:true,
  486. isGetCost:false,
  487. qualityInspectorList:[],
  488. //弹出框
  489. dialogViewSpareMoney: false,
  490. dialogApproveFormVisible: false,
  491. // 船舶类型
  492. monetaryKey: null,
  493. // 表格显示数据
  494. tableDate: [],
  495. // 是否显示
  496. showType: true,
  497. // 年
  498. year: '',
  499. deptBudgetTotal: 0,
  500. readonly: true,
  501. currentPage: 1,
  502. pageSize: 10,
  503. searchType: 1,
  504. searchKeyWord: '',
  505. contractType: 2,
  506. startDate: null,
  507. endDate: null,
  508. goodnameList: {},
  509. checked: true,
  510. disabled1:true,
  511. disabled2:true,
  512. staffList: [],
  513. options: [],
  514. storageType: [],
  515. deliveryType: [],
  516. outContractNo: [],
  517. outContractNo1: [],
  518. // 提交类型
  519. submitType: true,
  520. typeList:['干粮','潮粮'],
  521. appendixIdsAdd: '',
  522. uploadSuccess: {},
  523. warehouseInOutDetail: {},
  524. onChange: {},
  525. deptBudgetList1: [],
  526. gradeList: [],
  527. rules: {
  528. netWeight: [
  529. {
  530. required: true,
  531. type: 'number',
  532. message: '请输入活动名称',
  533. trigger: 'blur',
  534. },
  535. ],
  536. },
  537. size: 10,
  538. compId: localStorage.getItem('ws-pf_compId'),
  539. deptCircularPage: {},
  540. packtypeList: {},
  541. date: {
  542. year: dayjs().format('YYYY'),
  543. month: dayjs().format('MM'),
  544. },
  545. options1: [],
  546. options2: [],
  547. carstatus:false,
  548. contractList: [],
  549. img:'',
  550. imgshow:false,
  551. dataList: {
  552. id: '',
  553. grossWeight: '',
  554. contractNo: '',
  555. tare: '',
  556. netWeight: '',
  557. grade: '',
  558. agent: '',
  559. carNo: '',
  560. inOutDate: '',
  561. inOutType: '',
  562. goodsName: '',
  563. warehouseInOutDetail: {},
  564. cost:'',
  565. freight:0,
  566. type:'',
  567. buckleWeightRatio:'',
  568. tidalGrainWater:'',
  569. solidGrainWater:'',
  570. pureWeight:'',
  571. deductionAmount:'',
  572. deductionWeigh:'',
  573. },
  574. historyList: [],
  575. pickerBeginDateBefore: {
  576. disabledDate: (time) => {
  577. return time.getTime() > Date.now()
  578. },
  579. },
  580. accessoryTFs: false,
  581. }
  582. },
  583. activated() {
  584. this.deptBudgetList1.warehouseName = this.$route.query.warehouseName
  585. this.deptBudgetList1.binNumber = this.$route.query.binNumber
  586. this.getList()
  587. this.dataList.id = this.$route.query.id
  588. this.dataList.grossWeight = this.$route.query.grossWeight
  589. this.dataList.contractNo = this.$route.query.contractNo
  590. this.dataList.baseId = this.$route.query.baseId
  591. this.dataList.positionId = this.$route.query.positionId
  592. this.dataList.warehouseName = this.$route.query.warehouseName
  593. this.dataList.binNumber = this.$route.query.binNumber
  594. this.dataList.tare = this.$route.query.tare
  595. this.dataList.netWeight = this.$route.query.netWeight
  596. this.dataList.grade = this.$route.query.grade
  597. this.dataList.agent = this.$route.query.agent
  598. this.dataList.carNo = this.$route.query.carNo
  599. this.dataList.inOutDate = this.$route.query.inOutDate
  600. this.dataList.contractNo = this.$route.query.contractNo
  601. this.dataList.inOutType = this.$route.query.inOutType
  602. this.dataList.compId = this.$route.query.compId
  603. this.dataList.goodsName = this.$route.query.goodsName
  604. this.dataList.goodsNameKey = Number(this.$route.query.goodsNameKey)
  605. this.dataList.inOutFlag = this.$route.inOutFlag
  606. this.dataList.inOutTypeKey = Number(this.$route.query.inOutTypeKey)
  607. this.dataList.statusFlag = this.$route.statusFlag
  608. this.dataList.warehouseInOutDetail = this.$route.query.warehouseInOutDetail
  609. this.dataList.warehouseType = this.$route.query.warehouseType
  610. this.dataList.createType = this.$route.query.createType
  611. this.dataList.temporaryOutType = this.$route.query.temporaryOutType
  612. this.dataList.cost=this.$route.query.cost
  613. this.dataList.freight=this.$route.query.freight
  614. this.dataList.type=this.$route.query.type
  615. this.dataList.buckleWeightRatio=this.$route.query.buckleWeightRatio
  616. this.dataList.tidalGrainWater=this.$route.query.tidalGrainWater
  617. this.dataList.solidGrainWater=this.$route.query.solidGrainWater
  618. this.dataList.pureWeight=this.$route.query.pureWeight
  619. this.dataList.deductionAmount=this.$route.query.deductionAmount
  620. this.dataList.deductionWeight=this.$route.query.deductionWeight
  621. this.dataList.inOutTypeFlag=1
  622. if(this.dataList.cost){
  623. this.isGetCost = true
  624. this.cost = this.dataList.cost
  625. }
  626. },
  627. methods: {
  628. imgBig(item){
  629. console.log(item)
  630. this.img=item
  631. this.imgshow=true
  632. },
  633. kkInput(val){
  634. console.log(val)
  635. if(this.isGetCost){
  636. if(this.dataList.cost>val){
  637. this.dataList.cost = this.cost - this.dataList.deductionAmount
  638. }
  639. }
  640. },
  641. qualityInspectorChange(e){
  642. console.log(e)
  643. },
  644. uploadSuccessHandle1(res){
  645. this.dataList.addressUrl=res.url
  646. },
  647. pureweight(status){
  648. console.log(this.dataList)
  649. if(this.dataList.netWeight&&this.dataList.tidalGrainWater&&this.dataList.solidGrainWater&&this.dataList.buckleWeightRatio){
  650. this.dataList.pureWeight=(this.dataList.netWeight*(100-(this.dataList.tidalGrainWater-this.dataList.solidGrainWater)*this.dataList.buckleWeightRatio))/100
  651. }
  652. },
  653. //返回按钮
  654. revert() {
  655. this.$router.go(-1)
  656. },
  657. carChange(e){
  658. for (let i = 0; i < this.tranCarInfoList.length; i++) {
  659. if(this.tranCarInfoList[i].carNo==this.dataList.carNo){
  660. this.dataList.tranCarNo=this.tranCarInfoList[i].tranCarNo
  661. this.dataList.freight=this.tranCarInfoList[i].tranPrice
  662. }
  663. }
  664. },
  665. typeChange(e){
  666. },
  667. contractNoChange(e){
  668. for (var i = 0; i < this.outContractNo.length; i++) {
  669. if (this.outContractNo[i].contractNo == e) {
  670. if (this.outContractNo[i].inOutType == '采购入库') {
  671. this.dataList.inOutTypeKey = 1
  672. } else if (this.outContractNo[i].inOutType == '移库入库') {
  673. this.dataList.inOutTypeKey = 3
  674. } else if (this.outContractNo[i].inOutType == '暂存入库') {
  675. this.dataList.inOutTypeKey = 4
  676. } else if (this.outContractNo[i].inOutType == '贸易服务入库') {
  677. this.dataList.inOutTypeKey = 5
  678. } else if (this.detailData.inOutType == '退库') {
  679. this.dataList.inOutTypeKey = 6
  680. }
  681. this.dataList.goodsName = this.outContractNo[i].goodsName
  682. this.dataList.goodsNameKey = this.outContractNo[i].goodsNameKey
  683. this.cost = this.outContractNo[i].contractPrice
  684. if(this.cost){
  685. this.isGetCost = true
  686. this.dataList.cost = this.cost - this.dataList.deductionAmount
  687. }else{
  688. this.isGetCost = false
  689. this.dataList.cost = this.dataList.cost
  690. }
  691. this.dataList.inOutType = this.outContractNo[i].inOutType
  692. if(this.outContractNo[i].inOutType=='移库入库'){
  693. this.isSelectType = false
  694. }else{
  695. this.isSelectType = true
  696. }
  697. if(this.outContractNo[i].tranCarInfoList){
  698. this.options2=this.outContractNo[i].tranCarInfoList
  699. this.tranCarInfoList=this.outContractNo[i].tranCarInfoList
  700. this.carstatus=true
  701. }
  702. }
  703. }
  704. },
  705. dataFilter1(val) {
  706. console.log(val)
  707. this.dataList.contractNo = val;
  708. if (val) { //val存在
  709. this.options1 = this.outContractNo1.filter((item) => {
  710. if (!!~item.contractNo.indexOf(val) || !!~item.contractNo.toUpperCase().indexOf(val.toUpperCase())) {
  711. return true
  712. }
  713. })
  714. } else { //val为空时,还原数组
  715. this.options1 = this.outContractNo;
  716. }
  717. },
  718. dataFilter2(val) {
  719. this.dataList.carNo = val;
  720. if (val) { //val存在
  721. this.options1 = this.outContractNo1.filter((item) => {
  722. if (!!~item.carNo.indexOf(val) || !!~item.carNo.toUpperCase().indexOf(val.toUpperCase())) {
  723. return true
  724. }
  725. })
  726. } else { //val为空时,还原数组
  727. this.options2 = this.tranCarInfoList;
  728. }
  729. },
  730. dataFilter(val) {
  731. // console.log(val,"名")
  732. this.dataList.staffList = val
  733. if (val) {
  734. //val存在
  735. this.options = this.staffList.filter((item) => {
  736. if (
  737. !!~item.staffName.indexOf(val) ||
  738. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  739. ) {
  740. return true
  741. }
  742. })
  743. } else {
  744. //val为空时,还原数组
  745. this.options = this.staffList
  746. }
  747. },
  748. editClick(status){
  749. this.isGetCost = false
  750. if(status==1){
  751. this.disabled1=!this.disabled1
  752. }else{
  753. this.disabled2=!this.disabled2
  754. }
  755. },
  756. selectstaff(e) {
  757. for (var i = 0; i < this.staffList.length; i++) {
  758. if (this.staffList[i].staffName == e) {
  759. this.dataList.personChargeKey = this.staffList[i].staffId
  760. }
  761. }
  762. },
  763. //暂存按钮
  764. temporaryStorage() {
  765. this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
  766. cancelButtonText: '取消',
  767. confirmButtonText: '确定',
  768. type: 'warning',
  769. })
  770. .then(() => {
  771. this.$refs.dataList.validate((valid) => {
  772. if (valid) {
  773. this.dataList.compId = localStorage.getItem('ws-pf_compId')
  774. this.dataList.inOutFlag = 2
  775. this.dataList.statusFlag = 1
  776. let _data = JSON.parse(localStorage.getItem('winseaview-userInfo'))
  777. this.dataList.backOffice = _data.content.showCompName+'-' +_data.content.staffName
  778. addstorageputList(this.dataList)
  779. .toPromise()
  780. .then((response) => {
  781. this.$message.success('暂存成功')
  782. this.$router.push({ path: 'warehouseManagementList' })
  783. })
  784. } else {
  785. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  786. return false
  787. }
  788. })
  789. })
  790. .catch(() => {
  791. return false
  792. })
  793. },
  794. //提交按钮
  795. submit() {
  796. if (!this.dataList.goodsName) {
  797. this.$message({
  798. message: '货名不能为空',
  799. type: 'warning',
  800. })
  801. return
  802. }
  803. if (!this.dataList.grossWeight) {
  804. this.$message({
  805. message: '毛重不能为空',
  806. type: 'warning',
  807. })
  808. return
  809. }
  810. if (
  811. this.dataList.grossWeight <= 0 ||
  812. this.dataList.grossWeight > 10000 ||
  813. (String(this.dataList.grossWeight).indexOf('.') != -1 &&
  814. String(this.dataList.grossWeight).length -
  815. (String(this.dataList.grossWeight).indexOf('.') + 1) >
  816. 3)
  817. ) {
  818. this.$message({
  819. message: '毛重输入错误',
  820. type: 'warning',
  821. })
  822. return
  823. }
  824. if (
  825. this.dataList.tare < 0 ||
  826. this.dataList.tare > 10000 ||
  827. (String(this.dataList.tare).indexOf('.') != -1 &&
  828. String(this.dataList.tare).length -
  829. (String(this.dataList.tare).indexOf('.') + 1) >
  830. 3)
  831. ) {
  832. this.$message({
  833. message: '皮重输入错误',
  834. type: 'warning',
  835. })
  836. return
  837. }
  838. if (!this.dataList.deductionWeight) {
  839. this.$message({
  840. message: '扣重不能为空',
  841. type: 'warning'
  842. })
  843. return
  844. }
  845. if (
  846. this.dataList.deductionWeight < 0 ||
  847. this.dataList.deductionWeight > 10 ||
  848. (String(this.dataList.deductionWeight).indexOf('.') != -1 &&
  849. String(this.dataList.deductionWeight).length -
  850. (String(this.dataList.deductionWeight).indexOf('.') + 1) >
  851. 3)
  852. ) {
  853. this.$message({
  854. message: '扣重输入错误',
  855. type: 'warning'
  856. })
  857. return
  858. }
  859. if (this.dataList.type=='潮粮'&&!this.dataList.buckleWeightRatio) {
  860. this.$message({
  861. message: '扣重比不能为空',
  862. type: 'warning'
  863. })
  864. return
  865. }
  866. if (
  867. this.dataList.type=='潮粮'&&this.dataList.buckleWeightRatio < 0 ||
  868. this.dataList.type=='潮粮'&&this.dataList.buckleWeightRatio > 3 ||
  869. (this.dataList.type=='潮粮'&&String(this.dataList.buckleWeightRatio).indexOf('.') != -1 &&
  870. String(this.dataList.buckleWeightRatio).length -
  871. (String(this.dataList.buckleWeightRatio).indexOf('.') + 1) >
  872. 2)
  873. ) {
  874. this.$message({
  875. message: '扣重比输入错误',
  876. type: 'warning'
  877. })
  878. return
  879. }
  880. if (this.dataList.type=='潮粮'&&!this.dataList.tidalGrainWater) {
  881. this.$message({
  882. message: '潮粮水分不能为空',
  883. type: 'warning'
  884. })
  885. return
  886. }
  887. if (
  888. this.dataList.type=='潮粮'&&this.dataList.tidalGrainWater < 1 ||
  889. this.dataList.type=='潮粮'&&this.dataList.tidalGrainWater > 40 ||
  890. (this.dataList.type=='潮粮'&&String(this.dataList.tidalGrainWater).indexOf('.') != -1 &&
  891. String(this.dataList.tidalGrainWater).length -
  892. (String(this.dataList.tidalGrainWater).indexOf('.') + 1) >
  893. 2)
  894. ) {
  895. this.$message({
  896. message: '潮粮水分输入错误',
  897. type: 'warning'
  898. })
  899. return
  900. }
  901. if (this.dataList.type=='潮粮'&&!this.dataList.solidGrainWater) {
  902. this.$message({
  903. message: '干粮水分不能为空',
  904. type: 'warning'
  905. })
  906. return
  907. }
  908. if (
  909. this.dataList.type=='潮粮'&&this.dataList.solidGrainWater < 1 ||
  910. this.dataList.type=='潮粮'&&this.dataList.solidGrainWater > 40 ||
  911. (this.dataList.type=='潮粮'&&String(this.dataList.solidGrainWater).indexOf('.') != -1 &&
  912. String(this.dataList.solidGrainWater).length -
  913. (String(this.dataList.solidGrainWater).indexOf('.') + 1) >
  914. 1)
  915. ) {
  916. this.$message({
  917. message: '干粮水分输入错误',
  918. type: 'warning'
  919. })
  920. return
  921. }
  922. if (!this.dataList.deductionAmount) {
  923. this.$message({
  924. message: '扣款不能为空',
  925. type: 'warning'
  926. })
  927. return
  928. }
  929. if (
  930. this.dataList.deductionAmount < 0 ||
  931. this.dataList.deductionAmount > 10000 ||
  932. (String(this.dataList.deductionAmount).indexOf('.') != -1 &&
  933. String(this.dataList.deductionAmount).length -
  934. (String(this.dataList.deductionAmount).indexOf('.') + 1) >
  935. 2)
  936. ) {
  937. this.$message({
  938. message: '扣款输入错误',
  939. type: 'warning'
  940. })
  941. return
  942. }
  943. if (!this.dataList.cost) {
  944. this.$message({
  945. message: '未获取到成本,请编辑后提交',
  946. type: 'warning'
  947. })
  948. return
  949. }
  950. if (
  951. this.dataList.cost < 0 ||
  952. this.dataList.cost > 20000 ||
  953. (String(this.dataList.cost).indexOf('.') != -1 &&
  954. String(this.dataList.cost).length -
  955. (String(this.dataList.cost).indexOf('.') + 1) >
  956. 2)
  957. ) {
  958. this.$message({
  959. message: '成本输入错误',
  960. type: 'warning'
  961. })
  962. return
  963. }
  964. if (!this.dataList.freight&&this.dataList.freight!=0) {
  965. this.$message({
  966. message: '运费不能为空',
  967. type: 'warning'
  968. })
  969. return
  970. }
  971. if (
  972. this.dataList.freight < 0 ||
  973. this.dataList.freight > 100000 ||
  974. (String(this.dataList.freight).indexOf('.') != -1 &&
  975. String(this.dataList.freight).length -
  976. (String(this.dataList.freight).indexOf('.') + 1) >
  977. 2)
  978. ) {
  979. this.$message({
  980. message: '运费输入错误',
  981. type: 'warning'
  982. })
  983. return
  984. }
  985. if (!this.dataList.agent) {
  986. this.$message({
  987. message: '经办人不能为空',
  988. type: 'warning',
  989. })
  990. return
  991. }
  992. if (this.dataList.agent.length < 2 || this.dataList.agent.length > 10) {
  993. this.$message({
  994. message: '经办人输入有误',
  995. type: 'warning',
  996. })
  997. return
  998. }
  999. if (!this.dataList.grade) {
  1000. this.$message({
  1001. message: '品级不能为空!',
  1002. type: 'warning',
  1003. })
  1004. return
  1005. }
  1006. if (!this.dataList.inOutDate) {
  1007. this.$message({
  1008. message: '入库日期不能为空!',
  1009. type: 'warning',
  1010. })
  1011. return
  1012. }
  1013. if (!this.dataList.inOutType) {
  1014. this.$message({
  1015. message: '入库类型不能为空!',
  1016. type: 'warning',
  1017. })
  1018. return
  1019. }
  1020. if (!this.dataList.carNo) {
  1021. this.$message({
  1022. message: '车牌号不能为空',
  1023. type: 'warning',
  1024. })
  1025. return
  1026. }
  1027. if (this.dataList.carNo.length > 7) {
  1028. this.$message({
  1029. message: '车牌号输入错误,请输入7个字符之内',
  1030. type: 'warning',
  1031. })
  1032. return
  1033. }
  1034. if (this.dataList.boxNo&&this.dataList.boxNo.length > 20) {
  1035. this.$message({
  1036. message: '箱号-1输入错误',
  1037. type: 'warning',
  1038. })
  1039. return
  1040. }
  1041. if (this.dataList.boxNoOther&&this.dataList.boxNoOther.length > 20) {
  1042. this.$message({
  1043. message: '箱号-2输入错误',
  1044. type: 'warning',
  1045. })
  1046. return
  1047. }
  1048. if (this.dataList.titleNo&&this.dataList.titleNo.length > 20) {
  1049. this.$message({
  1050. message: '封号-1输入错误',
  1051. type: 'warning',
  1052. })
  1053. return
  1054. }
  1055. if (this.dataList.titleNoOther&&this.dataList.titleNoOther.length > 20) {
  1056. this.$message({
  1057. message: '封号-2输入错误',
  1058. type: 'warning',
  1059. })
  1060. return
  1061. }
  1062. if (!this.dataList.contractNo) {
  1063. this.$message({
  1064. message: '合同编号不能为空',
  1065. type: 'warning',
  1066. })
  1067. return
  1068. }
  1069. // if (
  1070. // this.dataList.contractNo.length < 6 ||
  1071. // this.dataList.contractNo.length > 20
  1072. // ) {
  1073. // this.$message({
  1074. // message: '合同编号长度不符合要求,请输入6-20个字符之内',
  1075. // type: 'warning',
  1076. // })
  1077. // return
  1078. // }
  1079. if (this.dataList.netWeight > this.$route.query.capacity) {
  1080. this.$message({
  1081. message: '入库量大于该仓库容量!',
  1082. type: 'warning',
  1083. })
  1084. return
  1085. }
  1086. //自检员
  1087. if (this.dataList.warehouseInOutDetail.qualityInspector) {
  1088. if (
  1089. this.dataList.warehouseInOutDetail.qualityInspector.length < 2 ||
  1090. this.dataList.warehouseInOutDetail.qualityInspector.length > 10
  1091. ) {
  1092. this.$message({
  1093. message: '质检员姓名长度错误!',
  1094. type: 'warning',
  1095. })
  1096. return
  1097. }
  1098. }
  1099. if (this.dataList.warehouseInOutDetail.waterContent) {
  1100. if (isNaN(this.dataList.warehouseInOutDetail.waterContent)) {
  1101. this.$message({
  1102. message: '水分(%)非数字!',
  1103. type: 'warning',
  1104. })
  1105. return
  1106. }
  1107. if (
  1108. this.dataList.warehouseInOutDetail.waterContent < 1 ||
  1109. this.dataList.warehouseInOutDetail.waterContent > 40 ||
  1110. (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
  1111. '.'
  1112. ) != -1 &&
  1113. String(this.dataList.warehouseInOutDetail.waterContent).length -
  1114. (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
  1115. '.'
  1116. ) +
  1117. 1) >
  1118. 2)
  1119. ) {
  1120. this.$message({
  1121. message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1122. type: 'warning',
  1123. })
  1124. return
  1125. }
  1126. }
  1127. //杂质
  1128. if (this.dataList.warehouseInOutDetail.impurity) {
  1129. if (isNaN(this.dataList.warehouseInOutDetail.impurity)) {
  1130. this.$message({
  1131. message: '杂质(%)非数字!',
  1132. type: 'warning',
  1133. })
  1134. return
  1135. }
  1136. if (
  1137. this.dataList.warehouseInOutDetail.impurity < 1 ||
  1138. this.dataList.warehouseInOutDetail.impurity > 40 ||
  1139. (String(this.dataList.warehouseInOutDetail.impurity).indexOf('.') !=
  1140. -1 &&
  1141. String(this.dataList.warehouseInOutDetail.impurity).length -
  1142. (String(this.dataList.warehouseInOutDetail.impurity).indexOf(
  1143. '.'
  1144. ) +
  1145. 1) >
  1146. 2)
  1147. ) {
  1148. this.$message({
  1149. message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1150. type: 'warning',
  1151. })
  1152. return
  1153. }
  1154. }
  1155. //霉变
  1156. if (this.dataList.warehouseInOutDetail.mildewGrain) {
  1157. if (isNaN(this.dataList.warehouseInOutDetail.mildewGrain)) {
  1158. this.$message({
  1159. message: '霉变粒(%)非数字!',
  1160. type: 'warning',
  1161. })
  1162. return
  1163. }
  1164. if (
  1165. this.dataList.warehouseInOutDetail.mildewGrain < 1 ||
  1166. this.dataList.warehouseInOutDetail.mildewGrain > 40 ||
  1167. (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
  1168. '.'
  1169. ) != -1 &&
  1170. String(this.dataList.warehouseInOutDetail.mildewGrain).length -
  1171. (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
  1172. '.'
  1173. ) +
  1174. 1) >
  1175. 2)
  1176. ) {
  1177. this.$message({
  1178. message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1179. type: 'warning',
  1180. })
  1181. return
  1182. }
  1183. }
  1184. //热损伤
  1185. if (this.dataList.warehouseInOutDetail.jiaorenli) {
  1186. if (isNaN(this.dataList.warehouseInOutDetail.jiaorenli)) {
  1187. this.$message({
  1188. message: '热损伤(%)非数字!',
  1189. type: 'warning',
  1190. })
  1191. return
  1192. }
  1193. if (
  1194. this.dataList.warehouseInOutDetail.jiaorenli < 1 ||
  1195. this.dataList.warehouseInOutDetail.jiaorenli > 40 ||
  1196. (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf('.') !=
  1197. -1 &&
  1198. String(this.dataList.warehouseInOutDetail.jiaorenli).length -
  1199. (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf(
  1200. '.'
  1201. ) +
  1202. 1) >
  1203. 2)
  1204. ) {
  1205. this.$message({
  1206. message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1207. type: 'warning',
  1208. })
  1209. return
  1210. }
  1211. }
  1212. //不完善粒(%)
  1213. if (this.dataList.warehouseInOutDetail.imperfectGrain) {
  1214. if (isNaN(this.dataList.warehouseInOutDetail.imperfectGrain)) {
  1215. this.$message({
  1216. message: '不完善粒(%)非数字!',
  1217. type: 'warning',
  1218. })
  1219. return
  1220. }
  1221. if (
  1222. this.dataList.warehouseInOutDetail.imperfectGrain < 1 ||
  1223. this.dataList.warehouseInOutDetail.imperfectGrain > 40 ||
  1224. (String(this.dataList.warehouseInOutDetail.imperfectGrain).indexOf(
  1225. '.'
  1226. ) != -1 &&
  1227. String(this.dataList.warehouseInOutDetail.imperfectGrain).length -
  1228. (String(
  1229. this.dataList.warehouseInOutDetail.imperfectGrain
  1230. ).indexOf('.') +
  1231. 1) >
  1232. 2)
  1233. ) {
  1234. this.$message({
  1235. message: '不完善粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1236. type: 'warning',
  1237. })
  1238. return
  1239. }
  1240. }
  1241. //容重
  1242. if (this.dataList.warehouseInOutDetail.bulkDensity) {
  1243. if (isNaN(this.dataList.warehouseInOutDetail.bulkDensity)) {
  1244. this.$message({
  1245. message: '容重(克/升)非数字!',
  1246. type: 'warning',
  1247. })
  1248. return
  1249. }
  1250. if (
  1251. this.dataList.warehouseInOutDetail.bulkDensity > 1000 ||
  1252. this.dataList.warehouseInOutDetail.bulkDensity < 0||
  1253. (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
  1254. '.'
  1255. ) != -1 &&
  1256. String(this.dataList.warehouseInOutDetail.bulkDensity).length -
  1257. (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
  1258. '.'
  1259. ) +
  1260. 1) >
  1261. 0)
  1262. ) {
  1263. this.$message({
  1264. message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
  1265. type: 'warning',
  1266. })
  1267. return
  1268. }
  1269. }
  1270. this.$confirm(`确定提交入库信息`, {
  1271. cancelButtonText: '取消',
  1272. confirmButtonText: '确定',
  1273. type: 'warning',
  1274. })
  1275. .then(() => {
  1276. this.$refs.dataList.validate((valid) => {
  1277. if (valid) {
  1278. this.dataList.compId = localStorage.getItem('ws-pf_compId')
  1279. this.dataList.inOutFlag = 2
  1280. this.dataList.statusFlag = 3
  1281. addstorageputList(this.dataList)
  1282. .toPromise()
  1283. .then((response) => {
  1284. this.$message.success('添加成功')
  1285. this.$router.push({ path: 'warehouseManagementList' })
  1286. })
  1287. } else {
  1288. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1289. return false
  1290. }
  1291. })
  1292. })
  1293. .catch(() => {
  1294. return false
  1295. })
  1296. },
  1297. //暂存按钮
  1298. returnWarehouse() {
  1299. this.$refs.dataList.validate((valid) => {
  1300. if (valid) {
  1301. this.dataList.compId = localStorage.getItem('ws-pf_compId')
  1302. this.dataList.statusFlag = 1
  1303. addstorageputList(this.dataList)
  1304. .toPromise()
  1305. .then((response) => {
  1306. this.$message.success('添加成功')
  1307. this.$router.push({ path: 'warehouseManagementList' })
  1308. })
  1309. } else {
  1310. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1311. return false
  1312. }
  1313. })
  1314. },
  1315. tarechange(e) {
  1316. if (this.dataList.grossWeight && this.dataList.tare) {
  1317. this.dataList.netWeight = Number(
  1318. this.dataList.grossWeight - this.dataList.tare
  1319. ).toFixed(2)
  1320. }
  1321. },
  1322. grossWeightchange(e) {
  1323. if (this.dataList.grossWeight && this.dataList.tare) {
  1324. this.dataList.netWeight = Number(
  1325. this.dataList.grossWeight - this.dataList.tare
  1326. ).toFixed(2)
  1327. }
  1328. },
  1329. selectgoodsName(e) {
  1330. for (var i = 0; i < this.goodnameList.length; i++) {
  1331. if (this.goodnameList[i].constValue == e) {
  1332. this.dataList.goodsNameKey = this.goodnameList[i].constKey
  1333. if(e=='玉米(潮粮)'){
  1334. this.dataList.type='潮粮'
  1335. }else{
  1336. this.dataList.type='干粮'
  1337. }
  1338. }
  1339. }
  1340. },
  1341. selectpackingMethod(e) {
  1342. for (var i = 0; i < this.packtypeList.length; i++) {
  1343. if (this.packtypeList[i].constValue == e) {
  1344. this.dataList.packingMethodKey = this.packtypeList[i].constKey
  1345. }
  1346. }
  1347. },
  1348. selectstorageType(e) {
  1349. for (var i = 0; i < this.storageType.length; i++) {
  1350. if (this.storageType[i].constValue == e) {
  1351. this.dataList.inOutTypeKey = this.storageType[i].constKey
  1352. }
  1353. }
  1354. },
  1355. handleClose() {
  1356. this.accessoryTFs = false
  1357. },
  1358. handleSizeChange(val) {
  1359. console.log(`每页 ${val} 条`)
  1360. this.pageSize = val
  1361. this.getList()
  1362. },
  1363. handleCurrentChange(val) {
  1364. this.currentPage = val
  1365. console.log(`当前页: ${val}`)
  1366. this.getList()
  1367. },
  1368. getList() {
  1369. // 货名
  1370. pullDown({ constId: 'CON2' })
  1371. .toPromise()
  1372. .then((response) => {
  1373. this.goodnameList = response
  1374. })
  1375. // 品级
  1376. pullDown({ constId: 'CON3' })
  1377. .toPromise()
  1378. .then((response) => {
  1379. this.gradeList = response
  1380. })
  1381. // 类型
  1382. if (this.$route.query.warehouseType == '1') {
  1383. this.storageType = []
  1384. pullDown({ constId: 'CON5' })
  1385. .toPromise()
  1386. .then((response) => {
  1387. // this.storageType = response
  1388. for(let i = 0;i<response.length;i++){
  1389. if(response[i].constValue=='移库入库'||response[i].constValue=='退库'){
  1390. this.storageType.push(response[i])
  1391. }
  1392. }
  1393. })
  1394. } else if (this.$route.query.warehouseType == '2') {
  1395. //临时仓库入库类型
  1396. pullDown({ constId: 'WARE1' })
  1397. .toPromise()
  1398. .then((response) => {
  1399. this.storageType = response
  1400. })
  1401. //临时仓库出库类型
  1402. pullDown({ constId: 'WARE2' })
  1403. .toPromise()
  1404. .then((response) => {
  1405. this.deliveryType = response
  1406. })
  1407. }
  1408. //合同编号
  1409. xialaNo({ compId: localStorage.getItem('ws-pf_compId'), flag: 6 })
  1410. .toPromise()
  1411. .then((response) => {
  1412. this.options1 = response
  1413. this.outContractNo = response
  1414. })
  1415. //合同编号2
  1416. xialaNo({ compId: localStorage.getItem('ws-pf_compId'), flag: 7 })
  1417. .toPromise()
  1418. .then((response) => {
  1419. this.outContractNo1 = response
  1420. })
  1421. //经办人
  1422. getstaff({ compId: localStorage.getItem('ws-pf_compId'),warehouseId:this.dataList.id })
  1423. .toPromise()
  1424. .then((response) => {
  1425. this.options = response
  1426. this.qualityInspectorList = response
  1427. this.staffList = response
  1428. // this.agent = response
  1429. })
  1430. },
  1431. selecttaskType(e) {
  1432. for (var i = 0; i < this.taskTypeList.length; i++) {
  1433. if (this.taskTypeList[i].value == e) {
  1434. this.searchType = this.taskTypeList[i].type
  1435. }
  1436. }
  1437. },
  1438. fujian(row) {
  1439. if (
  1440. row.receiveAttachmentPath === null ||
  1441. row.receiveAttachmentPath === ''
  1442. ) {
  1443. EventBus.$emit(
  1444. 'warning',
  1445. this.$t('system.noticeCircular.NoInformation')
  1446. )
  1447. } else {
  1448. this.accessoryTFs = true
  1449. }
  1450. this.appendixIdss = row.receiveAttachmentPath
  1451. },
  1452. handleExamine(row) {
  1453. this.$router.push({
  1454. name: 'salesContractExamine',
  1455. query: { id: row.id },
  1456. })
  1457. },
  1458. // 关闭 dialog时 处理文件url 初始化upload组件
  1459. handleCloe() {
  1460. this.dialogViewSpareMoney = false
  1461. },
  1462. history(row) {
  1463. console.log(row)
  1464. billoperatehis({ id: row.id })
  1465. .toPromise()
  1466. .then((response) => {
  1467. this.historyList = response
  1468. })
  1469. },
  1470. async exportlist() {
  1471. const { data } = await export1(
  1472. {
  1473. compId: localStorage.getItem('ws-pf_compId'),
  1474. contractType: this.contractType,
  1475. currentPage: this.currentPage,
  1476. pageSize: this.pageSize,
  1477. searchType: this.searchType,
  1478. searchKeyWord: this.searchKeyWord,
  1479. startDate: this.startDate,
  1480. endDate: this.endDate,
  1481. },
  1482. {},
  1483. { responseType: 'blob' }
  1484. ).toPromise()
  1485. downloadFile({
  1486. res: data,
  1487. fileName: `${
  1488. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  1489. }_采购合同`,
  1490. type: 'xls',
  1491. })
  1492. },
  1493. // deletecontract(){},
  1494. //删除
  1495. approve() {},
  1496. listQuery() {},
  1497. total() {},
  1498. clearfiltQuery() {},
  1499. selectCrtDuty() {},
  1500. },
  1501. }
  1502. </script>
  1503. <style lang="scss" scoped>
  1504. /deep/.basicInformation {
  1505. .ws-info-table {
  1506. border: none;
  1507. }
  1508. .el-form-item {
  1509. width: 33.3333%;
  1510. border: none;
  1511. .el-form-item__label {
  1512. background: transparent;
  1513. border: none;
  1514. }
  1515. .el-form-item__content {
  1516. border: none;
  1517. }
  1518. }
  1519. }
  1520. .title {
  1521. position: relative;
  1522. padding-left: 10px;
  1523. }
  1524. .title::before {
  1525. content: '';
  1526. display: inline-block;
  1527. width: 5px;
  1528. height: 30px;
  1529. background: #5473e8;
  1530. position: absolute;
  1531. left: 0;
  1532. }
  1533. .el-form {
  1534. padding: 0 10%;
  1535. }
  1536. .el-button--primary {
  1537. background-color: #5878e8;
  1538. border-color: #5878e8;
  1539. }
  1540. .el-col {
  1541. background: #f6f7fc;
  1542. }
  1543. .bg-right {
  1544. text-align: right;
  1545. padding: 16px 20px;
  1546. }
  1547. .center {
  1548. position: relative;
  1549. top: 50px;
  1550. width: 40%;
  1551. height: 2000px;
  1552. margin: 0 auto;
  1553. }
  1554. /deep/.el-form-item__label {
  1555. width: 160px;
  1556. }
  1557. .inspector {
  1558. width: 50%;
  1559. }
  1560. //质检员
  1561. /deep/[data-v-58803672] .el-form-item__label {
  1562. width: 60px;
  1563. }
  1564. [data-v-58803672] .el-form-item__label {
  1565. width: 60px;
  1566. }
  1567. //选填
  1568. /deep/.el-form-item {
  1569. width: 50%;
  1570. }
  1571. .container {
  1572. overflow: scroll;
  1573. height: 120vh;
  1574. }
  1575. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1576. text-align: center;
  1577. }
  1578. .deliverydate {
  1579. display: inline-block;
  1580. width: 10%;
  1581. }
  1582. .center {
  1583. margin-top: -60px;
  1584. width: 80%;
  1585. }
  1586. //仓位
  1587. .position {
  1588. width: 52px;
  1589. height: 20px;
  1590. background: #afb5cb;
  1591. border-radius: 2px;
  1592. font-size: 12px;
  1593. font-family: PingFangSC-Medium, PingFang SC;
  1594. color: #ffffff;
  1595. line-height: 20px;
  1596. }
  1597. //表格文字
  1598. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1599. text-align: left;
  1600. font-size: 14px;
  1601. font-family: PingFangSC-Regular, PingFang SC;
  1602. font-weight: 400;
  1603. color: #8890b1;
  1604. line-height: 16px;
  1605. }
  1606. //质检员
  1607. .inspector .el-form-item__content {
  1608. text-align: left;
  1609. margin-left: 0px;
  1610. }
  1611. .small-title {
  1612. position: relative;
  1613. padding: 10px;
  1614. font-weight: 600;
  1615. }
  1616. .small-title::before {
  1617. position: absolute;
  1618. content: '';
  1619. display: block;
  1620. background: #5473e8;
  1621. width: 4px;
  1622. height: 14px;
  1623. left: 0px;
  1624. top: 13px;
  1625. }
  1626. //下面列表
  1627. .neifor {
  1628. width: 80%;
  1629. background-color: #f6f7fc;
  1630. }
  1631. /deep/.neifor .ws-info-table .el-form-item .el-form-item__label {
  1632. width: 35%;
  1633. text-align: center;
  1634. }
  1635. /deep/.neifor .ws-info-table .el-form-item .el-form-item__content {
  1636. width: 60%;
  1637. background-color: #f6f7fc;
  1638. }
  1639. /deep/.neifor .el-input--small .el-input__inner {
  1640. width: 100%;
  1641. }
  1642. .el-input__inner {
  1643. width: 150px;
  1644. }
  1645. </style>