123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962 |
- <!--质检信息-->
- <template>
- <div class="center">
- <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: 50%; 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="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="storageTagNo">
- <ws-input v-model="inspect.storageTagNo" placeholder="请输入囤位号" maxlength="15" size="small"
- :disabled="disabled" />
- </ws-form-item>
- <ws-form-item label="车牌号" span="1" prop="carNumber">
- <ws-input v-model="inspect.carNumber" 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="disabled1"
- @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 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="natureOfGrainPurchase">
- <ws-input v-model="inspect.natureOfGrainPurchase" placeholder="请输入购粮性质" maxlength="10" size="small"
- :disabled="disabled" />
- </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" disabled />
- </ws-form-item>
- <ws-form-item label="干粮单价(元/公斤)" span="1" prop="dryGrainPrice" v-if="inspect.type == '干粮'">
- <ws-input type="number" @mousewheel.native.prevent v-model="inspect.dryGrainPrice" placeholder="请输入干粮单价" maxlength="10" size="small" :disabled="disabled" />
- </ws-form-item>
- </ws-info-table>
- <div class="title">质检数据</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="this.types != 2" type="primary">取消</el-button>
- <el-button @click="print" v-if="this.types ==3 || this.types ==4 ||this.types ==1" type="primary">保存</el-button>
- <el-button @click="print" v-if="this.types ==5 " type="primary">确认并打印</el-button>
- <el-button @click="cancel" v-if="this.types == 2" type="primary">关闭</el-button>
- </div>
- </div>
- </ws-form>
- </div>
- <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食质检单" @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
- } 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,
- // warehouseList: {},
- inspect: {
- tidalGrainPrice: 0,
- buckleWeightRatio: 0,
- natureOfGrainPurchase:'贸易粮',
- buckleMiscellaneous:0,
- paramType:1,
- type:'潮粮'
- },
- disabled: false,
- disabled1: false,
- types: '1',
- information: '添加初检',
- goodNameList: [],
- gradeList: [],
- customerList: [],
- getbinNumberList: [],
- cangid: '', //仓库id
- warehouseName: '',
- unitPrice: 0,
- count: 0,
- cangNo: '',
- typeList: ['干粮', '潮粮'],
- purchasePriceList: [],
- id: '',
- imgUrl:'',
- printData:{},
- num:0,
- tipFlag:true
- }
- },
- activated() {
- this.types = this.$route.query.type
- 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.purchasePriceList = this.$route.query.purchasePriceList
- this.id = this.$route.query.id
- if (this.types == 2) {
- this.disabled = true
- this.disabled1 = true
- this.information = '查看质检'
- } else if (this.types == 3) {
- this.disabled = false
- this.disabled1 = true
- this.information = '编辑初检'
- }else if (this.types == 4) {
- this.disabled = true
- this.disabled1 = true
- this.information = '编辑复检'
- }else if (this.types == 5) {
- this.disabled = false
- this.disabled1 = true
- this.information = '确认质检'
- }
- else{
- this.disabled1 = false
- this.disabled = false
- }
- this.calculation()
- this.getList(this.id)
- },
- methods: {
- 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位序列号
- },
- 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: 'https://www.zthymaoyi.com/upload/admin',
- 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
- },
- 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.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.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
- }
- }
- 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.inspect.waterContent) {
- this.$message({
- message: '水分不能为空',
- type: 'warning',
- })
- return
- }
- if (this.inspect.waterContent < 0 || this.inspect.waterContent > 40) {
- 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
- }
- this.inspect.warehouseName = this.warehouseName
- this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
- if (this.types == 1) {
- this.inspect.qualityInspector = sessionStorage.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.$message.success('保存成功')
- getinspectLook({
- id: response
- })
- .toPromise()
- .then((response) => {
- this.inspect = response
- })
- this.isShowPrint = true
- //打印
- // this.$router.go(-1)
- })
- })
- .catch(() => {
- return false
- })
- } else if (this.types == 3) {
- this.inspect.qualityInspector = sessionStorage.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.$router.push({path:'inspectionManagement'})
- })
- })
- .catch(() => {
- return false
- })
- }
- else if (this.types == 4) {
- this.inspect.flag=1
- this.inspect.reInspector=sessionStorage.getItem('ws-pf_roleName') + sessionStorage.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'})
- })
- })
- .catch(() => {
- return false
- })
- }else if (this.types == 5) {
- this.inspect.flag=2
- // this.inspect.reInspector=sessionStorage.getItem('ws-pf_roleName') + sessionStorage.getItem('ws-pf_staffName')
- this.$confirm('确定保存质检信息?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- // return
- getinspectEdit(this.inspect)
- .toPromise()
- .then((response) => {
- this.$message.success('修改成功')
- getinspectLook({
- id: this.inspect.id
- })
- .toPromise()
- .then((response) => {
- this.inspect = response
- })
- this.isShowPrint = true
- })
- })
- .catch(() => {
- return false
- })
- }
- },
- cancel() {
- this.types = ''
- // this.inspect = []
- this.$router.push({
- path: 'inspectionManagement'
- })
- },
- customerChange(e) {
- let customers = e.split('(')
- this.inspect.customerName = customers[0]
- this.inspect.customerPhone = customers[1].split(')')[0]
- if(this.inspect.goodsName && this.inspect.customerName){
- // //查看当前用户对应货名有未结算状态的送货
- let count = 0
- getCount({
- compId: sessionStorage.getItem('ws-pf_compId'),
- customerName: this.inspect.customerName,
- goodsName: this.inspect.goodsName,
- }) .toPromise()
- .then((response) => {
- count = response
- })
- // 客户下拉校验
- getamount({
- compId: sessionStorage.getItem('ws-pf_compId'),
- customerName: this.inspect.customerName,
- goodsName: this.inspect.goodsName,
- })
- .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)
- })
- }
-
- 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{
- this.inspect.tidalGrainPrice = response
- }
- })
- }
- if(this.inspect.goodsName && this.inspect.customerName ){
- // //查看当前用户对应货名有未结算状态的送货
- let count = 0
- if (
- this.inspect.goodsName &&
- this.inspect.customerName
- ) {
- getCount({
- compId: sessionStorage.getItem('ws-pf_compId'),
- customerName: this.inspect.customerName,
- goodsName: this.inspect.goodsName,
- }) .toPromise()
- .then((response) => {
- count = response
- })
- // 货名下拉校验
- getamount({
- compId: sessionStorage.getItem('ws-pf_compId'),
- customerName: this.inspect.customerName,
- goodsName: this.inspect.goodsName,
- })
- .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) {
- // 货名
- getinspectLookGoods({
- warehouseId: this.cangid
- })
- .toPromise()
- .then((response) => {
- this.goodNameList = []
- this.goodNameList = response
- this.purchasePriceList = response
- })
- // 品级
- packList({
- constId: 'CON3'
- })
- .toPromise()
- .then((response) => {
- this.gradeList = response
- })
- //客户
- getcustomer({
- compId: sessionStorage.getItem('ws-pf_compId'),
- authenticationStatusKey:7
- })
- .toPromise()
- .then((response) => {
- this.customerList = []
- let customer = response
- for (let i = 0; i < response.length; i++) {
- customer =
- response[i].customerName + '(' + response[i].customerPhone + ')'
- this.customerList.push({
- valueKey: i,
- value: customer,
- })
- }
- })
- // 仓位
- 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;
- }
- .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>
|