12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316 |
- <!--质检信息-->
- <template>
- <div class="container">
- <el-row>
- <el-col :span="12">
- <h2 class="bg-left titleup">{{ information }}信息</h2>
- </el-col>
- <el-col :span="12" class="bg-right">
- <el-button class="bg-bottom" type="primary" size="small" @click="cancel"><img width="6" height="10"
- style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
- </el-button>
- </el-col>
- </el-row>
- <div class="substance">
- <ws-form>
- <div style="width: 80%; margin: 0 auto">
- <div class="title">基本信息</div>
- <ws-info-table>
- <ws-form-item label="仓库" span="1" prop="warehouseName">
- <ws-input v-model="warehouseName" placeholder="请输入仓库" maxlength="100" disabled size="small" />
- </ws-form-item>
- <ws-form-item label="编号" span="1" prop="qualityNo">
- <ws-input v-model="inspect.qualityNo" placeholder="请输入编号" maxlength="100" disabled size="small" />
- </ws-form-item>
- <ws-form-item label="仓位号" span="1" prop="binNumber">
- <ws-select v-model="inspect.binNumber" placeholder="请输入仓位号" class="typeselect" :disabled="disabled">
- <ws-option v-for="item in getbinNumberList" :key="item.value" :label="item.value" :value="item.value" />
- </ws-select>
- </ws-form-item>
- <ws-form-item label="囤位号" span="1" prop="storageTagNo">
- <ws-input v-model="inspect.storageTagNo" placeholder="请输入囤位号" maxlength="15" size="small"
- :disabled="disabled3" />
- </ws-form-item>
- <ws-form-item label="购粮性质" span="1" prop="natureOfGrainPurchase">
- <ws-input v-model="inspect.natureOfGrainPurchase" placeholder="请输入购粮性质" maxlength="10" size="small"
- :disabled="disabled" />
- </ws-form-item>
- <ws-form-item label="货名" span="1" prop="goodsName">
- <ws-select v-model="inspect.goodsName" placeholder="" class="typeselect" :disabled="disabledName" @change="waterContentChange">
- <ws-option v-for="item in goodNameList" :key="item.goodsName" :label="item.goodsName"
- :value="item.goodsName" />
- </ws-select>
- </ws-form-item>
- <ws-form-item label="客户" span="1" prop="customerName">
- <el-select v-model="inspect.customerName" clearable filterable placeholder="请选择" class="typeselect"
- @change="customerChange" :disabled="disabled1">
- <el-option v-for="item in customerList" :key="item.valueKey" :label="item.value" :value="item.value" />
- </el-select>
- </ws-form-item>
- <ws-form-item label="车牌号" span="1" prop="carNumber">
- <!-- <el-select v-model="inspect.carNumber" clearable @blur="selectBlur" filterable placeholder="请选择" class="typeselect" @change="shipperNameChange"
- :disabled="disabled1"> -->
-
- <el-select v-model="inspect.carNumber" clearable filterable allow-create default-first-option placeholder="请选择" class="typeselect" @change="shipperNameChange"
- :disabled="disabled1">
- <el-option v-for="(item,index) in carNumberList" :key="index" :label="item.carNo" :value="index" />
- </el-select>
- <!-- <ws-input @change='carnochange' v-model="inspect.carNumber" placeholder="请输入车牌号" maxlength="10" size="small"
- :disabled="disabled" /> -->
- </ws-form-item>
- <ws-form-item label="箱号-1" span="1" prop="boxNo">
- <ws-input :disabled="disabled" v-model="inspect.boxNo" placeholder="请输入箱号" maxlength="20" size="small" />
- </ws-form-item>
- <ws-form-item label="箱号-2" span="1" prop="boxNoOther">
- <ws-input :disabled="disabled" v-model="inspect.boxNoOther" placeholder="请输入箱号" maxlength="20"
- size="small" />
- </ws-form-item>
- <ws-form-item label="封号-1" span="1" prop="titleNo">
- <ws-input :disabled="disabled" v-model="inspect.titleNo" placeholder="请输入封号" maxlength="20"
- size="small" />
- </ws-form-item>
- <ws-form-item label="封号-2" span="1" prop="titleNoOther">
- <ws-input :disabled="disabled" v-model="inspect.titleNoOther" placeholder="请输入封号" maxlength="20"
- size="small" />
- </ws-form-item>
-
- <ws-form-item v-if="inspect.paramType != '1'" label="扣重比" span="1" prop="buckleWeightRatio">
- <ws-input type="number" @mousewheel.native.prevent v-model="inspect.buckleWeightRatio"
- placeholder="请输入扣重比" maxlength="100" size="small" :disabled="disabled" />
- </ws-form-item>
- <ws-form-item v-else label="扣杂" span="1" prop="buckleWeightRatio">
- <ws-input type="number" style="padding-right:30px" @mousewheel.native.prevent
- v-model="inspect.buckleMiscellaneous" @input="waterContentChange" placeholder="请输入扣杂" maxlength="100"
- size="small" :disabled="disabled" />
- <ws-input v-if='types==4' type="number" @mousewheel.native.prevent v-model="inspect.reBuckleMiscellaneous"
- placeholder="请输入扣杂" maxlength="100" size="small" />
- <ws-input v-else type="number" @mousewheel.native.prevent v-model="inspect.reBuckleMiscellaneous"
- placeholder="未复检" maxlength="100" size="small" disabled />
- </ws-form-item>
- <ws-form-item label="类型" span="1" prop="type">
- <ws-select v-model="inspect.type" disabled @change="typeChange">
- <ws-option v-for="item in typeList" :key="item" :label="item" :value="item" />
- </ws-select>
- </ws-form-item>
- <ws-form-item label="净重单价(元/公斤)" span="1" prop="tidalGrainPrice" v-if="inspect.type == '潮粮'">
- <ws-input type="number" @mousewheel.native.prevent v-model="inspect.tidalGrainPrice" placeholder="请输入净重单价"
- maxlength="10" size="small" />
- </ws-form-item>
- <ws-form-item label="干粮单价(元/公斤)" span="2" prop="dryGrainPrice" v-if="inspect.type == '干粮'">
- <ws-input type="number" @mousewheel.native.prevent v-model="inspect.dryGrainPrice" placeholder="请输入干粮单价"
- maxlength="10" size="small" />
- </ws-form-item>
- <ws-form-item label="复检备注" span="2" prop="reMemo" v-if="information == '编辑复检' || statusShow == '已复检'">
- <ws-input type="textarea" v-model="inspect.reMemo" placeholder="请输入复检备注" maxlength="300" v-if="statusShow != '已复检'" />
- <ws-input type="textarea" v-model="inspect.reMemo" placeholder="请输入复检备注" maxlength="300" v-else disabled />
- </ws-form-item>
- <ws-form-item label="车型" span="2" prop="dryGrainPrice" v-if="types==4&&warehouseName=='鲅鱼圈金信库'||types==2&&warehouseName=='鲅鱼圈金信库'">
- <el-select v-model="inspect.carModel" clearable filterable placeholder="请选择" class="typeselect"
- :disabled="disabled3">
- <el-option v-for="item in cartypeList" :key="item.constValue" :label="item.constValue" :value="item.constValue" />
- </el-select>
- </ws-form-item>
- </ws-info-table>
- <div class="title">质检数据 </div>
- <!-- <div class="title">质检数据 <el-checkbox v-if='types==1||types==3' v-model="checked">补录</el-checkbox></div> -->
- <ws-info-table>
- <ws-form-item label="等级" span="1" prop="grade">
- <ws-select v-model="inspect.grade" placeholder="请输入等级" class="typeselect" :disabled="disabled"
- @change="waterContentChange">
- <ws-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
- :value="item.constValue" />
- </ws-select>
- </ws-form-item>
- <ws-form-item label="杂质(%)" span="1" prop="impurity">
- <ws-input type="number" @mousewheel.native.prevent v-model="inspect.impurity" placeholder="请输入杂质占比"
- maxlength="100" size="small" :disabled="disabled" />
- </ws-form-item>
- <ws-form-item label="水分(%)" span="1" prop="waterContent">
- <ws-input type="number" @mousewheel.native.prevent style="padding-right:30px"
- v-model="inspect.waterContent" placeholder="请输入水分占比" maxlength="100" size="small"
- @change="waterContentChange('water')" :disabled="disabled" />
- <ws-input v-if='types==4' type="number" @mousewheel.native.prevent v-model="inspect.reWaterContent"
- placeholder="请输入水分占比" maxlength="100" size="small" />
- <ws-input v-else type="number" @mousewheel.native.prevent v-model="inspect.reWaterContent"
- placeholder="未复检" maxlength="100" size="small" disabled />
- </ws-form-item>
- <ws-form-item label="霉变粒(%)" span="1" prop="mildewGrain">
- <ws-input type="number" @mousewheel.native.prevent v-model="inspect.mildewGrain" placeholder="请输入霉变粒占比"
- maxlength="100" size="small" :disabled="disabled" />
- </ws-form-item>
- <ws-form-item label="容重(克/升)" span="1" prop="bulkDensity">
- <ws-input type="number" @mousewheel.native.prevent v-model="inspect.bulkDensity" placeholder="请输入容重"
- maxlength="100" size="small" :disabled="disabled" />
- </ws-form-item>
- <ws-form-item label="热损伤(%)" span="1" prop="jiaorenli">
- <ws-input type="number" @mousewheel.native.prevent v-model="inspect.jiaorenli" placeholder="请输入热损伤占比"
- maxlength="100" size="small" :disabled="disabled" />
- </ws-form-item>
- <ws-form-item label="不完善粒(%)" span="1" prop="imperfectGrain">
- <ws-input type="number" @mousewheel.native.prevent v-model="inspect.imperfectGrain"
- placeholder="请输入不完善粒占比" maxlength="100" size="small" :disabled="disabled" />
- </ws-form-item>
- </ws-info-table>
- <div class="but">
- <el-button @click="cancel" v-if="types != 2" type="primary">取消</el-button>
- <el-button @click="checkOk" v-if="types == 4" type="primary">确认初检信息</el-button>
- <el-button @click="print" v-if="types ==3 || types ==1" type="primary">保存</el-button>
- <el-button @click="print" v-if="types == 5 || types==4" type="primary">确认并打印</el-button>
- <el-button @click="cancel" v-if="types == 2" type="primary">关闭</el-button>
- </div>
- </div>
- </ws-form>
- </div>
- <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食质检单" @opened='opendBtn' @close="closeDialog"
- :close-on-click-modal="false">
- <inspectInfoPrint :printData="inspect" ref="saveImg"></inspectInfoPrint>
- <div style="text-align:center">
- <el-button type="primary" @click="closePrint">关闭</el-button>
- <el-button type="primary" @click="printSmall">打印小票</el-button>
- <el-button type="primary" @click="printBig">打印单据</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- inspectAdd,
- getbinNumber,
- getcustomer,
- getinspectLook,
- getinspectLookUnitPrice,
- getinspectLookGoods,
- getinspectEdit,
- getamount,
- getCount,
- getDryGrainPrice,
- getshippinginfo,
- postCheck,
- getQRcode,
- getcartype
- } from '@/model/houseSelfCollect/index'
- import {
- packList
- } from '@/model/contarct/index'
- import inspectInfoPrint from './component/inspectInfoPrint.vue'
- import html2canvas from 'html2canvas'
- import axios from 'axios'
- export default {
- components: {
- inspectInfoPrint,
- },
- watch: {},
- data() {
- return {
- isShowPrint: false,
- customerList1: [],
- // warehouseList: {},
- inspect: {
- tidalGrainPrice: 0,
- buckleWeightRatio: 0,
- natureOfGrainPurchase: '贸易粮',
- buckleMiscellaneous: 0,
- paramType: 1,
- type: '潮粮'
- },
- carNumberList: [],
- disabled: false,
- disabled1: false,
- checked:false,
- disabled2: false,
- disabled3:false,
- disabledName: false,
- types: '1',
- information: '添加初检',
- goodNameList: [],
- gradeList: [],
- customerList: [],
- getbinNumberList: [],
- cartypeList:[],
- cangid: '', //仓库id
- warehouseName: '',
- unitPrice: 0,
- count: 0,
- cangNo: '',
- typeList: ['干粮', '潮粮'],
- purchasePriceList: [],
- id: '',
- imgUrl: '',
- printData: {},
- num: 0,
- tipFlag: true,
- allowEdit: 0,
- statusShow :''
- }
- },
- activated() {
- this.types = this.$route.query.type
- this.allowEdit = this.$route.query.allowEdit
- if (this.allowEdit == 0) {
- this.disabled2 = true
- } else if (this.allowEdit == 1) {
- this.disabled2 = false
- }
- if (!this.types) {
- this.types = 1
- this.information = '添加初检'
- this.disabled = false
- this.inspect = {
- tidalGrainPrice: 0,
- buckleWeightRatio: 0,
- natureOfGrainPurchase: '贸易粮',
- type: '潮粮'
- }
- }
- this.cangid = this.$route.query.cangid
- this.warehouseName = this.$route.query.warehouseName
- this.cangNo = this.$route.query.warehouseNo
- this.count = Number(this.$route.query.count) + 1
- this.statusShow = this.$route.query.status
- // this.purchasePriceList = this.$route.query.purchasePriceList
- this.id = this.$route.query.id
- if (this.types == 2) {
- this.disabled = true
- this.disabled1 = true
- this.disabled2 = true
- this.disabledName = true
- this.disabled3=true
- this.information = '查看质检'
- } else if (this.types == 3) {
- this.disabled = false
- this.disabled1 = true
- this.disabledName = true
- this.information = '编辑初检'
- } else if (this.types == 4) {
- this.disabled = true
- this.disabled1 = true
- this.disabledName = true
- this.information = '编辑复检'
- } else if (this.types == 5) {
- this.disabled = false
- this.disabled1 = true
- this.disabledName = false
- this.information = '确认质检'
- } else {
- this.disabled1 = false
- this.disabled = false
- this.disabledName = false
- }
- this.calculation()
- this.getList(this.id)
- },
- methods: {
- //确认初检信息
- checkOk(){
- this.$confirm('确定初检信息后,初检员不需要再次确认质检信息,是否确认提交', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- postCheck(this.inspect)
- .toPromise()
- .then((response) => {
- postCheck({id:this.id,flag:2})
- .toPromise()
- .then((response) => {
- if(response == 'OK'){
- this.$message.success('提交成功')
- this.$router.push({path: 'inspectionManagement' })
- }else{
- this.$message.error('提交失败')
- }
- })
- }).catch(() => {
- return false
- })
- })
- },
- printSmall() {
- window.open('../../../static/inspection.html?type=1&dataList=' + JSON.stringify(this.inspect))
- },
- printBig() {
- window.open('../../../static/inspection.html?type=2&dataList=' + JSON.stringify(this.inspect))
- },
- getdate() {
- var date = new Date()
- var year = date.getFullYear() //获取完整的年份(4位)
- var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
- var datetime = date.getDate() //获取当前日(1-31)
- if (mouth < 10) {
- mouth = '0' + mouth
- }
- if (datetime < 10) {
- datetime = '0' + datetime
- }
- return String(year) + String(mouth) + String(datetime)
- },
- calculation() {
- let number = '000' + this.count
- number = number.substring(number.length - 4, number.length)
- this.inspect.qualityNo = 'SGRK' + this.getdate() + this.cangNo + number //SGRK+8位时间+3位仓库编号+4位序列号
- },
- selectBlur(e) {
- if (e.target.value) {
- // 不在表单的时候不需要判断,也不需要isname字段
- this.inspect.carNumber = e.target.value;
- // this.isName = true;
- } else {
- // this.isName = false;
- }
- },
- opendBtn(){
- html2canvas(this.$refs.saveImg.$el).then(canvas => {
- let dataURL = canvas.toDataURL('image/png');
- this.imgUrl = dataURL;
- if (this.imgUrl !== '') {
- let b = this.dataURLtoFile(this.imgUrl, 'printImg')
- let formdata = new FormData();
- formdata.append('file', b);
- axios({
- method: 'post',
- url: this.global.uploadPath,
- data: formdata
- }).then((response) => {
- //编辑接口
- this.inspect.pictureAddress = response.data.url
- console.log(this.types)
- if (this.types == 3) {
- this.inspect.flag = 0
- } else if (this.types == 4) {
- this.inspect.flag = 1
- }
- getinspectEdit(this.inspect)
- .toPromise()
- .then((response) => {
- this.types = ''
- // this.inspect = []
-
- })
- })
- }
- })
- },
-
- closeDialog() {
- html2canvas(this.$refs.saveImg.$el).then(canvas => {
- let dataURL = canvas.toDataURL('image/png');
- this.imgUrl = dataURL;
- if (this.imgUrl !== '') {
- let b = this.dataURLtoFile(this.imgUrl, 'printImg')
- let formdata = new FormData();
- formdata.append('file', b);
- axios({
- method: 'post',
- url: this.global.uploadPath,
- data: formdata
- }).then((response) => {
- //编辑接口
- this.inspect.pictureAddress = response.data.url
- console.log(this.types)
- if (this.types == 3) {
- this.inspect.flag = 0
- } else if (this.types == 4) {
- this.inspect.flag = 1
- }
- getinspectEdit(this.inspect)
- .toPromise()
- .then((response) => {
- this.types = ''
- // this.inspect = []
- this.isShowPrint = false
- this.$router.push({
- path: 'inspectionManagement'
- })
- })
- })
- this.dialogTableVisible = true;
- }
- })
- },
- typeChange() {
- if (this.inspect.type == '干粮' && this.inspect.goodsName) {
- getDryGrainPrice({
- warehouseId: this.cangid,
- goodsName: this.inspect.goodsName
- })
- .toPromise()
- .then((response) => {
- this.$set(this.inspect, 'dryGrainPrice', response)
- })
- }
- },
- closePrint() {
- // this.inspect = []
- this.isShowPrint = false
- },
- submit() {
- this.inspect.warehouseName = this.warehouseName
- this.inspect.compId = localStorage.getItem('ws-pf_compId')
- if (this.types == 1) {
- this.inspect.qualityInspector = localStorage.getItem('ws-pf_staffName')
- this.$confirm('确定保存质检信息?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- if (!this.inspect.tidalGrainPrice || this.inspect.tidalGrainPrice == 'NaN') {
- this.inspect.tidalGrainPrice = 0
- }
- inspectAdd(this.inspect)
- .toPromise()
- .then((response) => {
- this.checked=false
- this.$message.success('保存成功')
- getinspectLook({
- id: response
- })
- .toPromise()
- .then((response) => {
- // let printString = localStorage.getItem('ws-pf_compId') + "," + row.qualityNo + "," + this.cangid
- // getQRcode({printString}).toPromise()
- // .then((res) => {
- this.isShowPrint = true
- this.printData = response
- // this.printData.qrCodeUrl = res
- // })
- this.inspect = response
- if (response.compName == '黑龙江秋收有限公司') {
- this.inspect.compName = '黑龙江中天昊元贸易有限公司'
- }
- })
- this.isShowPrint = true
- //打印
- // this.$router.go(-1)
- })
- })
- .catch(() => {
- return false
- })
- } else if (this.types == 3) {
- this.inspect.qualityInspector = localStorage.getItem('ws-pf_staffName')
- this.inspect.flag = 0
- this.$confirm('确定保存初检信息?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- // return
- getinspectEdit(this.inspect)
- .toPromise()
- .then((response) => {
- this.$message.success('修改成功')
- this.checked=false
- this.$router.push({
- path: 'inspectionManagement'
- })
- })
- })
- .catch(() => {
- return false
- })
- } else if (this.types == 4) {
- this.inspect.flag = 1
- this.inspect.reInspector = localStorage.getItem('ws-pf_roleName') + localStorage.getItem('ws-pf_staffName')
- this.$confirm('确定保存复检信息?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- // return
- getinspectEdit(this.inspect)
- .toPromise()
- .then((response) => {
- this.$message.success('修改成功')
-
- // this.$router.push({
- // path: 'inspectionManagement'
- // })
- getinspectLook({
- id: this.inspect.id
- })
- .toPromise()
- .then((response) => {
- this.inspect = response
- if (response.compName == '黑龙江秋收有限公司') {
- this.inspect.compName = '黑龙江中天昊元贸易有限公司'
- }
- })
- this.isShowPrint = true
- })
- })
- .catch(() => {
- return false
- })
- } else if (this.types == 5) {
- this.inspect.flag = 2
- // this.inspect.reInspector=localStorage.getItem('ws-pf_roleName') + localStorage.getItem('ws-pf_staffName')
- this.$confirm('确定保存质检信息?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- getinspectEdit(this.inspect)
- .toPromise()
- .then((response) => {
- this.$message.success('修改成功')
- getinspectLook({
- id: this.inspect.id
- })
- .toPromise()
- .then((response) => {
- this.inspect = response
- if (response.compName == '黑龙江秋收有限公司') {
- this.inspect.compName = '黑龙江中天昊元贸易有限公司'
- }
- })
- this.isShowPrint = true
- })
- })
- .catch(() => {
- return false
- })
- }
- },
- print() {
- if (!this.inspect.qualityNo) {
- this.$message({
- message: '编号不能为空',
- type: 'warning',
- })
- return
- }
- if (!this.inspect.binNumber) {
- this.$message({
- message: '仓位不能为空',
- type: 'warning',
- })
- return
- }
- if (!this.inspect.customerName) {
- this.$message({
- message: '客户不能为空',
- type: 'warning',
- })
- return
- }
- // if (!this.inspect.storageTagNo) {
- // this.$message({
- // message: '囤位号不能为空',
- // type: 'warning',
- // })
- // return
- // }
- if(this.inspect.storageTagNo){
- if (this.inspect.storageTagNo.length > 10) {
- this.$message({
- message: '囤位号不超过10个字符',
- type: 'warning',
- })
- return
- }
- }
- if (!this.inspect.carNumber) {
- this.$message({
- message: '车牌号不能为空',
- type: 'warning',
- })
- return
- }
- if (this.inspect.carNumber.length > 7 || this.inspect.carNumber.length != 7) {
- this.$message({
- message: '车牌号输入错误',
- type: 'warning',
- })
- return
- }
- if (this.inspect.boxNo && this.inspect.boxNo.length > 20) {
- this.$message({
- message: '箱号-1输入错误',
- type: 'warning',
- })
- return
- }
- if (this.inspect.boxNoOther && this.inspect.boxNoOther.length > 20) {
- this.$message({
- message: '箱号-2输入错误',
- type: 'warning',
- })
- return
- }
- if (this.inspect.titleNo && this.inspect.titleNo.length > 20) {
- this.$message({
- message: '封号-1输入错误',
- type: 'warning',
- })
- return
- }
- if (this.inspect.titleNoOther && this.inspect.titleNoOther.length > 20) {
- this.$message({
- message: '封号-2输入错误',
- type: 'warning',
- })
- return
- }
- if (!this.inspect.goodsName) {
- this.$message({
- message: '货名不能为空',
- type: 'warning',
- })
- return
- }
- if (this.inspect.paramType == '2') {
- if (
- this.inspect.buckleWeightRatio < 0 ||
- this.inspect.buckleWeightRatio > 2
- ) {
- this.$message({
- message: '扣重比输入错误',
- type: 'warning',
- })
- return
- }
- if (
- String(this.inspect.buckleWeightRatio).indexOf('.') != -1 &&
- String(this.inspect.buckleWeightRatio).length -
- (String(this.inspect.buckleWeightRatio).indexOf('.') + 1) >
- 2
- ) {
- this.$message({
- message: '扣重比输入错误',
- type: 'warning',
- })
- return
- }
- }
- if (!this.inspect.type) {
- this.$message({
- message: '类型不能为空',
- type: 'warning',
- })
- return
- }
- if (!this.inspect.natureOfGrainPurchase) {
- this.$message({
- message: '购粮性质不能为空',
- type: 'warning',
- })
- return
- }
- if (this.inspect.type == '干粮') {
- if (!this.inspect.dryGrainPrice) {
- this.$message({
- message: '干粮价格不能为空',
- type: 'warning'
- })
- return
- }
- if (this.inspect.dryGrainPrice <= 0 || this.inspect.dryGrainPrice > 1000) {
- this.$message({
- message: '干粮价格输入错误',
- type: 'warning'
- })
- return
- }
- if (
- String(this.inspect.dryGrainPrice).indexOf('.') != -1 &&
- String(this.inspect.dryGrainPrice).length - (String(this.inspect.dryGrainPrice).indexOf('.') + 1) > 4) {
- this.$message({
- message: '干粮价格输入错误',
- type: 'warning',
- })
- return
- }
- } else {
- if (!this.inspect.tidalGrainPrice) {
- this.$message({
- message: '净重单价不能为空',
- type: 'warning'
- })
- return
- }
- if (this.inspect.tidalGrainPrice <= 0 || this.inspect.tidalGrainPrice > 1000) {
- this.$message({
- message: '净重单价输入错误',
- type: 'warning'
- })
- return
- }
- }
- if(!this.checked){
- if (!this.inspect.grade) {
- this.$message({
- message: '等级不能为空',
- type: 'warning',
- })
- return
- }
- if (!this.inspect.impurity) {
- this.$message({
- message: '杂质不能为空',
- type: 'warning',
- })
- return
- }
- if (String(this.inspect.impurity).indexOf('.') != -1 && String(this.inspect.impurity).length - (String(this
- .inspect.impurity).indexOf('.') + 1) > 1) {
- this.$message({
- message: '杂质输入错误',
- type: 'warning',
- })
- return
- }
- if (this.inspect.impurity < 0 || this.inspect.impurity > 40) {
- this.$message({
- message: '杂质输入错误',
- type: 'warning',
- })
- return
- }
- if( this.information != '编辑复检'){
- if (!this.inspect.waterContent) {
- this.$message({
- message: '水分不能为空',
- type: 'warning',
- })
- return
- }
- if (this.inspect.waterContent < 0 || this.inspect.waterContent > 50) {
- this.$message({
- message: '水分输入错误',
- type: 'warning',
- })
- return
- }
- if (String(this.inspect.waterContent).indexOf('.') != -1 && String(this.inspect.waterContent).length - (String(
- this.inspect.waterContent).indexOf('.') + 1) > 1) {
- this.$message({
- message: '水分输入错误',
- type: 'warning',
- })
- return
- }
- }
-
- if (!this.inspect.mildewGrain) {
- this.$message({
- message: '霉变粒不能为空',
- type: 'warning',
- })
- return
- }
- if (this.inspect.mildewGrain < 0 || this.inspect.mildewGrain > 40) {
- this.$message({
- message: '霉变粒输入错误',
- type: 'warning',
- })
- return
- }
- if (String(this.inspect.mildewGrain).indexOf('.') != -1 && String(this.inspect.mildewGrain).length - (String(
- this.inspect.mildewGrain).indexOf('.') + 1) > 1) {
- this.$message({
- message: '霉变粒输入错误',
- type: 'warning',
- })
- return
- }
- if (!this.inspect.bulkDensity) {
- this.$message({
- message: '容重不能为空',
- type: 'warning',
- })
- return
- }
- if (this.inspect.bulkDensity < 500 || this.inspect.bulkDensity > 1000) {
- this.$message({
- message: '容重输入错误',
- type: 'warning',
- })
- return
- }
- if (String(this.inspect.bulkDensity).indexOf('.') != -1 && String(this.inspect.bulkDensity).length - (String(
- this.inspect.bulkDensity).indexOf('.') + 1) > 0) {
- this.$message({
- message: '容重需输入整数',
- type: 'warning',
- })
- return
- }
- if (!this.inspect.jiaorenli) {
- this.$message({
- message: '热损伤不能为空',
- type: 'warning',
- })
- return
- }
- if (this.inspect.jiaorenli < 0 || this.inspect.jiaorenli > 40) {
- this.$message({
- message: '热损伤输入错误',
- type: 'warning',
- })
- return
- }
- if (String(this.inspect.jiaorenli).indexOf('.') != -1 && String(this.inspect.jiaorenli).length - (String(this
- .inspect.jiaorenli).indexOf('.') + 1) > 1) {
- this.$message({
- message: '热损伤输入错误',
- type: 'warning',
- })
- return
- }
- if (!this.inspect.imperfectGrain) {
- this.$message({
- message: '不完善粒不能为空',
- type: 'warning',
- })
- return
- }
- if (this.inspect.imperfectGrain < 0 || this.inspect.imperfectGrain > 40) {
- this.$message({
- message: '不完善粒输入错误',
- type: 'warning',
- })
- return
- }
- if (String(this.inspect.imperfectGrain).indexOf('.') != -1 && String(this.inspect.imperfectGrain).length - (
- String(this.inspect.imperfectGrain).indexOf('.') + 1) > 1) {
- this.$message({
- message: '不完善粒输入错误',
- type: 'warning',
- })
- return
- }
- }
-
- getamount({
- compId: localStorage.getItem('ws-pf_compId'),
- customerNumberCard: this.inspect.customerNumberCard,
- goodsName: this.inspect.goodsName,
- })
- .toPromise()
- .then((response) => {
- for (let i = 0; i < this.purchasePriceList.length; i++) {
- if (
- this.inspect.goodsName == this.purchasePriceList[i].goodsName
- ) {
- let count = (this.purchasePriceList[i].saleLimit - response / 1000).toFixed(2)
- if (count <= 0) {
- count = 0
- this.$alert(
- '该客户累计销售' +
- this.inspect.goodsName +
- (response / 1000).toFixed(2) +
- '吨,还可售粮' +
- count +
- '吨',
- '提示', {
- confirmButtonText: '确定',
- callback: (action) => {
- this.$message({
- type: 'info',
- message: `累计售粮已超出上限`,
- })
- },
- }
- )
- } else {
- this.submit();
- }
- }
- }
- })
- },
- cancel() {
- this.types = ''
- // this.inspect = []
- this.$router.push({
- path: 'inspectionManagement'
- })
- },
- shipperNameChange(e) {
- this.$set(this.inspect, 'customerName', this.carNumberList[e].shipperName)
- this.$set(this.inspect, 'carNumber', this.carNumberList[e].carNo)
- this.$set(this.inspect, 'customerPhone', this.carNumberList[e].shipperPhone)
- for (let i = 0; i < this.customerList1.length; i++) {
- if (this.customerList1[i].customerName == this.inspect.customerName) {
- this.inspect.customerNumberCard = this.customerList1[i].customerNumberCard
- }
- }
- if (this.inspect.goodsName && this.inspect.customerName) {
- // //查看当前用户对应货名有未结算状态的送货
- // let count = 0
- // getCount({
- // compId: localStorage.getItem('ws-pf_compId'),
- // customerName: this.inspect.customerName,
- // goodsName: this.inspect.goodsName,
- // customerNumberCard: this.inspect.customerNumberCard
- // }).toPromise()
- // .then((response) => {
- // count = response
- // })
- // 客户下拉校验
- // getamount({
- // compId: localStorage.getItem('ws-pf_compId'),
- // customerName: this.inspect.customerName,
- // goodsName: this.inspect.goodsName,
- // customerNumberCard:this.inspect.customerNumberCard
- // })
- // .toPromise()
- // .then((response) => {
- // for (let i = 0; i < this.purchasePriceList.length; i++) {
- // if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
- // if ((this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0)&&this.tipFlag) {
- // this.tipFlag = false
- // this.$message('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。');
- // }
- // }
- // }
- // })
- }
- },
- customerChange(e) {
- let customers = e.split('(')
- this.inspect.customerName = customers[0]
- for (let i = 0; i < this.customerList1.length; i++) {
- // console.log(this.customerList1[i].customerName, this.customerList1[i])
- if (this.customerList1[i].customerName == this.inspect.customerName) {
- // console.log(this.customerList1[i])
- this.inspect.customerNumberCard = this.customerList1[i].customerNumberCard
- }
- }
- this.inspect.customerPhone = customers[1].split(')')[0]
- if (this.inspect.goodsName && this.inspect.customerName) {
- // //查看当前用户对应货名有未结算状态的送货
- // let count = 0
- // getCount({
- // compId: localStorage.getItem('ws-pf_compId'),
- // customerName: this.inspect.customerName,
- // goodsName: this.inspect.goodsName,
- // customerNumberCard: this.inspect.customerNumberCard
- // }).toPromise()
- // .then((response) => {
- // count = response
- // })
- // // 客户下拉校验
- // getamount({
- // compId: localStorage.getItem('ws-pf_compId'),
- // customerName: this.inspect.customerName,
- // goodsName: this.inspect.goodsName,
- // customerNumberCard:this.inspect.customerNumberCard
- // })
- // .toPromise()
- // .then((response) => {
- // for (let i = 0; i < this.purchasePriceList.length; i++) {
- // if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
- // if ((this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0)&&this.tipFlag) {
- // this.tipFlag = false
- // this.$message('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。');
- // }
- // }
- // }
- // })
- }
- },
- waterContentChange(type) {
- if (this.inspect.goodsName && type != 'water') {
- if (this.inspect.goodsName.indexOf('潮粮') != -1) {
- this.inspect.type = '潮粮'
- } else {
- this.inspect.type = '干粮'
- }
- if (!this.inspect.dryGrainPrice || this.inspect.dryGrainPrice == 0) {
- getDryGrainPrice({
- warehouseId: this.cangid,
- goodsName: this.inspect.goodsName
- })
- .toPromise()
- .then((response) => {
- this.$set(this.inspect, 'dryGrainPrice', response)
- })
- }
- //客户
- getcustomer({
- warehouseId: this.cangid,
- goodsName:this.inspect.goodsName
- })
- .toPromise()
- .then((response) => {
- this.customerList1 = response
- this.customerList = []
- let customer = response
- for (let i = 0; i < response.length; i++) {
- if (response[i].supplier) {
- customer = response[i].customerName + '(' + response[i].customerPhone + ')' + '-' + response[i]
- .supplier
- } else {
- customer = response[i].customerName + '(' + response[i].customerPhone + ')'
- }
- this.customerList.push({
- valueKey: i,
- value: customer,
- })
- }
- })
- for (var i = 0; i < this.purchasePriceList.length; i++) {
- if (this.purchasePriceList[i].goodsName == this.inspect.goodsName) {
- this.$set(this.inspect, 'buckleWeightRatio', this.purchasePriceList[i].deductWeight)
- this.$set(this.inspect, 'paramType', this.purchasePriceList[i].paramType)
- }
- }
- }
- //潮粮单价改变事件
- if (
- this.inspect.goodsName &&
- this.inspect.waterContent &&
- this.inspect.grade
- ) {
- getinspectLookUnitPrice({
- warehouseId: this.cangid,
- goodsName: this.inspect.goodsName,
- waterContent: this.inspect.waterContent,
- grade: this.inspect.grade,
- })
- .toPromise()
- .then((response) => {
- if (this.inspect.paramType == '1') {
- this.inspect.tidalGrainPrice = parseFloat(parseFloat(response) - parseFloat(this.inspect
- .buckleMiscellaneous) / 100 * parseFloat(this.inspect.dryGrainPrice)).toFixed(4)
- } else {
- if (this.inspect.type == '干粮') {
- if (response == 0) {
- getDryGrainPrice({
- warehouseId: this.cangid,
- goodsName: this.inspect.goodsName
- })
- .toPromise()
- .then((response) => {
- this.$set(this.inspect, 'dryGrainPrice', response)
- })
- } else {
- this.inspect.dryGrainPrice = response
- }
- } else {
- this.inspect.tidalGrainPrice = response
- }
- }
- })
- }
- if (this.inspect.goodsName && this.inspect.customerName) {
- // //查看当前用户对应货名有未结算状态的送货
- // let count = 0
- // if (
- // this.inspect.goodsName &&
- // this.inspect.customerName
- // ) {
- // getCount({
- // compId: localStorage.getItem('ws-pf_compId'),
- // customerName: this.inspect.customerName,
- // goodsName: this.inspect.goodsName,
- // customerNumberCard: this.inspect.customerNumberCard
- // }).toPromise()
- // .then((response) => {
- // count = response
- // })
- // // // 货名下拉校验
- // // getamount({
- // // compId: localStorage.getItem('ws-pf_compId'),
- // // customerName: this.inspect.customerName,
- // // goodsName: this.inspect.goodsName,
- // // customerNumberCard:this.inspect.customerNumberCard
- // // })
- // // .toPromise()
- // // .then((response) => {
- // // for (let i = 0; i < this.purchasePriceList.length; i++) {
- // // if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
- // // if ((this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0 )&&this.tipFlag) {
- // // this.tipFlag = false
- // // this.$message('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。');
- // // }
- // // }
- // // }
- // // })
- // }
- }
- },
- getList(ids) {
- // 车型
- getcartype({constId:'QUA1'}).toPromise()
- .then((response) => {
- this.cartypeList=response
- })
- // 货名
- getinspectLookGoods({
- warehouseId: this.cangid
- })
- .toPromise()
- .then((response) => {
- this.goodNameList = []
- this.goodNameList = response
- this.purchasePriceList = response
- })
- // 品级
- packList({
- constId: 'CON3'
- })
- .toPromise()
- .then((response) => {
- this.gradeList = response
- })
- getshippinginfo({
- compId: localStorage.getItem('ws-pf_compId'),
- warehouseName: this.warehouseName
- }).toPromise()
- .then((response) => {
- this.carNumberList = response
- })
- // 仓位
- getbinNumber({
- id: this.cangid
- })
- .toPromise()
- .then((response) => {
- this.getbinNumberList = []
- for (let i = 0; i < response.warehousePositionInfoList.length; i++) {
- this.getbinNumberList.push({
- value: response.warehousePositionInfoList[i].binNumber,
- })
- }
- })
- if (this.types != 1) {
- //查看
- getinspectLook({
- id: ids
- })
- .toPromise()
- .then((response) => {
- this.inspect = response
- })
- }
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- /deep/.el-dialog__header {
- text-align: center !important;
- padding: 10px 0 !important;
- height: auto !important;
- }
- /deep/.el-dialog__title {
- font-size: 24px !important;
- }
- .center {
- background: #f6f7fc;
- }
- .ws-info-table {
- border: none;
- }
- .ws-info-table .el-form-item {
- width: 50%;
- border: none;
- }
- /deep/.ws-info-table .el-form-item .el-form-item__label {
- width: 30%;
- text-align: center;
- background: #ffffff;
- font-size: 14px;
- color: #8890b1;
- }
- /deep/.ws-info-table .el-form-item .el-form-item__content {
- border: none;
- // overflow: auto!important;
- height: 55px;
- }
- /deep/.el-textarea__inner {
- width: 100%;
- }
- .title {
- font-size: 16px;
- font-weight: 600;
- margin: 10px;
- }
- .titleup {
- position: relative;
- }
- .title::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 15px;
- background: #8890b1;
- margin-right: 5px;
- }
- .substance {
- background: #ffffff;
- width: 100%;
- border-radius: 4px;
- margin: 0 auto;
- padding-top: 20px;
- }
- /deep/.el-table .el-table__header .cell,
- .el-table .el-table__body .cell {
- text-align: center;
- }
- /deep/.el-table--enable-row-transition .el-table__body td {
- text-align: center;
- }
- .bg-left {
- padding-left: 30px;
- }
- .bg-right {
- padding-right: 10px;
- text-align: right;
- }
- .bg-bottom {
- margin: 15px 0px;
- }
- .titleup {
- position: relative;
- }
- .titleup::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 30px;
- background: #5473e8;
- position: absolute;
- left: 0;
- }
- .but {
- text-align: center;
- // margin: 20px auto;
- }
- </style>
|