weightCheck.vue 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607
  1. <template>
  2. <div class="center">
  3. <el-row>
  4. <el-col :span="12">
  5. <h2 class="bg-left titleup">{{ information }}信息</h2>
  6. </el-col>
  7. <el-col :span="12" class="bg-right">
  8. <el-button class="bg-bottom" type="primary" size="small" @click="cancel"><img width="6" height="10"
  9. style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
  10. </el-button>
  11. </el-col>
  12. </el-row>
  13. <div class="substance">
  14. <div class="left">
  15. <BalanceAlert v-if="isShowBalance" ref="weightChild" :deptBudgetList="deptBudgetList" :information="information"
  16. v-on:balanceListen="setVal" class="zujian">
  17. </BalanceAlert>
  18. <div class="top">
  19. <div class="confirmWeight">
  20. <div class="titleWeight">确认重量</div>
  21. <div v-if="index == 0" class="weight">
  22. {{ weighingList.grossWeight }} <span class="kg-style">kg</span>
  23. </div>
  24. <div v-else class="weight">
  25. {{ weighingList.tare }} <span class="kg-style">kg</span>
  26. </div>
  27. </div>
  28. <div class="confirmInfo">
  29. <div class="car-type">车牌号</div>
  30. <div class="car-no">{{ carWeightInfo.carNumber }}</div>
  31. </div>
  32. </div>
  33. <h2 class="bg-left titleup">实时监控</h2>
  34. <div class="bottom">
  35. <div v-if="!monitorUrl1" class="video1">
  36. <img src="../../../public/img/quesheng@2x.png" alt="" class="img1" />
  37. <div>监控视频未连接</div>
  38. </div>
  39. <div v-else class="video1">
  40. <iframe :src="monitorUrl1" width="440" height="360" allowfullscreen="true" webkitallowfullscreen="true"
  41. mozallowfullscreen="true" allow="autoplay; fullscreen; microphone;"></iframe>
  42. </div>
  43. <div v-if="!monitorUrl2" class="video1">
  44. <img src="../../../public/img/quesheng@2x.png" alt="" class="img1" />
  45. <div>监控视频未连接</div>
  46. </div>
  47. <div v-else class="video2">
  48. <iframe :src="monitorUrl2" width="440" height="360" allowfullscreen="true" webkitallowfullscreen="true"
  49. mozallowfullscreen="true" allow="autoplay; fullscreen; microphone;"></iframe>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="right">
  54. <ws-form class="right-content">
  55. <div class="left">
  56. <div class="tab">
  57. <div class="tab-item" :class="index == 0 ? 'active' : ''" @click="tabClick(0)">
  58. 待称毛重({{ mListTop.length }})
  59. </div>
  60. <div class="tab-item" :class="index == 1 ? 'active' : ''" @click="tabClick(1)">
  61. 待称皮重({{ pListTop.length }})
  62. </div>
  63. </div>
  64. <ws-info-table>
  65. <ws-form-item label="编号" span="1" prop="number">
  66. <ws-input v-model="weighingList.number" placeholder="请输入编号" maxlength="100" disabled size="small" />
  67. </ws-form-item>
  68. <ws-form-item label="仓位号" span="1" prop="binNumber">
  69. <ws-input v-model="weighingList.binNumber" placeholder="请输入仓位号" maxlength="100" disabled size="small" />
  70. </ws-form-item>
  71. <ws-form-item label="客户" span="1" prop="customer">
  72. <ws-input v-model="weighingList.customer" placeholder="请输入客户" maxlength="100" disabled size="small" />
  73. </ws-form-item>
  74. <ws-form-item label="囤位号" span="1" prop="storageNumber">
  75. <ws-input v-model="weighingList.storageNumber" placeholder="请输入囤位号" maxlength="100" size="small"
  76. disabled />
  77. </ws-form-item>
  78. <ws-form-item label="车牌号" span="1" prop="carNumber">
  79. <ws-input v-model="weighingList.carNumber" placeholder="请输入车牌号" maxlength="100" size="small" disabled />
  80. </ws-form-item>
  81. <ws-form-item label="箱号-1" span="1" prop="boxNo">
  82. <ws-input disabled v-model="inspect.boxNo" placeholder="请输入箱号" maxlength="20" size="small" />
  83. </ws-form-item>
  84. <ws-form-item label="箱号-2" span="1" prop="boxNoOther">
  85. <ws-input disabled v-model="inspect.boxNoOther" placeholder="请输入箱号" maxlength="20" size="small" />
  86. </ws-form-item>
  87. <ws-form-item label="封号-1" span="1" prop="titleNo">
  88. <ws-input disabled v-model="inspect.titleNo" placeholder="请输入封号" maxlength="20" size="small" />
  89. </ws-form-item>
  90. <ws-form-item label="封号-2" span="1" prop="titleNoOther">
  91. <ws-input disabled v-model="inspect.titleNoOther" placeholder="请输入封号" maxlength="20" size="small" />
  92. </ws-form-item>
  93. <ws-form-item label="货名" span="1" prop="goodsName">
  94. <ws-input v-model="weighingList.goodsName" placeholder="请输入货名" maxlength="100" size="small" disabled />
  95. </ws-form-item>
  96. <ws-form-item label="毛重(公斤)" span="1" prop="grossWeight">
  97. <ws-input type="number" @mousewheel.native.prevent v-if="this.index == 0"
  98. v-model="weighingList.grossWeight" @input="calculation(status)" placeholder="未获取到毛重" maxlength="100"
  99. size="small" :disabled="disabled" />
  100. <ws-input type="number" @mousewheel.native.prevent v-else v-model="weighingList.grossWeight"
  101. @input="calculation" placeholder="未获取到毛重" maxlength="100" size="small" disabled />
  102. <el-button type="primary" :class="index == 0 ? '' : 'butCss'" @click="openPort">重新获取</el-button>
  103. </ws-form-item>
  104. <ws-form-item label="皮重(公斤)" span="1" prop="tare" v-if="information == '皮重'">
  105. <ws-input type="number" @mousewheel.native.prevent v-model="weighingList.tare" @input="calculation"
  106. placeholder="未获取到皮重" maxlength="100" size="small" :disabled="disabled" />
  107. <el-button type="primary" v-if="index != 0" @click="openPort">重新获取</el-button>
  108. </ws-form-item>
  109. <div class="formItem">
  110. <ws-form-item label="扣重(公斤)" span="1" prop="buckleWeightRatio"
  111. v-if="information == '皮重' && paramType == '2'">
  112. <ws-input type="number" @mousewheel.native.prevent v-model="weighingList.buckleMiscellaneous"
  113. @input="calculation" placeholder="请输入扣重" maxlength="100" size="small" />
  114. </ws-form-item>
  115. <ws-form-item label="净重(公斤)" span="1" prop="netWeight" v-if="information == '皮重'">
  116. <ws-input type="number" @mousewheel.native.prevent v-model="weighingList.netWeight"
  117. placeholder="请输入净重" maxlength="100" size="small" disabled />
  118. </ws-form-item>
  119. <ws-form-item label="应收卸车过磅费(元)" span="1" prop="receivableWeighingFee" v-if="index == 1">
  120. <ws-input type="number" v-model="weighingList.receivableWeighingFee" placeholder="未获取到卸车过磅费金额"
  121. maxlength="100" size="small" disabled />
  122. </ws-form-item>
  123. <ws-form-item label="实收卸车过磅费(元)" span="1" prop="actualWeighingFee" v-if="index == 1">
  124. <ws-input type="number" v-model="weighingList.actualWeighingFee" placeholder="输入卸车过磅费" maxlength="100"
  125. size="small" />
  126. </ws-form-item>
  127. </div>
  128. </ws-info-table>
  129. <div class="but">
  130. <el-button @click="cancel" type="primary">关闭</el-button>
  131. <el-button @click="print" v-if="this.information == '毛重'" type="primary">保存</el-button>
  132. <el-button @click="print" v-if="this.information == '皮重'" type="primary">保存并打印</el-button>
  133. </div>
  134. </div>
  135. <div class="car-right">
  136. <div class="tab-item" :class="status == 1 ? 'active' : ''" @click="cutstatus(1)">
  137. 已称重
  138. </div>
  139. <div class="tab-item" :class="status == 2 ? 'active' : ''" @click="cutstatus(2)">
  140. 未称重
  141. </div>
  142. <!-- <el-button :type="status==1?'primary':''">已称重</el-button>
  143. <el-button @click="cutstatus(2)" :type="status==2?'primary':''">未称重</el-button> -->
  144. <el-table ref="singleTable" :data="carList" highlight-current-row @current-change="handleCurrentChange"
  145. style="width: 100%; overflow: auto; height: 640px">
  146. <el-table-column property="number" label="编号">
  147. </el-table-column>
  148. <el-table-column property="carNumber" label="车牌号">
  149. </el-table-column>
  150. <el-table-column property="status" label="状态">
  151. </el-table-column>
  152. </el-table>
  153. <div style="text-align: center">
  154. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  155. :current-page="currentPage" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
  156. :total="deptBudgetTotal">
  157. </el-pagination>
  158. </div>
  159. <!-- <div class="table-title">
  160. <div class="top">
  161. <div class="top-item first"></div>
  162. <div class="top-item">编号</div>
  163. <div class="top-item">车牌号</div>
  164. </div>
  165. <div class="top">
  166. <div></div>
  167. <div class="top-item"></div>
  168. <div class="top-item">编号</div>
  169. <div class="top-item">车牌号</div>
  170. </div>
  171. </div>
  172. <div class="table">
  173. <div class="table-content" v-for="(item,index) in 30" :key="index">
  174. <div class="table-content-item"><input type="radio"></div>
  175. <div class="table-content-item">xxxxxxxxxxxxx</div>
  176. <div class="table-content-item">辽A11111</div>
  177. </div>
  178. </div> -->
  179. </div>
  180. </ws-form>
  181. </div>
  182. </div>
  183. <div class="mask" v-show="isShowPrintType"></div>
  184. <div class="print-type" v-show="isShowPrintType">
  185. <div class="print-type-content">
  186. <div class="print-type-title">请选择打印纸张类型</div>
  187. <div class="print-type-checkbox">
  188. <!-- <el-radio-group v-model="radio">
  189. <el-radio label="A4" class="label-width" @change="selectType">A4</el-radio>
  190. <el-radio label="A5" class="label-width" @change="selectType">A5</el-radio>
  191. </el-radio-group> -->
  192. </div>
  193. <div class="shdw-style" v-if="checked||(!ddchecked&&!checked)">
  194. <div>收货单位:</div>
  195. <!-- <div>{{companyName}}</div> -->
  196. <el-select v-model="companyName" placeholder="请选择" style="width: 75%;">
  197. <el-option v-for="item in companyNameOptions" :key="item.value" :label="item.label" :value="item.value">
  198. </el-option>
  199. </el-select>
  200. </div>
  201. <div v-if="warehouseName=='鲅鱼圈金信库'||warehouseName=='白城内陆港'||warehouseName=='杜尔伯特家禾库'||warehouseName=='洮南新友谊兴旺库'||warehouseName=='甘南宏旗库'||warehouseName=='哈尔滨依兰库'||this.warehouseName=='山东园丰库'">
  202. <div class="print-type-ew">
  203. <el-checkbox v-model="checked" @change="changeEw">打印额外票据</el-checkbox>
  204. <el-checkbox v-model="ddchecked" @change="changeEwDD">单独打印额外票据</el-checkbox>
  205. </div>
  206. <div class="ew-print" v-if="printSeparately">
  207. <div class="row">
  208. <div>额外客户姓名:</div>
  209. <!-- <div>{{companyName}}</div> -->
  210. <el-select v-model="ewCustomer" placeholder="请选择" style="width: 75%;">
  211. <el-option v-for="item in ewCustomerOptions" :key="item.value" :label="item.label" :value="item.value">
  212. </el-option>
  213. </el-select>
  214. </div>
  215. <div class="row">
  216. <div>额外收货单位:</div>
  217. <!-- <div>{{companyNameEW}}</div> -->
  218. <el-select v-model="companyNameEW" placeholder="请选择" style="width: 75%;">
  219. <el-option v-for="item in companyNameEWOptions" :key="item.value" :label="item.label"
  220. :value="item.value">
  221. </el-option>
  222. </el-select>
  223. </div>
  224. </div>
  225. </div>
  226. {{ warehouseName }}
  227. <div v-if="warehouseName=='鲅鱼圈金信库'">
  228. <div class="print-type-ew">
  229. <el-checkbox v-model="outchecked" @change="changeOut">是否打印出库</el-checkbox>
  230. </div>
  231. <div class="ew-print" v-if="printout">
  232. <div class="row">
  233. <div>出库发货单位:</div>
  234. <!-- <div>{{companyName}}</div> -->
  235. <el-select v-model="inshipments" placeholder="请选择" style="width: 75%;">
  236. <el-option v-for="item in ewCustomerOptions" :key="item.value" :label="item.label" :value="item.value">
  237. </el-option>
  238. </el-select>
  239. </div>
  240. <div class="row">
  241. <div>出库收货单位:</div>
  242. <!-- <div>{{companyNameEW}}</div> -->
  243. <el-select v-model="outshipments" placeholder="请选择" style="width: 75%;">
  244. <el-option v-for="item in companyNameEWOptions" :key="item.value" :label="item.label"
  245. :value="item.value">
  246. </el-option>
  247. </el-select>
  248. </div>
  249. </div>
  250. </div>
  251. </div>
  252. <div class="bottom-btn">
  253. <el-button @click="typePrintClick">确定</el-button>
  254. <el-button @click="isShowPrintType = false">取消</el-button>
  255. </div>
  256. </div>
  257. <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食检斤单" @opened="opendBtn"
  258. @close="closeDialog" :close-on-click-modal="false">
  259. <weightCheckPrint :tableData="inspect" ref="saveImg"></weightCheckPrint>
  260. <div style="text-align: center">
  261. <el-button type="primary" @click="closePrint">关闭</el-button>
  262. <el-button type="primary" @click="printSmall">打印小票</el-button>
  263. <el-button type="primary" @click="printBig">打印单据</el-button>
  264. </div>
  265. </el-dialog>
  266. </div>
  267. </template>
  268. <script>
  269. import {
  270. tare,
  271. grossWeight,
  272. getamount,
  273. getPrint,
  274. getweighingList,
  275. getinspectLookGoods,
  276. } from '@/model/houseSelfCollect/index'
  277. import weightCheckPrint from './component/weightCheckPrint.vue'
  278. import BalanceAlert from '@/components/balanceAlert'
  279. import html2canvas from 'html2canvas'
  280. import axios from 'axios'
  281. export default {
  282. components: {
  283. weightCheckPrint,
  284. BalanceAlert,
  285. },
  286. watch: {
  287. weighingList: {
  288. //深度监听,可监听到对象、数组的变化
  289. handler(val, oldVal) {
  290. if (val.tare) {
  291. if (this.weighingList.buckleMiscellaneous) {
  292. this.weighingList.netWeight =
  293. this.weighingList.grossWeight -
  294. val.tare -
  295. this.weighingList.buckleMiscellaneous
  296. } else {
  297. this.weighingList.netWeight =
  298. this.weighingList.grossWeight - val.tare
  299. }
  300. }
  301. },
  302. deep: true, //true 深度监听
  303. },
  304. },
  305. data() {
  306. return {
  307. isShowBalance: false,
  308. currentPage: 1,
  309. pageSize: 100,
  310. deptCircularPage: {},
  311. deptBudgetTotal: 0,
  312. pList: [],
  313. mList: [],
  314. index: 0,
  315. status: 1,
  316. carList: [],
  317. carWeightInfo: {
  318. carNumber: '',
  319. type: '',
  320. weight: '',
  321. },
  322. currentRow: null,
  323. inspect: {},
  324. types: 1,
  325. information: '',
  326. weighingList: {
  327. grossWeight: 0,
  328. tare: 0,
  329. buckleMiscellaneous: 0,
  330. netWeight: 0,
  331. receivableWeighingFee: '',
  332. },
  333. outchecked:false,
  334. inshipments:'',
  335. outshipments:'',
  336. printout:false,
  337. deptBudgetList: {},
  338. tpyeNo: 1,
  339. disabled: true,
  340. relationId: '',
  341. warehouseId: '',
  342. purchasePriceList: [],
  343. isShowPrint: false,
  344. tableData: {},
  345. reader: null,
  346. param: 9600,
  347. monitorUrl1: '',
  348. monitorUrl2: '',
  349. cangid: '',
  350. paramType: '1',
  351. warehouseName: '',
  352. result1: '00',
  353. allowEdit: 0,
  354. mListTop: [],
  355. mListBottom: [],
  356. pListTop: [],
  357. carList1: [],
  358. pListBottom: [],
  359. checked: false,
  360. ddchecked: false,
  361. isShowPrintType: false,
  362. ewCustomerOptions: [{
  363. value: '黑龙江利润元粮食贸易有限公司',
  364. label: '黑龙江利润元粮食贸易有限公司'
  365. }, {
  366. value: '黑龙江众利合粮食贸易有限公司',
  367. label: '黑龙江众利合粮食贸易有限公司'
  368. }, {
  369. value: '黑龙江鑫满仓粮食贸易有限公司',
  370. label: '黑龙江鑫满仓粮食贸易有限公司'
  371. }, {
  372. value: '黑龙江中天昊元贸易有限公司',
  373. label: '黑龙江中天昊元贸易有限公司'
  374. }],
  375. companyNameOptions: [{
  376. value: '黑龙江利润元粮食贸易有限公司',
  377. label: '黑龙江利润元粮食贸易有限公司'
  378. }, {
  379. value: '黑龙江众利合粮食贸易有限公司',
  380. label: '黑龙江众利合粮食贸易有限公司'
  381. }, {
  382. value: '黑龙江鑫满仓粮食贸易有限公司',
  383. label: '黑龙江鑫满仓粮食贸易有限公司'
  384. }, {
  385. value: '黑龙江中天昊元贸易有限公司',
  386. label: '黑龙江中天昊元贸易有限公司'
  387. }, ],
  388. companyNameEWOptions: [{
  389. value: '厦门建发物产有限公司',
  390. label: '厦门建发物产有限公司'
  391. }],
  392. companyName: '黑龙江利润元粮食贸易有限公司',
  393. companyNameEW: '厦门建发物产有限公司',
  394. ewCustomer: '黑龙江利润元粮食贸易有限公司',
  395. ewradio: '',
  396. dialogDataList: [],
  397. printSeparately: false,
  398. idprint: '' //打印id
  399. }
  400. },
  401. mounted() {},
  402. activated() {
  403. console.log(this.common.name)
  404. this.cangid = this.$route.query.cangid
  405. this.paramType = this.$route.query.paramType
  406. this.tpyeNo = this.$route.query.tpyeNo
  407. this.warehouseName = this.$route.query.warehouseName
  408. localStorage.setItem('ck', this.warehouseName)
  409. this.weighingList.warehouseName = this.$route.query.warehouseName
  410. this.deptBudgetList.warehouseName = this.$route.query.warehouseName
  411. this.weighingList.number = this.$route.query.number
  412. this.weighingList.binNumber = this.$route.query.binNumber
  413. this.weighingList.customerNumberCard = this.$route.query.customerNumberCard
  414. this.weighingList.customer = this.$route.query.customer
  415. this.weighingList.storageNumber = this.$route.query.storageNumber
  416. this.weighingList.carNumber = this.$route.query.carNumber
  417. this.weighingList.goodsName = this.$route.query.goodsName
  418. this.weighingList.id = this.$route.query.id
  419. this.weighingList.carModel = this.$route.query.carModel
  420. // this.relationId = this.$route.query.relationId
  421. this.monitorUrl1 = this.$route.query.monitorUrl1
  422. this.monitorUrl2 = this.$route.query.monitorUrl2
  423. this.warehouseId = this.$route.query.warehouseId
  424. if (!this.$route.query.grossWeight) {
  425. this.$route.query.grossWeight = 0
  426. } else {
  427. this.weighingList.grossWeight = this.$route.query.grossWeight
  428. }
  429. // this.purchasePriceList = this.$route.query.purchasePriceList
  430. // console.log(this.purchasePriceList, '上限')
  431. this.allowEdit = this.$route.query.allowEdit
  432. if (this.allowEdit == 0) {
  433. this.disabled = true
  434. } else if (this.allowEdit == 1) {
  435. this.disabled = false
  436. }
  437. if (this.tpyeNo == 1) {
  438. this.information = '毛重'
  439. this.weighingList.tare = 0
  440. } else if (this.tpyeNo == 2) {
  441. this.information = '皮重'
  442. }
  443. // this.$route.query.automaticWeightAcquisition = 0
  444. // if(this.$route.query.automaticWeightAcquisition == '1'){
  445. // this.openPort()
  446. // this.isShowBalance = true
  447. // }
  448. // if (this.$route.query.automaticWeightAcquisition == '1') {
  449. this.isShowBalance = true
  450. // }
  451. console.log(this.weighingList)
  452. this.getList()
  453. },
  454. deactivated() {
  455. // this.closePort()
  456. },
  457. methods: {
  458. changeOut(e) {
  459. if (e) {
  460. this.printout = true
  461. } else {
  462. this.printout = false
  463. }
  464. },
  465. changeEwDD(e) {
  466. this.checked = false
  467. if (e) {
  468. this.printSeparately = true
  469. } else {
  470. this.printSeparately = false
  471. }
  472. },
  473. changeEw(e) {
  474. this.ddchecked = false
  475. if (e) {
  476. this.printSeparately = true
  477. } else {
  478. this.printSeparately = false
  479. }
  480. },
  481. typePrintClick() {
  482. this.dialogDataList = []
  483. getPrint({
  484. id: this.idprint,
  485. })
  486. .toPromise()
  487. .then((response) => {
  488. // this.isShowPrint = true
  489. // this.inspect = response
  490. localStorage.removeItem('print_in_data')
  491. if (response.compName == '黑龙江秋收有限公司') {
  492. this.inspect.compName = '黑龙江中天昊元贸易有限公司'
  493. }
  494. var dialogData = response
  495. if (this.checked) {
  496. this.dialogDataList.push(dialogData)
  497. var _datas = JSON.stringify(dialogData)
  498. _datas = JSON.parse(_datas)
  499. _datas.compName = this.companyNameEW;
  500. _datas.customer = this.ewCustomer
  501. this.dialogDataList.push(_datas)
  502. } else if (this.ddchecked) {
  503. _datas = dialogData
  504. _datas.compName = this.companyNameEW;
  505. _datas.customer = this.ewCustomer
  506. this.dialogDataList.push(_datas)
  507. } else {
  508. dialogData.companyName = this.companyName
  509. this.dialogDataList.push(dialogData)
  510. }
  511. if(this.outchecked){
  512. if(!this.checked&&!this.ddchecked){
  513. this.dialogDataList=[]
  514. var _data = JSON.parse(JSON.stringify(dialogData))
  515. this.$set(_data,'printtype','out')
  516. _data.compName = this.outshipments;
  517. _data.customer = this.inshipments
  518. this.dialogDataList.push(_data)
  519. }else{
  520. var _data = JSON.parse(JSON.stringify(dialogData))
  521. this.$set(_data,'printtype','out')
  522. _data.compName = this.outshipments;
  523. _data.customer = this.inshipments
  524. this.dialogDataList.push(_data)
  525. }
  526. }
  527. console.log('保存打印', this.dialogDataList)
  528. localStorage.setItem('print_in_data',JSON.stringify(this.dialogDataList).replace(/%/g, 'baifenhao'))
  529. window.open(
  530. '../../../../static/weightCheck.html?type=2&tableData=' +
  531. JSON.stringify(this.dialogDataList).replace(/%/g, 'baifenhao'))
  532. })
  533. .catch((response) => {
  534. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  535. })
  536. },
  537. setVal(data) {
  538. if (this.information == '毛重') {
  539. this.weighingList.grossWeight = data
  540. } else {
  541. this.weighingList.tare = data
  542. }
  543. },
  544. openPort() {
  545. this.$refs.weightChild.openPort()
  546. },
  547. cutstatus(status) {
  548. this.status = status
  549. if (status == 1) {
  550. this.carList = this.carList1.filter(function(item) {
  551. return item.status == '已质检'
  552. })
  553. } else {
  554. this.carList = this.carList1.filter(function(item) {
  555. return item.status == '已称毛重'
  556. })
  557. }
  558. },
  559. handleSizeChange(val) {
  560. console.log(`每页 ${val} 条`)
  561. this.pageSize = val
  562. this.getList()
  563. },
  564. getList() {
  565. // 货名
  566. getinspectLookGoods({
  567. warehouseId: this.cangid,
  568. })
  569. .toPromise()
  570. .then((response) => {
  571. this.purchasePriceList = response
  572. })
  573. getweighingList({
  574. compId: localStorage.getItem('ws-pf_compId'),
  575. currentPage: this.currentPage,
  576. pageSize: this.pageSize,
  577. searchKeyWord: '',
  578. warehouseName: localStorage.getItem('ck'),
  579. managementType: 1,
  580. // viewFlag:'1'
  581. })
  582. .toPromise()
  583. .then((response) => {
  584. // for (let i = 0; i < response.records.length; i++) {
  585. // if (response.records[i].paymentManagement) {
  586. // if (response.records[i].paymentManagement.status == '待结算' && !response.records[i].paymentManagement
  587. // .approveStatus) {
  588. // response.records[i].allow = 1
  589. // } else {
  590. // response.records[i].allow = 2
  591. // }
  592. // } else {
  593. // response.records[i].allow = 1
  594. // }
  595. // }
  596. this.weighingList = response.records
  597. this.common.commonWeighingList = response.records
  598. this.makeData()
  599. })
  600. .catch((response) => {
  601. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  602. })
  603. },
  604. makeData() {
  605. this.mList = []
  606. this.pList = []
  607. this.mListTop = []
  608. this.mListBottom = []
  609. this.pListTop = []
  610. this.pListBottom = []
  611. this.carWeightInfo.carNumber = ''
  612. this.weighingList = []
  613. let that = this
  614. console.log(this.common.commonWeighingList, 'commonWeighingList')
  615. let _list = this.common.commonWeighingList
  616. for (let i = 0; i < _list.length; i++) {
  617. if (_list[i].paymentManagement) {
  618. if (
  619. _list[i].paymentManagement.status != '待结算' ||
  620. _list[i].paymentManagement.approveStatus
  621. ) {
  622. continue
  623. }
  624. }
  625. if (_list[i].status == '已质检') {
  626. this.mListTop.push(_list[i])
  627. }
  628. if (_list[i].status == '已称毛重') {
  629. this.mListBottom.push(_list[i])
  630. }
  631. if (_list[i].status == '已称皮重') {
  632. this.pListBottom.push(_list[i])
  633. }
  634. if (_list[i].status == '已称毛重') {
  635. this.pListTop.push(_list[i])
  636. }
  637. }
  638. this.mList = this.mListTop.concat(this.mListBottom)
  639. this.pList = this.pListTop.concat(this.pListBottom)
  640. if (this.information == '毛重') {
  641. this.index = 0
  642. this.carList = this.mList
  643. this.carList1 = this.mList
  644. if (this.mList.length != 0) {
  645. let _item = this.mList.filter(function(val) {
  646. console.log(that.$route.query.id)
  647. if (val.id == that.$route.query.id) {
  648. return val
  649. }
  650. })
  651. if (_item.length != 0) {
  652. this.setCurrent(_item[0])
  653. this.weighingList = _item[0]
  654. this.carWeightInfo = {
  655. carNumber: _item[0].carNumber,
  656. type: this.information,
  657. weight: this.weighingList.grossWeight,
  658. }
  659. this.weighingList = _item[0]
  660. } else {
  661. this.setCurrent(this.mList[0])
  662. this.weighingList = this.mList[0]
  663. this.carWeightInfo = {
  664. carNumber: this.mList[0].carNumber,
  665. type: this.information,
  666. weight: this.weighingList.grossWeight,
  667. }
  668. }
  669. }
  670. } else {
  671. this.index = 1
  672. this.carList = this.pList
  673. this.carList1 = this.pList
  674. if (this.pList.length != 0) {
  675. let _item = this.pList.filter(function(val1) {
  676. if (val1.id == that.$route.query.id) {
  677. return val1
  678. }
  679. })
  680. if (_item.length != 0) {
  681. this.setCurrent(_item[0])
  682. this.weighingList = _item[0]
  683. this.carWeightInfo = {
  684. carNumber: _item[0].carNumber,
  685. type: this.information,
  686. weight: this.weighingList.tare
  687. }
  688. } else {
  689. this.setCurrent(this.pList[0])
  690. this.weighingList = this.pList[0]
  691. this.carWeightInfo = {
  692. carNumber: this.pList[0].carNumber,
  693. type: this.information,
  694. weight: this.weighingList.tare
  695. }
  696. }
  697. }
  698. if (_item.length != 0) {
  699. this.setCurrent(_item[0])
  700. this.weighingList = _item[0]
  701. this.carWeightInfo = {
  702. carNumber: _item[0].carNumber,
  703. type: this.information,
  704. weight: this.weighingList.tare,
  705. }
  706. } else {
  707. this.setCurrent(this.pList[0])
  708. this.weighingList = this.pList[0]
  709. this.carWeightInfo = {
  710. carNumber: this.pList[0].carNumber,
  711. type: this.information,
  712. weight: this.weighingList.tare,
  713. }
  714. }
  715. this.deptBudgetTotal = this.pList.length
  716. }
  717. this.weighingList.carModel =
  718. this.weighingList.qualityInspectionManagement.carModel
  719. if (this.weighingList.carModel == '单拖小柜') {
  720. this.weighingList.receivableWeighingFee = 80
  721. this.weighingList.actualWeighingFee = 80
  722. } else if (this.weighingList.carModel == '双拖小柜') {
  723. this.weighingList.receivableWeighingFee = 160
  724. this.weighingList.actualWeighingFee = 160
  725. } else if (this.weighingList.carModel == '大柜') {
  726. if (this.weighingList.grossWeight / 1000 < 50) {
  727. this.$set(this.weighingList, 'receivableWeighingFee', 120)
  728. this.weighingList.actualWeighingFee = 120
  729. this.$forceUpdate()
  730. } else if (
  731. this.weighingList.grossWeight / 1000 > 50 ||
  732. this.weighingList.grossWeight / 1000 < 65
  733. ) {
  734. this.weighingList.receivableWeighingFee = 150
  735. this.weighingList.actualWeighingFee = 150
  736. } else if (
  737. this.weighingList.grossWeight / 1000 > 65 ||
  738. this.weighingList.grossWeight / 1000 < 75
  739. ) {
  740. this.weighingList.receivableWeighingFee = 170
  741. this.weighingList.actualWeighingFee = 170
  742. } else if (
  743. this.weighingList.grossWeight / 1000 > 75 ||
  744. this.weighingList.grossWeight / 1000 < 80
  745. ) {
  746. this.weighingList.receivableWeighingFee = 190
  747. this.weighingList.actualWeighingFee = 190
  748. } else if (
  749. this.weighingList.grossWeight / 1000 > 80 ||
  750. this.weighingList.grossWeight / 1000 < 85
  751. ) {
  752. this.weighingList.receivableWeighingFee = 210
  753. this.weighingList.actualWeighingFee = 210
  754. } else if (
  755. this.weighingList.grossWeight / 1000 > 85 ||
  756. this.weighingList.grossWeight / 1000 < 95
  757. ) {
  758. this.weighingList.receivableWeighingFee = 240
  759. this.weighingList.actualWeighingFee = 240
  760. } else if (
  761. this.weighingList.grossWeight / 1000 > 95 ||
  762. this.weighingList.grossWeight / 1000 < 105
  763. ) {
  764. this.weighingList.receivableWeighingFee = 260
  765. this.weighingList.actualWeighingFee = 260
  766. } else if (
  767. this.weighingList.grossWeight / 1000 > 105 ||
  768. this.weighingList.grossWeight / 1000 < 150
  769. ) {
  770. this.weighingList.receivableWeighingFee = 300
  771. this.weighingList.actualWeighingFee = 300
  772. }
  773. } else if (this.weighingList.carModel == '挂车') {
  774. if (this.weighingList.grossWeight / 1000 < 50) {
  775. this.weighingList.receivableWeighingFee = 180
  776. this.weighingList.actualWeighingFee = 180
  777. } else if (
  778. this.weighingList.grossWeight / 1000 > 50 ||
  779. this.weighingList.grossWeight / 1000 < 65
  780. ) {
  781. this.weighingList.receivableWeighingFee = 200
  782. this.weighingList.actualWeighingFee = 200
  783. } else if (
  784. this.weighingList.grossWeight / 1000 > 65 ||
  785. this.weighingList.grossWeight / 1000 < 75
  786. ) {
  787. this.weighingList.receivableWeighingFee = 250
  788. this.weighingList.actualWeighingFee = 250
  789. } else if (
  790. this.weighingList.grossWeight / 1000 > 75 ||
  791. this.weighingList.grossWeight / 1000 < 85
  792. ) {
  793. this.weighingList.receivableWeighingFee = 350
  794. this.weighingList.actualWeighingFee = 350
  795. } else if (
  796. this.weighingList.grossWeight / 1000 > 85 ||
  797. this.weighingList.grossWeight / 1000 < 95
  798. ) {
  799. this.weighingList.receivableWeighingFee = 400
  800. this.weighingList.actualWeighingFee = 400
  801. } else if (
  802. this.weighingList.grossWeight / 1000 > 95 ||
  803. this.weighingList.grossWeight / 1000 < 105
  804. ) {
  805. this.weighingList.receivableWeighingFee = 450
  806. this.weighingList.actualWeighingFee = 450
  807. } else if (
  808. this.weighingList.grossWeight / 1000 > 105 ||
  809. this.weighingList.grossWeight / 1000 < 120
  810. ) {
  811. this.weighingList.receivableWeighingFee = 500
  812. this.weighingList.actualWeighingFee = 500
  813. } else if (
  814. this.weighingList.grossWeight / 1000 > 120 ||
  815. this.weighingList.grossWeight / 1000 < 130
  816. ) {
  817. this.weighingList.receivableWeighingFee = 550
  818. this.weighingList.actualWeighingFee = 550
  819. } else if (
  820. this.weighingList.grossWeight / 1000 > 130 ||
  821. this.weighingList.grossWeight / 1000 < 150
  822. ) {
  823. this.weighingList.receivableWeighingFee = 700
  824. this.weighingList.actualWeighingFee = 700
  825. }
  826. } else if (this.weighingList.carModel == '冷藏箱(不抠箱)') {
  827. if (this.weighingList.grossWeight / 1000 < 50) {
  828. this.weighingList.receivableWeighingFee = 120
  829. this.weighingList.actualWeighingFee = 120
  830. } else if (
  831. this.weighingList.grossWeight / 1000 > 50 ||
  832. this.weighingList.grossWeight / 1000 < 65
  833. ) {
  834. this.weighingList.receivableWeighingFee = 150
  835. this.weighingList.actualWeighingFee = 150
  836. } else if (
  837. this.weighingList.grossWeight / 1000 > 65 ||
  838. this.weighingList.grossWeight / 1000 < 75
  839. ) {
  840. this.weighingList.receivableWeighingFee = 170
  841. this.weighingList.actualWeighingFee = 170
  842. } else if (
  843. this.weighingList.grossWeight / 1000 > 75 ||
  844. this.weighingList.grossWeight / 1000 < 80
  845. ) {
  846. this.weighingList.receivableWeighingFee = 190
  847. this.weighingList.actualWeighingFee = 190
  848. } else if (
  849. this.weighingList.grossWeight / 1000 > 80 ||
  850. this.weighingList.grossWeight / 1000 < 85
  851. ) {
  852. this.weighingList.receivableWeighingFee = 210
  853. this.weighingList.actualWeighingFee = 210
  854. } else if (
  855. this.weighingList.grossWeight / 1000 > 85 ||
  856. this.weighingList.grossWeight / 1000 < 95
  857. ) {
  858. this.weighingList.receivableWeighingFee = 240
  859. this.weighingList.actualWeighingFee = 240
  860. } else if (
  861. this.weighingList.grossWeight / 1000 > 95 ||
  862. this.weighingList.grossWeight / 1000 < 105
  863. ) {
  864. this.weighingList.receivableWeighingFee = 260
  865. this.weighingList.actualWeighingFee = 260
  866. } else if (
  867. this.weighingList.grossWeight / 1000 > 105 ||
  868. this.weighingList.grossWeight / 1000 < 120
  869. ) {
  870. this.weighingList.receivableWeighingFee = 300
  871. this.weighingList.actualWeighingFee = 300
  872. }
  873. } else if (this.weighingList.carModel == '冷藏箱(抠箱)') {
  874. if (this.weighingList.grossWeight / 1000 < 50) {
  875. this.weighingList.receivableWeighingFee = 360
  876. this.weighingList.actualWeighingFee = 360
  877. } else if (
  878. this.weighingList.grossWeight / 1000 > 50 ||
  879. this.weighingList.grossWeight / 1000 < 65
  880. ) {
  881. this.weighingList.receivableWeighingFee = 390
  882. this.weighingList.actualWeighingFee = 390
  883. } else if (
  884. this.weighingList.grossWeight / 1000 > 65 ||
  885. this.weighingList.grossWeight / 1000 < 75
  886. ) {
  887. this.weighingList.receivableWeighingFee = 410
  888. this.weighingList.actualWeighingFee = 410
  889. } else if (
  890. this.weighingList.grossWeight / 1000 > 75 ||
  891. this.weighingList.grossWeight / 1000 < 80
  892. ) {
  893. this.weighingList.receivableWeighingFee = 430
  894. this.weighingList.actualWeighingFee = 430
  895. } else if (
  896. this.weighingList.grossWeight / 1000 > 80 ||
  897. this.weighingList.grossWeight / 1000 < 85
  898. ) {
  899. this.weighingList.receivableWeighingFee = 450
  900. this.weighingList.actualWeighingFee = 450
  901. } else if (
  902. this.weighingList.grossWeight / 1000 > 85 ||
  903. this.weighingList.grossWeight / 1000 < 95
  904. ) {
  905. this.weighingList.receivableWeighingFee = 480
  906. this.weighingList.actualWeighingFee = 480
  907. } else if (
  908. this.weighingList.grossWeight / 1000 > 95 ||
  909. this.weighingList.grossWeight / 1000 < 105
  910. ) {
  911. this.weighingList.receivableWeighingFee = 500
  912. this.weighingList.actualWeighingFee = 500
  913. } else if (
  914. this.weighingList.grossWeight / 1000 > 105 ||
  915. this.weighingList.grossWeight / 1000 < 120
  916. ) {
  917. this.weighingList.receivableWeighingFee = 540
  918. this.weighingList.actualWeighingFee = 540
  919. }
  920. } else {
  921. this.weighingList.receivableWeighingFee = ''
  922. }
  923. },
  924. tabClick(val) {
  925. this.mListTop = []
  926. this.mListBottom = []
  927. this.pListTop = []
  928. this.pListBottom = []
  929. this.carWeightInfo.carNumber = ''
  930. this.weighingList = []
  931. this.index = val
  932. if (this.information == '皮重') {
  933. this.information = '毛重'
  934. this.tpyeNo = 1
  935. } else {
  936. this.tpyeNo = 2
  937. this.information = '皮重'
  938. }
  939. this.getList()
  940. },
  941. setCurrent(row) {
  942. this.$refs.singleTable.setCurrentRow(row)
  943. },
  944. handleCurrentChange(val) {
  945. this.currentRow = val
  946. this.carWeightInfo = {
  947. carNumber: val.carNumber,
  948. type: this.information,
  949. weight: val.grossWeight,
  950. }
  951. this.weighingList = val
  952. this.paramType = val.qualityInspectionManagement.paramType
  953. },
  954. cancel() {
  955. if (this.reader) {
  956. this.reader.cancel()
  957. }
  958. this.$router.push({
  959. path: 'weighingManagement',
  960. })
  961. },
  962. calculation(status) {
  963. // if (this.weighingList.grossWeight && this.weighingList.tare) {
  964. // this.weighingList.netWeight = this.weighingList.grossWeight - this.weighingList.tare - parseInt(this.weighingList.buckleMiscellaneous)
  965. // this.weighingList.netWeight = this.weighingList.netWeight.toFixed(2)
  966. // }
  967. },
  968. printSmall() {
  969. window.open(
  970. '../../../../static/weightCheck.html?type=1&tableData=' +
  971. JSON.stringify(this.inspect).replace(/%/g, 'baifenhao'))
  972. },
  973. printBig() {
  974. window.open(
  975. '../../../../static/weightCheck.html?type=2&tableData=' +
  976. JSON.stringify(this.inspect).replace(/%/g, 'baifenhao'))
  977. },
  978. opendBtn() {
  979. html2canvas(this.$refs.saveImg.$el).then((canvas) => {
  980. let dataURL = canvas.toDataURL('image/png')
  981. this.imgUrl = dataURL
  982. if (this.imgUrl !== '') {
  983. let b = this.dataURLtoFile(this.imgUrl, 'printImage')
  984. let formdata = new FormData()
  985. formdata.append('file', b)
  986. axios({
  987. method: 'post',
  988. url:this.global.uploadPath,
  989. data: formdata,
  990. }).then((response) => {
  991. //编辑接口
  992. this.weighingList.pictureAddress = response.data.url
  993. tare(this.weighingList)
  994. .toPromise()
  995. .then((response) => {})
  996. })
  997. }
  998. })
  999. },
  1000. closeDialog() {
  1001. html2canvas(this.$refs.saveImg.$el).then((canvas) => {
  1002. let dataURL = canvas.toDataURL('image/png')
  1003. this.imgUrl = dataURL
  1004. if (this.imgUrl !== '') {
  1005. let b = this.dataURLtoFile(this.imgUrl, 'printImage')
  1006. let formdata = new FormData()
  1007. formdata.append('file', b)
  1008. axios({
  1009. method: 'post',
  1010. url:this.global.uploadPath,
  1011. data: formdata,
  1012. }).then((response) => {
  1013. //编辑接口
  1014. this.weighingList.pictureAddress = response.data.url
  1015. tare(this.weighingList)
  1016. .toPromise()
  1017. .then((response) => {})
  1018. })
  1019. this.dialogTableVisible = true
  1020. }
  1021. })
  1022. this.isShowPrint = false
  1023. // this.$router.push({
  1024. // path: 'weighingManagement'
  1025. // })
  1026. },
  1027. closePrint() {
  1028. this.isShowPrint = false
  1029. // this.$router.push({
  1030. // path: 'weighingManagement'
  1031. // })
  1032. },
  1033. print() {
  1034. if (this.reader) {
  1035. this.reader.cancel()
  1036. }
  1037. if (!this.weighingList.grossWeight) {
  1038. this.$message({
  1039. message: '毛重不能为空',
  1040. type: 'warning',
  1041. })
  1042. return
  1043. }
  1044. if (
  1045. this.weighingList.grossWeight < 1 ||
  1046. this.weighingList.grossWeight > 200000
  1047. ) {
  1048. this.$message({
  1049. message: '毛重输入错误',
  1050. type: 'warning',
  1051. })
  1052. return
  1053. }
  1054. if (
  1055. String(this.weighingList.grossWeight).indexOf('.') != -1 &&
  1056. String(this.weighingList.grossWeight).length -
  1057. (String(this.weighingList.grossWeight).indexOf('.') + 1) >
  1058. 1
  1059. ) {
  1060. this.$message({
  1061. message: '毛重输入错误',
  1062. type: 'warning',
  1063. })
  1064. return
  1065. }
  1066. if (this.tpyeNo == 2) {
  1067. if (!this.weighingList.tare) {
  1068. this.$message({
  1069. message: '皮重不能为空',
  1070. type: 'warning',
  1071. })
  1072. return
  1073. }
  1074. if (!this.weighingList.tare) {
  1075. this.$message({
  1076. message: '皮重不能为空',
  1077. type: 'warning',
  1078. })
  1079. return
  1080. }
  1081. if (this.weighingList.tare > this.weighingList.grossWeight) {
  1082. this.$message({
  1083. message: '皮重不能大于毛重',
  1084. type: 'warning',
  1085. })
  1086. return
  1087. }
  1088. if (this.weighingList.tare < 1 || this.weighingList.tare > 100000) {
  1089. this.$message({
  1090. message: '皮重输入错误',
  1091. type: 'warning',
  1092. })
  1093. return
  1094. }
  1095. if (
  1096. String(this.weighingList.tare).indexOf('.') != -1 &&
  1097. String(this.weighingList.tare).length -
  1098. (String(this.weighingList.tare).indexOf('.') + 1) >
  1099. 1
  1100. ) {
  1101. this.$message({
  1102. message: '皮重输入错误',
  1103. type: 'warning',
  1104. })
  1105. return
  1106. }
  1107. if (this.weighingList.netWeight < 0) {
  1108. this.$message({
  1109. message: '净重不能小于0',
  1110. type: 'warning',
  1111. })
  1112. return
  1113. }
  1114. }
  1115. this.$confirm('确定保存检斤信息?', '提示', {
  1116. confirmButtonText: '确定',
  1117. cancelButtonText: '取消',
  1118. type: 'warning',
  1119. })
  1120. .then(() => {
  1121. if (this.tpyeNo == 1) {
  1122. //毛检保存前进行校验
  1123. getamount({
  1124. compId: localStorage.getItem('ws-pf_compId'),
  1125. customerNumberCard: this.weighingList.customerNumberCard,
  1126. goodsName: this.weighingList.goodsName,
  1127. })
  1128. .toPromise()
  1129. .then((response) => {
  1130. for (let i = 0; i < this.purchasePriceList.length; i++) {
  1131. if (
  1132. this.weighingList.goodsName ==
  1133. this.purchasePriceList[i].goodsName
  1134. ) {
  1135. //累计售粮超上限不能完成毛检保存
  1136. let count = (
  1137. this.purchasePriceList[i].saleLimit -
  1138. response / 1000
  1139. ).toFixed(2)
  1140. // console.log(this.weighingList.grossWeight / 1000, '毛重转吨')
  1141. // this.weighingList.grossWeight/=1000
  1142. if (count - this.weighingList.grossWeight / 1000 < 0) {
  1143. this.$alert(
  1144. '该客户累计销售' +
  1145. this.weighingList.goodsName +
  1146. (response / 1000).toFixed(2) +
  1147. '吨,还可售粮' +
  1148. count +
  1149. '吨',
  1150. '提示', {
  1151. confirmButtonText: '确定',
  1152. callback: (action) => {
  1153. this.$message({
  1154. type: 'info',
  1155. message: `累计售粮已超出上限`,
  1156. })
  1157. },
  1158. }
  1159. )
  1160. } else {
  1161. //累计售粮没有超上限完成毛检保存
  1162. // this.weighingList.relationId = this.relationId;
  1163. (this.weighingList.secretaryWeigher =
  1164. localStorage.getItem('ws-pf_staffName')),
  1165. grossWeight(this.weighingList)
  1166. .toPromise()
  1167. .then((response) => {
  1168. if (this.reader) {
  1169. this.reader.cancel()
  1170. }
  1171. this.$notify.success({
  1172. title: '成功',
  1173. message: '保存成功',
  1174. })
  1175. // this.$router.go(-1)
  1176. })
  1177. .catch((response) => {
  1178. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1179. })
  1180. }
  1181. }
  1182. }
  1183. })
  1184. } else if (this.tpyeNo == 2) {
  1185. // this.weighingList.grossWeight/=1000
  1186. // this.weighingList.tare/=1000
  1187. // if(this.weighingList.buckleMiscellaneous){
  1188. // this.weighingList.buckleMiscellaneous/=1000
  1189. // }
  1190. // this.weighingList.netWeight/=1000
  1191. this.weighingList.warehouseId = this.warehouseId;
  1192. (this.weighingList.skinInspector =
  1193. localStorage.getItem('ws-pf_staffName')),
  1194. tare(this.weighingList)
  1195. .toPromise()
  1196. .then((response) => {
  1197. this.idprint = response
  1198. if (this.reader) {
  1199. this.reader.cancel()
  1200. }
  1201. this.isShowPrintType = true
  1202. this.$notify.success({
  1203. title: '成功',
  1204. message: '保存成功',
  1205. })
  1206. })
  1207. .catch((response) => {
  1208. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1209. })
  1210. }
  1211. })
  1212. .catch(() => {
  1213. return false
  1214. })
  1215. },
  1216. },
  1217. }
  1218. </script>
  1219. <style lang="scss" scoped>
  1220. /deep/.el-pagination {
  1221. margin-bottom: 0;
  1222. }
  1223. .center {
  1224. background: #f6f7fc;
  1225. }
  1226. .ws-info-table {
  1227. border: none;
  1228. // height: 610px;
  1229. }
  1230. .ws-info-table .el-form-item {
  1231. width: 100%;
  1232. border: none;
  1233. }
  1234. .formItem {
  1235. width: 100%;
  1236. display: inline;
  1237. }
  1238. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1239. width: 30%;
  1240. text-align: center;
  1241. background: #ffffff;
  1242. font-size: 14px;
  1243. color: #8890b1;
  1244. }
  1245. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1246. border: none;
  1247. }
  1248. .title {
  1249. font-size: 16px;
  1250. font-weight: 600;
  1251. margin: 10px;
  1252. }
  1253. .titleup {
  1254. position: relative;
  1255. }
  1256. .title::before {
  1257. content: '';
  1258. display: inline-block;
  1259. width: 5px;
  1260. height: 15px;
  1261. background: #8890b1;
  1262. margin-right: 5px;
  1263. }
  1264. .substance {
  1265. padding-bottom: 20px;
  1266. overflow-y: scroll;
  1267. .active {
  1268. background: #5878e8;
  1269. color: white;
  1270. }
  1271. // background: #ffffff;
  1272. width: 100%;
  1273. height: calc(100vh - 125px);
  1274. border-radius: 4px;
  1275. margin: 0 auto;
  1276. display: flex;
  1277. .left {
  1278. min-width: 570px;
  1279. position: relative;
  1280. // padding:0 20px 20px 20px;
  1281. .top {
  1282. background: black;
  1283. color: #2aff7c;
  1284. font-size: 32px;
  1285. text-align: right;
  1286. padding: 0 10px 0 20px;
  1287. border-radius: 10px;
  1288. margin: 0 20px 20px 20px;
  1289. position: absolute;
  1290. top: 130px;
  1291. width: 90%;
  1292. .zujian {
  1293. position: relative;
  1294. }
  1295. // .car-type {
  1296. // text-align: left;
  1297. // }
  1298. .kg-style {
  1299. font-size: 30px;
  1300. }
  1301. .confirmInfo {
  1302. display: flex;
  1303. .car-type {
  1304. text-align: left;
  1305. width: 50%;
  1306. }
  1307. .car-no {
  1308. width: 50%;
  1309. text-align: right;
  1310. }
  1311. }
  1312. .confirmWeight {
  1313. display: flex;
  1314. .titleWeight {
  1315. width: 35%;
  1316. text-align: left;
  1317. line-height: 90px;
  1318. }
  1319. .weight {
  1320. width: 65%;
  1321. text-align: right;
  1322. }
  1323. }
  1324. }
  1325. .bottom {
  1326. text-align: center;
  1327. background: white;
  1328. margin: 20px 20px 0 20px;
  1329. border-radius: 10px;
  1330. padding-bottom: 20px;
  1331. .img1,
  1332. .img2 {
  1333. width: 200px;
  1334. padding: 20px;
  1335. }
  1336. .video-content {
  1337. width: 100%;
  1338. }
  1339. }
  1340. }
  1341. .right {
  1342. width: 70%;
  1343. padding: 20px;
  1344. height: 750px;
  1345. background: white;
  1346. border-radius: 10px;
  1347. .tab {
  1348. display: flex;
  1349. .tab-item {
  1350. padding: 5px 10px;
  1351. margin-right: 20px;
  1352. border-radius: 10px;
  1353. }
  1354. }
  1355. .table-title {
  1356. background: red;
  1357. .top {
  1358. display: inline-block;
  1359. width: 48%;
  1360. .top-item {
  1361. display: inline-block;
  1362. }
  1363. }
  1364. }
  1365. .table {
  1366. background: red;
  1367. .table-content {
  1368. background: green;
  1369. display: inline-block;
  1370. width: 50%;
  1371. .table-content-item {
  1372. display: inline-block;
  1373. }
  1374. }
  1375. }
  1376. }
  1377. }
  1378. /deep/.el-table .el-table__header .cell,
  1379. /deep/.el-table .el-table__body .cell {
  1380. text-align: center;
  1381. font-size: 16px;
  1382. // background: #f6f7fc;
  1383. }
  1384. /deep/.el-table td {
  1385. background: #e7e8ef;
  1386. }
  1387. /deep/.el-table--enable-row-transition .el-table__body td {
  1388. text-align: center;
  1389. }
  1390. .bg-left {
  1391. padding-left: 30px;
  1392. }
  1393. .bg-right {
  1394. padding-right: 10px;
  1395. text-align: right;
  1396. }
  1397. .bg-bottom {
  1398. margin: 15px 0px;
  1399. }
  1400. .titleup {
  1401. position: relative;
  1402. }
  1403. .titleup::before {
  1404. content: '';
  1405. display: inline-block;
  1406. width: 5px;
  1407. height: 30px;
  1408. background: #5473e8;
  1409. position: absolute;
  1410. left: 0;
  1411. }
  1412. .but {
  1413. text-align: center;
  1414. margin: 20px auto;
  1415. }
  1416. .butCss {
  1417. opacity: 0;
  1418. }
  1419. /deep/.el-dialog__title {
  1420. font-size: 24px !important;
  1421. }
  1422. /deep/.el-dialog__header {
  1423. text-align: center !important;
  1424. padding: 10px 0 !important;
  1425. height: auto !important;
  1426. }
  1427. .weight {
  1428. font-size: 68px;
  1429. }
  1430. .right-content {
  1431. display: flex;
  1432. .left {
  1433. position: relative;
  1434. .but {
  1435. position: absolute;
  1436. left: 0;
  1437. right: 0;
  1438. margin: auto;
  1439. }
  1440. }
  1441. .left {
  1442. width: 40%;
  1443. }
  1444. .right {
  1445. width: 60%;
  1446. }
  1447. }
  1448. .car-right {
  1449. width: 60%;
  1450. }
  1451. .mask {
  1452. background: black;
  1453. width: 100vw;
  1454. height: 100vh;
  1455. position: fixed;
  1456. top: 0;
  1457. z-index: 99;
  1458. opacity: 0.3;
  1459. }
  1460. .print-type-title {
  1461. text-align: center;
  1462. font-size: 18px;
  1463. margin: 20px;
  1464. }
  1465. .bottom-btn {
  1466. display: flex;
  1467. margin-top: 20px;
  1468. justify-content: space-around;
  1469. }
  1470. .print-type-checkbox {
  1471. // padding-left: 20px;
  1472. }
  1473. .print-type {
  1474. position: absolute;
  1475. top: 0;
  1476. bottom: 0;
  1477. left: 0;
  1478. right: 0;
  1479. margin: auto;
  1480. width: 440px;
  1481. height: 320px;
  1482. background: white;
  1483. border-radius: 10px;
  1484. z-index: 999;
  1485. }
  1486. .sh-address {
  1487. display: flex;
  1488. }
  1489. .print-type-ew {
  1490. display: flex;
  1491. justify-content: space-between;
  1492. padding: 0 20px;
  1493. /deep/.el-radio__label {
  1494. font-size: 14px;
  1495. }
  1496. margin-top: 10px;
  1497. }
  1498. /deep/.el-table .cell {
  1499. text-align: center;
  1500. }
  1501. .shdw-style {
  1502. display: flex;
  1503. justify-content: space-between;
  1504. align-items: center;
  1505. padding: 0 20px;
  1506. margin-top: 20px;
  1507. }
  1508. .ew-print {
  1509. padding: 0 20px;
  1510. margin-top: 10px;
  1511. // display: flex;
  1512. // justify-content: space-between;
  1513. // align-content: center;
  1514. .row {
  1515. display: flex;
  1516. margin-top: 10px;
  1517. align-items: center;
  1518. }
  1519. }
  1520. </style>