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