warehouseManagementGross.vue 75 KB

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