warehouseManagementNoWeightIn.vue 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717
  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. if (value[i] == 46) {
  525. flag = true
  526. }
  527. if (flag && result.length < 9 && tmp != '='&& value[i] != 46) {
  528. result += tmp
  529. }
  530. }
  531. if (parseInt(result) || parseInt(result) == 0) {
  532. this.dataList.tare = parseInt(result)
  533. }
  534. }
  535. else {
  536. for (var i = 0; i < value.length; i++) {
  537. var tmp = String.fromCharCode(value[i])
  538. if ((value[0] != 49 && value[0] != 2)) {
  539. if ((value[value.length - 1] == 48 && value[value.length - 2] == 48)) {
  540. flag1 = true
  541. } else {
  542. break
  543. }
  544. }
  545. if (tmp == String.fromCharCode(32)) {
  546. flag = true
  547. }
  548. if (flag && result.length < 7 && tmp != String.fromCharCode(32) && !(value[value.length - 1] == 48 &&
  549. value[value.length - 2] == 48)) {
  550. result += tmp
  551. }
  552. if (flag1 && tmp != String.fromCharCode(32)) {
  553. if ((value[value.length - 1] == 48 && value[value.length - 2] == 48)) {
  554. if (i == 0) {
  555. this.result1 = tmp + '0'
  556. }
  557. }
  558. }
  559. }
  560. if (parseInt(result) || parseInt(result) == 0) {
  561. this.dataList.tare = parseInt(result + this.result1)
  562. }
  563. }
  564. // setTimeout(1000)
  565. // value 是一个 Uint8Array
  566. }
  567. await port.close();
  568. } else {
  569. console.log('the Web Serial API is not supported.', navigator);
  570. }
  571. },
  572. kkInput(val) {
  573. console.log(val)
  574. if (this.isGetCost) {
  575. if (this.dataList.cost > val) {
  576. this.dataList.cost = this.cost - this.dataList.deductionAmount
  577. }
  578. }
  579. },
  580. qualityInspectorChange(e) {
  581. console.log(e)
  582. },
  583. uploadSuccessHandle1(res) {
  584. this.dataList.addressUrl = res.url
  585. },
  586. pureweight(status) {
  587. console.log(this.dataList)
  588. if (this.dataList.netWeight && this.dataList.tidalGrainWater && this.dataList.solidGrainWater && this.dataList
  589. .buckleWeightRatio) {
  590. this.dataList.pureWeight = (this.dataList.netWeight * (100 - (this.dataList.tidalGrainWater - this.dataList
  591. .solidGrainWater) * this.dataList.buckleWeightRatio)) / 100
  592. }
  593. },
  594. //返回按钮
  595. revert() {
  596. this.$router.go(-1)
  597. },
  598. carChange(e) {
  599. for (let i = 0; i < this.tranCarInfoList.length; i++) {
  600. if (this.tranCarInfoList[i].carNo == this.dataList.carNo) {
  601. this.dataList.tranCarNo = this.tranCarInfoList[i].tranCarNo
  602. this.dataList.freight = this.tranCarInfoList[i].tranPrice
  603. }
  604. }
  605. },
  606. typeChange(e) {
  607. },
  608. contractNoChange(e) {
  609. for (let i = 0; i < this.deptBudgetList2.length; i++) {
  610. if (this.deptBudgetList2[i].inOutTaskNo == e) {
  611. var data=this.deptBudgetList2[i]
  612. this.dataList.contractNo = this.deptBudgetList2[i].contractNo
  613. }
  614. }
  615. for (var i = 0; i < this.outContractNo.length; i++) {
  616. if (this.outContractNo[i].contractNo == e) {
  617. if (this.outContractNo[i].inOutType == '采购入库') {
  618. this.deptBudgetList.tips='卖方'+this.outContractNo[i].seller
  619. this.deptBudgetList.inOutTypeKey = 1
  620. } else if (this.outContractNo[i].inOutType == '移库入库') {
  621. this.deptBudgetList.tips='入货库'+data.warehouseName
  622. this.deptBudgetList.inOutTypeKey = 3
  623. }else if (this.outContractNo[i].inOutType == '移库出库') {
  624. this.deptBudgetList.tips='出货库'+data.warehouseName
  625. } else if (this.outContractNo[i].inOutType == '暂存入库') {
  626. this.deptBudgetList.inOutTypeKey = 4
  627. } else if (this.outContractNo[i].inOutType == '贸易服务入库') {
  628. this.deptBudgetList.inOutTypeKey = 5
  629. } else if (this.outContractNo[i].inOutType == '退库') {
  630. this.deptBudgetList.tips='出货库'+data.warehouseName
  631. this.deptBudgetList.inOutTypeKey = 6
  632. }
  633. this.dataList.goodsName = this.outContractNo[i].goodsName
  634. this.dataList.goodsNameKey = this.outContractNo[i].goodsNameKey
  635. this.cost = this.outContractNo[i].contractPrice
  636. if (this.cost) {
  637. this.isGetCost = true
  638. this.dataList.cost = this.cost - this.dataList.deductionAmount
  639. } else {
  640. this.isGetCost = false
  641. this.dataList.cost = this.dataList.cost
  642. }
  643. this.dataList.inOutType = this.outContractNo[i].inOutType
  644. if (this.outContractNo[i].inOutType == '移库入库') {
  645. this.isSelectType = false
  646. } else {
  647. this.isSelectType = true
  648. }
  649. if (this.outContractNo[i].deliverType == '1') {
  650. this.carstatus = true
  651. } else {
  652. this.carstatus = false
  653. }
  654. if (this.outContractNo[i].tranCarInfoList) {
  655. this.options2 = this.outContractNo[i].tranCarInfoList
  656. this.tranCarInfoList = this.outContractNo[i].tranCarInfoList
  657. // this.carstatus = true
  658. }
  659. }
  660. }
  661. },
  662. dataFilter1(val) {
  663. console.log(val)
  664. this.dataList.contractNo = val;
  665. if (val) { //val存在
  666. this.options1 = this.outContractNo1.filter((item) => {
  667. if (!!~item.contractNo.indexOf(val) || !!~item.contractNo.toUpperCase().indexOf(val.toUpperCase())) {
  668. return true
  669. }
  670. })
  671. } else { //val为空时,还原数组
  672. this.options1 = this.outContractNo;
  673. }
  674. },
  675. dataFilter2(val) {
  676. this.dataList.carNo = val;
  677. if (val) { //val存在
  678. this.options1 = this.outContractNo1.filter((item) => {
  679. if (!!~item.carNo.indexOf(val) || !!~item.carNo.toUpperCase().indexOf(val.toUpperCase())) {
  680. return true
  681. }
  682. })
  683. } else { //val为空时,还原数组
  684. this.options2 = this.tranCarInfoList;
  685. }
  686. },
  687. dataFilter(val) {
  688. // console.log(val,"名")
  689. this.dataList.staffList = val
  690. if (val) {
  691. //val存在
  692. this.options = this.staffList.filter((item) => {
  693. if (
  694. !!~item.staffName.indexOf(val) ||
  695. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  696. ) {
  697. return true
  698. }
  699. })
  700. } else {
  701. //val为空时,还原数组
  702. this.options = this.staffList
  703. }
  704. },
  705. editClick(status) {
  706. this.isGetCost = false
  707. if (status == 1) {
  708. this.disabled1 = !this.disabled1
  709. } else {
  710. this.disabled2 = !this.disabled2
  711. }
  712. },
  713. selectstaff(e) {
  714. for (var i = 0; i < this.staffList.length; i++) {
  715. if (this.staffList[i].staffName == e) {
  716. this.dataList.personChargeKey = this.staffList[i].staffId
  717. }
  718. }
  719. },
  720. //暂存按钮
  721. temporaryStorage() {
  722. this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
  723. cancelButtonText: '取消',
  724. confirmButtonText: '确定',
  725. type: 'warning',
  726. })
  727. .then(() => {
  728. this.$refs.dataList.validate((valid) => {
  729. if (valid) {
  730. this.dataList.compId = localStorage.getItem('ws-pf_compId')
  731. this.dataList.inOutFlag = 2
  732. this.dataList.statusFlag = 1
  733. let _data = JSON.parse(localStorage.getItem('winseaview-userInfo'))
  734. this.dataList.backOffice = _data.content.showCompName + '-' + _data.content.staffName
  735. addstorageputList(this.dataList)
  736. .toPromise()
  737. .then((response) => {
  738. this.$message.success('暂存成功')
  739. this.$router.push({
  740. path: 'warehouseManagementList'
  741. })
  742. })
  743. } else {
  744. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  745. return false
  746. }
  747. })
  748. })
  749. .catch(() => {
  750. return false
  751. })
  752. },
  753. //提交按钮
  754. submit() {
  755. if (!this.dataList.goodsName) {
  756. this.$message({
  757. message: '货名不能为空',
  758. type: 'warning',
  759. })
  760. return
  761. }
  762. if (!this.dataList.grossWeight) {
  763. this.$message({
  764. message: '毛重不能为空',
  765. type: 'warning',
  766. })
  767. return
  768. }
  769. if (
  770. this.dataList.grossWeight <= 0 ||
  771. this.dataList.grossWeight > 300000 ||
  772. (String(this.dataList.grossWeight).indexOf('.') != -1 &&
  773. String(this.dataList.grossWeight).length -
  774. (String(this.dataList.grossWeight).indexOf('.') + 1) >
  775. 3)
  776. ) {
  777. this.$message({
  778. message: '毛重输入错误',
  779. type: 'warning',
  780. })
  781. return
  782. }
  783. if (
  784. this.dataList.tare < 0 ||
  785. this.dataList.tare > 200000 ||
  786. (String(this.dataList.tare).indexOf('.') != -1 &&
  787. String(this.dataList.tare).length -
  788. (String(this.dataList.tare).indexOf('.') + 1) >
  789. 3)
  790. ) {
  791. this.$message({
  792. message: '皮重输入错误',
  793. type: 'warning',
  794. })
  795. return
  796. }
  797. if (
  798. this.dataList.deductionWeight < 0 ||
  799. this.dataList.deductionWeight > 10000 ||
  800. (String(this.dataList.deductionWeight).indexOf('.') != -1 &&
  801. String(this.dataList.deductionWeight).length -
  802. (String(this.dataList.deductionWeight).indexOf('.') + 1) >
  803. 3)
  804. ) {
  805. this.$message({
  806. message: '扣重输入错误',
  807. type: 'warning'
  808. })
  809. return
  810. }
  811. if (this.dataList.type == '潮粮' && !this.dataList.buckleWeightRatio) {
  812. this.$message({
  813. message: '扣重比不能为空',
  814. type: 'warning'
  815. })
  816. return
  817. }
  818. if (
  819. this.dataList.type == '潮粮' && this.dataList.buckleWeightRatio < 0 ||
  820. this.dataList.type == '潮粮' && this.dataList.buckleWeightRatio > 3 ||
  821. (this.dataList.type == '潮粮' && String(this.dataList.buckleWeightRatio).indexOf('.') != -1 &&
  822. String(this.dataList.buckleWeightRatio).length -
  823. (String(this.dataList.buckleWeightRatio).indexOf('.') + 1) >
  824. 2)
  825. ) {
  826. this.$message({
  827. message: '扣重比输入错误',
  828. type: 'warning'
  829. })
  830. return
  831. }
  832. if (this.dataList.type == '潮粮' && !this.dataList.tidalGrainWater) {
  833. this.$message({
  834. message: '潮粮水分不能为空',
  835. type: 'warning'
  836. })
  837. return
  838. }
  839. if (
  840. this.dataList.type == '潮粮' && this.dataList.tidalGrainWater < 1 ||
  841. this.dataList.type == '潮粮' && this.dataList.tidalGrainWater > 40 ||
  842. (this.dataList.type == '潮粮' && String(this.dataList.tidalGrainWater).indexOf('.') != -1 &&
  843. String(this.dataList.tidalGrainWater).length -
  844. (String(this.dataList.tidalGrainWater).indexOf('.') + 1) >
  845. 2)
  846. ) {
  847. this.$message({
  848. message: '潮粮水分输入错误',
  849. type: 'warning'
  850. })
  851. return
  852. }
  853. if (this.dataList.type == '潮粮' && !this.dataList.solidGrainWater) {
  854. this.$message({
  855. message: '干粮水分不能为空',
  856. type: 'warning'
  857. })
  858. return
  859. }
  860. if (
  861. this.dataList.type == '潮粮' && this.dataList.solidGrainWater < 1 ||
  862. this.dataList.type == '潮粮' && this.dataList.solidGrainWater > 40 ||
  863. (this.dataList.type == '潮粮' && String(this.dataList.solidGrainWater).indexOf('.') != -1 &&
  864. String(this.dataList.solidGrainWater).length -
  865. (String(this.dataList.solidGrainWater).indexOf('.') + 1) >
  866. 1)
  867. ) {
  868. this.$message({
  869. message: '干粮水分输入错误',
  870. type: 'warning'
  871. })
  872. return
  873. }
  874. if (
  875. this.dataList.deductionAmount < 0 ||
  876. this.dataList.deductionAmount > 10000 ||
  877. (String(this.dataList.deductionAmount).indexOf('.') != -1 &&
  878. String(this.dataList.deductionAmount).length -
  879. (String(this.dataList.deductionAmount).indexOf('.') + 1) >
  880. 2)
  881. ) {
  882. this.$message({
  883. message: '扣款输入错误',
  884. type: 'warning'
  885. })
  886. return
  887. }
  888. if (!this.dataList.cost) {
  889. this.$message({
  890. message: '未获取到成本,请编辑后提交',
  891. type: 'warning'
  892. })
  893. return
  894. }
  895. if (
  896. this.dataList.cost < 0 ||
  897. this.dataList.cost > 20000 ||
  898. (String(this.dataList.cost).indexOf('.') != -1 &&
  899. String(this.dataList.cost).length -
  900. (String(this.dataList.cost).indexOf('.') + 1) >
  901. 2)
  902. ) {
  903. this.$message({
  904. message: '成本输入错误',
  905. type: 'warning'
  906. })
  907. return
  908. }
  909. if (!this.dataList.freight && this.dataList.freight != 0) {
  910. this.$message({
  911. message: '运费不能为空',
  912. type: 'warning'
  913. })
  914. return
  915. }
  916. if (
  917. this.dataList.freight < 0 ||
  918. this.dataList.freight > 100000 ||
  919. (String(this.dataList.freight).indexOf('.') != -1 &&
  920. String(this.dataList.freight).length -
  921. (String(this.dataList.freight).indexOf('.') + 1) >
  922. 2)
  923. ) {
  924. this.$message({
  925. message: '运费输入错误',
  926. type: 'warning'
  927. })
  928. return
  929. }
  930. if (!this.dataList.agent) {
  931. this.$message({
  932. message: '经办人不能为空',
  933. type: 'warning',
  934. })
  935. return
  936. }
  937. if (this.dataList.agent.length < 2 || this.dataList.agent.length > 10) {
  938. this.$message({
  939. message: '经办人输入有误',
  940. type: 'warning',
  941. })
  942. return
  943. }
  944. if (!this.dataList.grade) {
  945. this.$message({
  946. message: '品级不能为空!',
  947. type: 'warning',
  948. })
  949. return
  950. }
  951. if (!this.dataList.inOutDate) {
  952. this.$message({
  953. message: '入库日期不能为空!',
  954. type: 'warning',
  955. })
  956. return
  957. }
  958. if (!this.dataList.inOutType) {
  959. this.$message({
  960. message: '入库类型不能为空!',
  961. type: 'warning',
  962. })
  963. return
  964. }
  965. if (!this.dataList.carNo) {
  966. this.$message({
  967. message: '车牌号不能为空',
  968. type: 'warning',
  969. })
  970. return
  971. }
  972. if (this.dataList.carNo.length > 7) {
  973. this.$message({
  974. message: '车牌号输入错误,请输入7个字符之内',
  975. type: 'warning',
  976. })
  977. return
  978. }
  979. if (this.dataList.boxNo&&this.dataList.boxNo.length > 20) {
  980. this.$message({
  981. message: '箱号-1输入错误',
  982. type: 'warning',
  983. })
  984. return
  985. }
  986. if (this.dataList.boxNoOther&&this.dataList.boxNoOther.length > 20) {
  987. this.$message({
  988. message: '箱号-2输入错误',
  989. type: 'warning',
  990. })
  991. return
  992. }
  993. if (this.dataList.titleNo&&this.dataList.titleNo.length > 20) {
  994. this.$message({
  995. message: '封号-1输入错误',
  996. type: 'warning',
  997. })
  998. return
  999. }
  1000. if (this.dataList.titleNoOther&&this.dataList.titleNoOther.length > 20) {
  1001. this.$message({
  1002. message: '封号-2输入错误',
  1003. type: 'warning',
  1004. })
  1005. return
  1006. }
  1007. if (!this.dataList.contractNo) {
  1008. this.$message({
  1009. message: '合同编号不能为空',
  1010. type: 'warning',
  1011. })
  1012. return
  1013. }
  1014. // if (
  1015. // this.dataList.contractNo.length < 6 ||
  1016. // this.dataList.contractNo.length > 20
  1017. // ) {
  1018. // this.$message({
  1019. // message: '合同编号长度不符合要求,请输入6-20个字符之内',
  1020. // type: 'warning',
  1021. // })
  1022. // return
  1023. // }
  1024. if (this.dataList.netWeight > this.$route.query.capacity) {
  1025. this.$message({
  1026. message: '入库量大于该仓库容量!',
  1027. type: 'warning',
  1028. })
  1029. return
  1030. }
  1031. //自检员
  1032. if (this.dataList.warehouseInOutDetail.qualityInspector) {
  1033. if (
  1034. this.dataList.warehouseInOutDetail.qualityInspector.length < 2 ||
  1035. this.dataList.warehouseInOutDetail.qualityInspector.length > 10
  1036. ) {
  1037. this.$message({
  1038. message: '质检员姓名长度错误!',
  1039. type: 'warning',
  1040. })
  1041. return
  1042. }
  1043. }
  1044. if (this.dataList.warehouseInOutDetail.waterContent) {
  1045. if (isNaN(this.dataList.warehouseInOutDetail.waterContent)) {
  1046. this.$message({
  1047. message: '水分(%)非数字!',
  1048. type: 'warning',
  1049. })
  1050. return
  1051. }
  1052. if (
  1053. this.dataList.warehouseInOutDetail.waterContent < 1 ||
  1054. this.dataList.warehouseInOutDetail.waterContent > 40 ||
  1055. (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
  1056. '.'
  1057. ) != -1 &&
  1058. String(this.dataList.warehouseInOutDetail.waterContent).length -
  1059. (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
  1060. '.'
  1061. ) +
  1062. 1) >
  1063. 2)
  1064. ) {
  1065. this.$message({
  1066. message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1067. type: 'warning',
  1068. })
  1069. return
  1070. }
  1071. }
  1072. //杂质
  1073. if (this.dataList.warehouseInOutDetail.impurity) {
  1074. if (isNaN(this.dataList.warehouseInOutDetail.impurity)) {
  1075. this.$message({
  1076. message: '杂质(%)非数字!',
  1077. type: 'warning',
  1078. })
  1079. return
  1080. }
  1081. if (
  1082. this.dataList.warehouseInOutDetail.impurity < 1 ||
  1083. this.dataList.warehouseInOutDetail.impurity > 40 ||
  1084. (String(this.dataList.warehouseInOutDetail.impurity).indexOf('.') !=
  1085. -1 &&
  1086. String(this.dataList.warehouseInOutDetail.impurity).length -
  1087. (String(this.dataList.warehouseInOutDetail.impurity).indexOf(
  1088. '.'
  1089. ) +
  1090. 1) >
  1091. 2)
  1092. ) {
  1093. this.$message({
  1094. message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1095. type: 'warning',
  1096. })
  1097. return
  1098. }
  1099. }
  1100. //霉变
  1101. if (this.dataList.warehouseInOutDetail.mildewGrain) {
  1102. if (isNaN(this.dataList.warehouseInOutDetail.mildewGrain)) {
  1103. this.$message({
  1104. message: '霉变粒(%)非数字!',
  1105. type: 'warning',
  1106. })
  1107. return
  1108. }
  1109. if (
  1110. this.dataList.warehouseInOutDetail.mildewGrain < 1 ||
  1111. this.dataList.warehouseInOutDetail.mildewGrain > 40 ||
  1112. (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
  1113. '.'
  1114. ) != -1 &&
  1115. String(this.dataList.warehouseInOutDetail.mildewGrain).length -
  1116. (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
  1117. '.'
  1118. ) +
  1119. 1) >
  1120. 2)
  1121. ) {
  1122. this.$message({
  1123. message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1124. type: 'warning',
  1125. })
  1126. return
  1127. }
  1128. }
  1129. //热损伤
  1130. if (this.dataList.warehouseInOutDetail.jiaorenli) {
  1131. if (isNaN(this.dataList.warehouseInOutDetail.jiaorenli)) {
  1132. this.$message({
  1133. message: '热损伤(%)非数字!',
  1134. type: 'warning',
  1135. })
  1136. return
  1137. }
  1138. if (
  1139. this.dataList.warehouseInOutDetail.jiaorenli < 1 ||
  1140. this.dataList.warehouseInOutDetail.jiaorenli > 40 ||
  1141. (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf('.') !=
  1142. -1 &&
  1143. String(this.dataList.warehouseInOutDetail.jiaorenli).length -
  1144. (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf(
  1145. '.'
  1146. ) +
  1147. 1) >
  1148. 2)
  1149. ) {
  1150. this.$message({
  1151. message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1152. type: 'warning',
  1153. })
  1154. return
  1155. }
  1156. }
  1157. //不完善粒(%)
  1158. if (this.dataList.warehouseInOutDetail.imperfectGrain) {
  1159. if (isNaN(this.dataList.warehouseInOutDetail.imperfectGrain)) {
  1160. this.$message({
  1161. message: '不完善粒(%)非数字!',
  1162. type: 'warning',
  1163. })
  1164. return
  1165. }
  1166. if (
  1167. this.dataList.warehouseInOutDetail.imperfectGrain < 1 ||
  1168. this.dataList.warehouseInOutDetail.imperfectGrain > 40 ||
  1169. (String(this.dataList.warehouseInOutDetail.imperfectGrain).indexOf(
  1170. '.'
  1171. ) != -1 &&
  1172. String(this.dataList.warehouseInOutDetail.imperfectGrain).length -
  1173. (String(
  1174. this.dataList.warehouseInOutDetail.imperfectGrain
  1175. ).indexOf('.') +
  1176. 1) >
  1177. 2)
  1178. ) {
  1179. this.$message({
  1180. message: '不完善粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
  1181. type: 'warning',
  1182. })
  1183. return
  1184. }
  1185. }
  1186. //容重
  1187. if (this.dataList.warehouseInOutDetail.bulkDensity) {
  1188. if (isNaN(this.dataList.warehouseInOutDetail.bulkDensity)) {
  1189. this.$message({
  1190. message: '容重(克/升)非数字!',
  1191. type: 'warning',
  1192. })
  1193. return
  1194. }
  1195. if (
  1196. this.dataList.warehouseInOutDetail.bulkDensity > 1000 ||
  1197. this.dataList.warehouseInOutDetail.bulkDensity < 0 ||
  1198. (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
  1199. '.'
  1200. ) != -1 &&
  1201. String(this.dataList.warehouseInOutDetail.bulkDensity).length -
  1202. (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
  1203. '.'
  1204. ) +
  1205. 1) >
  1206. 0)
  1207. ) {
  1208. this.$message({
  1209. message: '容重(克/升)输入错误! 取值范围1-40之间且是整数',
  1210. type: 'warning',
  1211. })
  1212. return
  1213. }
  1214. }
  1215. this.$confirm(`确定提交皮重检斤`, {
  1216. cancelButtonText: '取消',
  1217. confirmButtonText: '确定',
  1218. type: 'warning',
  1219. })
  1220. .then(() => {
  1221. this.$refs.dataList.validate((valid) => {
  1222. if (valid) {
  1223. this.dataList.compId = localStorage.getItem('ws-pf_compId')
  1224. this.dataList.skinInspector = localStorage.getItem('ws-pf_staffName')
  1225. this.dataList.inOutFlag = 2
  1226. this.dataList.statusFlag = 3
  1227. this.dataList.grossWeight = (this.dataList.grossWeight / 1000).toFixed(2)
  1228. this.dataList.tare = (this.dataList.tare / 1000).toFixed(2)
  1229. this.dataList.netWeight = (this.dataList.netWeight / 1000).toFixed(2)
  1230. this.dataList.pureWeight = (this.dataList.pureWeight / 1000).toFixed(2)
  1231. if (!this.dataList.deductionWeight) {
  1232. this.dataList.deductionWeight = 0
  1233. }
  1234. if (!this.dataList.deductionAmount) {
  1235. this.dataList.deductionAmount = 0
  1236. }
  1237. this.dataList.deductionWeight = (this.dataList.deductionWeight / 1000).toFixed(2)
  1238. this.dataList.deductionAmount = Math.round(this.dataList.deductionAmount * 1000)
  1239. addstorageputList(this.dataList)
  1240. .toPromise()
  1241. .then((response) => {
  1242. this.dataList.grossWeight = Math.round(this.dataList.grossWeight * 1000)
  1243. this.dataList.tare = Math.round(this.dataList.tare * 1000)
  1244. this.dataList.netWeight = Math.round(this.dataList.netWeight * 1000)
  1245. this.dataList.pureWeight = Math.round(this.dataList.pureWeight * 1000)
  1246. this.dataList.deductionWeight = Math.round(this.dataList.deductionWeight * 1000)
  1247. this.$message.success('提交成功')
  1248. this.$confirm(`是否打印磅单`, {
  1249. cancelButtonText: '取消',
  1250. confirmButtonText: '确定',
  1251. type: 'warning',
  1252. })
  1253. .then(() => {
  1254. getPrintInfo({
  1255. id: this.dataList.id
  1256. })
  1257. .toPromise()
  1258. .then((response) => {
  1259. window.open('../../../../static/weightCheckInOut.html?type=2&tableData=' + JSON
  1260. .stringify(response))
  1261. })
  1262. })
  1263. this.$router.push({
  1264. path: 'warehouseManagementList'
  1265. })
  1266. .catch(() => {
  1267. return false
  1268. })
  1269. }).catch((response) => {
  1270. this.dataList.grossWeight = Math.round(this.dataList.grossWeight*1000)
  1271. this.dataList.tare = Math.round(this.dataList.tare*1000)
  1272. this.dataList.netWeight = Math.round(this.dataList.netWeight*1000)
  1273. this.dataList.pureWeight = Math.round(this.dataList.pureWeight*1000)
  1274. this.dataList.deductionWeight = Math.round(this.dataList.deductionWeight*1000)
  1275. })
  1276. } else {
  1277. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1278. return false
  1279. }
  1280. })
  1281. })
  1282. .catch(() => {
  1283. return false
  1284. })
  1285. },
  1286. //暂存按钮
  1287. returnWarehouse() {
  1288. this.$refs.dataList.validate((valid) => {
  1289. if (valid) {
  1290. this.dataList.compId = localStorage.getItem('ws-pf_compId')
  1291. this.dataList.statusFlag = 1
  1292. addstorageputList(this.dataList)
  1293. .toPromise()
  1294. .then((response) => {
  1295. this.$message.success('添加成功')
  1296. this.$router.push({
  1297. path: 'warehouseManagementList'
  1298. })
  1299. })
  1300. } else {
  1301. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1302. return false
  1303. }
  1304. })
  1305. },
  1306. tarechange(e) {
  1307. if (this.dataList.grossWeight && this.dataList.tare) {
  1308. this.dataList.netWeight = Number(
  1309. this.dataList.grossWeight - this.dataList.tare
  1310. ).toFixed(2)
  1311. }
  1312. },
  1313. grossWeightchange(e) {
  1314. if (this.dataList.grossWeight && this.dataList.tare) {
  1315. this.dataList.netWeight = Number(
  1316. this.dataList.grossWeight - this.dataList.tare
  1317. ).toFixed(2)
  1318. }
  1319. },
  1320. selectgoodsName(e) {
  1321. for (var i = 0; i < this.goodnameList.length; i++) {
  1322. if (this.goodnameList[i].constValue == e) {
  1323. this.dataList.goodsNameKey = this.goodnameList[i].constKey
  1324. if(e=='玉米(潮粮)'){
  1325. this.dataList.type='潮粮'
  1326. }else{
  1327. this.dataList.type='干粮'
  1328. }
  1329. }
  1330. }
  1331. },
  1332. selectpackingMethod(e) {
  1333. for (var i = 0; i < this.packtypeList.length; i++) {
  1334. if (this.packtypeList[i].constValue == e) {
  1335. this.dataList.packingMethodKey = this.packtypeList[i].constKey
  1336. }
  1337. }
  1338. },
  1339. selectstorageType(e) {
  1340. for (var i = 0; i < this.storageType.length; i++) {
  1341. if (this.storageType[i].constValue == e) {
  1342. this.dataList.inOutTypeKey = this.storageType[i].constKey
  1343. }
  1344. }
  1345. },
  1346. handleClose() {
  1347. this.accessoryTFs = false
  1348. },
  1349. handleSizeChange(val) {
  1350. console.log(`每页 ${val} 条`)
  1351. this.pageSize = val
  1352. this.getList()
  1353. },
  1354. handleCurrentChange(val) {
  1355. this.currentPage = val
  1356. console.log(`当前页: ${val}`)
  1357. this.getList()
  1358. },
  1359. getList() {
  1360. // 货名
  1361. pullDown({
  1362. constId: 'CON2'
  1363. })
  1364. .toPromise()
  1365. .then((response) => {
  1366. this.goodnameList = response
  1367. })
  1368. // 品级
  1369. pullDown({
  1370. constId: 'CON3'
  1371. })
  1372. .toPromise()
  1373. .then((response) => {
  1374. this.gradeList = response
  1375. })
  1376. // 类型
  1377. if (this.$route.query.warehouseType == '1') {
  1378. this.storageType = []
  1379. pullDown({
  1380. constId: 'CON5'
  1381. })
  1382. .toPromise()
  1383. .then((response) => {
  1384. // this.storageType = response
  1385. for (let i = 0; i < response.length; i++) {
  1386. if (response[i].constValue == '移库入库' || response[i].constValue == '退库') {
  1387. this.storageType.push(response[i])
  1388. }
  1389. }
  1390. })
  1391. } else if (this.$route.query.warehouseType == '2') {
  1392. //临时仓库入库类型
  1393. pullDown({
  1394. constId: 'WARE1'
  1395. })
  1396. .toPromise()
  1397. .then((response) => {
  1398. this.storageType = response
  1399. })
  1400. //临时仓库出库类型
  1401. pullDown({
  1402. constId: 'WARE2'
  1403. })
  1404. .toPromise()
  1405. .then((response) => {
  1406. this.deliveryType = response
  1407. })
  1408. }
  1409. //合同编号
  1410. xialaNo({
  1411. compId: localStorage.getItem('ws-pf_compId'),
  1412. flag: 6
  1413. })
  1414. .toPromise()
  1415. .then((response) => {
  1416. this.options1 = response
  1417. this.outContractNo = response
  1418. })
  1419. //合同编号2
  1420. xialaNo({
  1421. compId: localStorage.getItem('ws-pf_compId'),
  1422. flag: 7
  1423. })
  1424. .toPromise()
  1425. .then((response) => {
  1426. for (let i = 0; i < response.length; i++) {
  1427. if (this.dataList.contractNo == response[i].contractNo) {
  1428. if (response[i].deliverType == '1') {
  1429. this.carstatus = true
  1430. } else {
  1431. this.carstatus = false
  1432. }
  1433. }
  1434. }
  1435. this.outContractNo1 = response
  1436. })
  1437. //经办人
  1438. getstaff({
  1439. compId: localStorage.getItem('ws-pf_compId'),
  1440. warehouseId: this.dataList.id
  1441. })
  1442. .toPromise()
  1443. .then((response) => {
  1444. this.options = response
  1445. this.qualityInspectorList = response
  1446. this.staffList = response
  1447. // this.agent = response
  1448. })
  1449. },
  1450. selecttaskType(e) {
  1451. for (var i = 0; i < this.taskTypeList.length; i++) {
  1452. if (this.taskTypeList[i].value == e) {
  1453. this.searchType = this.taskTypeList[i].type
  1454. }
  1455. }
  1456. },
  1457. fujian(row) {
  1458. if (
  1459. row.receiveAttachmentPath === null ||
  1460. row.receiveAttachmentPath === ''
  1461. ) {
  1462. EventBus.$emit(
  1463. 'warning',
  1464. this.$t('system.noticeCircular.NoInformation')
  1465. )
  1466. } else {
  1467. this.accessoryTFs = true
  1468. }
  1469. this.appendixIdss = row.receiveAttachmentPath
  1470. },
  1471. handleExamine(row) {
  1472. this.$router.push({
  1473. name: 'salesContractExamine',
  1474. query: {
  1475. id: row.id
  1476. },
  1477. })
  1478. },
  1479. // 关闭 dialog时 处理文件url 初始化upload组件
  1480. handleCloe() {
  1481. this.dialogViewSpareMoney = false
  1482. },
  1483. history(row) {
  1484. console.log(row)
  1485. billoperatehis({
  1486. id: row.id
  1487. })
  1488. .toPromise()
  1489. .then((response) => {
  1490. this.historyList = response
  1491. })
  1492. },
  1493. async exportlist() {
  1494. const {
  1495. data
  1496. } = await export1({
  1497. compId: localStorage.getItem('ws-pf_compId'),
  1498. contractType: this.contractType,
  1499. currentPage: this.currentPage,
  1500. pageSize: this.pageSize,
  1501. searchType: this.searchType,
  1502. searchKeyWord: this.searchKeyWord,
  1503. startDate: this.startDate,
  1504. endDate: this.endDate,
  1505. }, {}, {
  1506. responseType: 'blob'
  1507. }).toPromise()
  1508. downloadFile({
  1509. res: data,
  1510. fileName: `${
  1511. this.date.year + (this.date.month ? `-${this.date.month}` : '')
  1512. }_采购合同`,
  1513. type: 'xls',
  1514. })
  1515. },
  1516. // deletecontract(){},
  1517. //删除
  1518. approve() {},
  1519. listQuery() {},
  1520. total() {},
  1521. clearfiltQuery() {},
  1522. selectCrtDuty() {},
  1523. },
  1524. }
  1525. </script>
  1526. <style lang="scss" scoped>
  1527. /deep/.basicInformation {
  1528. .ws-info-table {
  1529. border: none;
  1530. }
  1531. .el-form-item {
  1532. width: 33.3333%;
  1533. border: none;
  1534. .el-form-item__label {
  1535. background: transparent;
  1536. border: none;
  1537. }
  1538. .el-form-item__content {
  1539. border: none;
  1540. }
  1541. }
  1542. }
  1543. .title {
  1544. position: relative;
  1545. padding-left: 10px;
  1546. }
  1547. .title::before {
  1548. content: '';
  1549. display: inline-block;
  1550. width: 5px;
  1551. height: 30px;
  1552. background: #5473e8;
  1553. position: absolute;
  1554. left: 0;
  1555. }
  1556. .el-form {
  1557. padding: 0 10%;
  1558. }
  1559. .el-button--primary {
  1560. background-color: #5878e8;
  1561. border-color: #5878e8;
  1562. }
  1563. .el-col {
  1564. background: #f6f7fc;
  1565. }
  1566. .bg-right {
  1567. text-align: right;
  1568. padding: 16px 20px;
  1569. }
  1570. .center {
  1571. position: relative;
  1572. top: 50px;
  1573. width: 40%;
  1574. height: 2000px;
  1575. margin: 0 auto;
  1576. }
  1577. /deep/.el-form-item__label {
  1578. width: 160px;
  1579. }
  1580. .inspector {
  1581. width: 50%;
  1582. }
  1583. //质检员
  1584. /deep/[data-v-58803672] .el-form-item__label {
  1585. width: 60px;
  1586. }
  1587. [data-v-58803672] .el-form-item__label {
  1588. width: 60px;
  1589. }
  1590. //选填
  1591. /deep/.el-form-item {
  1592. width: 50%;
  1593. }
  1594. .container {
  1595. overflow: scroll;
  1596. height: 120vh;
  1597. }
  1598. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1599. text-align: center;
  1600. }
  1601. .deliverydate {
  1602. display: inline-block;
  1603. width: 10%;
  1604. }
  1605. .center {
  1606. margin-top: -60px;
  1607. width: 80%;
  1608. }
  1609. //仓位
  1610. .position {
  1611. width: 52px;
  1612. height: 20px;
  1613. background: #afb5cb;
  1614. border-radius: 2px;
  1615. font-size: 12px;
  1616. font-family: PingFangSC-Medium, PingFang SC;
  1617. color: #ffffff;
  1618. line-height: 20px;
  1619. }
  1620. //表格文字
  1621. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1622. text-align: left;
  1623. font-size: 14px;
  1624. font-family: PingFangSC-Regular, PingFang SC;
  1625. font-weight: 400;
  1626. color: #8890b1;
  1627. line-height: 16px;
  1628. }
  1629. //质检员
  1630. .inspector .el-form-item__content {
  1631. text-align: left;
  1632. margin-left: 0px;
  1633. }
  1634. .small-title {
  1635. position: relative;
  1636. padding: 10px;
  1637. font-weight: 600;
  1638. }
  1639. .small-title::before {
  1640. position: absolute;
  1641. content: '';
  1642. display: block;
  1643. background: #5473e8;
  1644. width: 4px;
  1645. height: 14px;
  1646. left: 0px;
  1647. top: 13px;
  1648. }
  1649. //下面列表
  1650. .neifor {
  1651. width: 80%;
  1652. background-color: #f6f7fc;
  1653. }
  1654. /deep/.neifor .ws-info-table .el-form-item .el-form-item__label {
  1655. width: 35%;
  1656. text-align: center;
  1657. }
  1658. /deep/.neifor .ws-info-table .el-form-item .el-form-item__content {
  1659. width: 60%;
  1660. background-color: #f6f7fc;
  1661. }
  1662. /deep/.neifor .el-input--small .el-input__inner {
  1663. width: 100%;
  1664. }
  1665. .el-input__inner {
  1666. width: 150px;
  1667. }
  1668. </style>