warehouseManagementNoWeightOut.vue 51 KB

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