warehouseManagementGross.vue 77 KB

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