warehouseManagementDelivery.vue 51 KB

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