warehouseManagementNoWeightIn.vue 60 KB

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