1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291 |
- // 创建销售计划
- <template>
- <div class="container">
- <el-row>
- <el-col :span="12">
- <h2 class="bg-left title">创建销售计划</h2>
- </el-col>
- <el-col :span="12" class="bg-right">
- <el-button
- class="bg-bottom"
- type="primary"
- size="small"
- @click="returnsales()"
- >
- <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="basicInformation">
- <el-radio-group
- @change="tasktypechange"
- v-model="dataList.taskTypeKey"
- ></el-radio-group>
- <div class="center1">
- <div class="small-title">
- <h3>基本信息</h3>
- </div>
- <el-form ref="dataList" :model="dataList" label-width="140px">
- <!-- 标题 -->
- <el-form-item label="标题" span="1" prop="title" >
- <el-input
- v-model="dataList.title"
- maxlength="16"
- placeholder="请输入标题,不超过16个字"
- />
- <span class="unchangeable">*</span>
- </el-form-item>
- <!-- 货名 -->
- <ws-form-item label="货名" span="1" prop="goodsName" >
- <ws-select
- v-model="dataList.goodsName"
- placeholder
- class="typeselect"
- @change="selectgoodsName"
- >
- <ws-option
- v-for="item in goodnameList"
- :key="item.constKey"
- :label="item.constValue"
- :value="item.constValue"
- />
- </ws-select>
- <span class="unchangeable">*</span>
- </ws-form-item>
- <!-- 计划销售量(吨) -->
- <el-form-item
- label="计划销售量(吨)"
- span="1"
- prop="plannedSaleVolume"
- >
- <el-input
- v-model="dataList.plannedSaleVolume"
- class="typeselect"
- placeholder="请输入计划销售量"
- />
- <span class="unchangeable">*</span>
- </el-form-item>
- <!-- 最小成交量 -->
- <el-form-item label="最小成交量(吨)" span="1" prop="minimumVolume" >
- <el-input
- v-model="dataList.minimumVolume"
- placeholder="请输入最小成交量"
- />
- <span class="unchangeable">*</span>
- </el-form-item>
- <!--类型-->
- <ws-form-item label="类型" span="1" prop="salePlanType" >
- <ws-select
- v-model="dataList.salePlanType"
- placeholder
- class="typeselect"
- @change="selectsalePlanType"
- >
- <ws-option
- v-for="item in salePlanTypeList"
- :key="item.constKey"
- :label="item.constValue"
- :value="item.constValue"
- />
- </ws-select>
- <span class="unchangeable">*</span>
- </ws-form-item>
- <!-- 价格类型 -->
- <ws-form-item label="价格类型" span="1" prop="priceType">
- <el-input v-model="dataList.priceType" disabled />
- </ws-form-item>
- <ws-form-item
- v-show="dataList.salePlanType=='期货'"
- label="基差(元/吨)"
- span="1"
- prop="basisPrice"
- >
- <el-input v-model="dataList.basisPrice" placeholder="请输入基差" />
- <span class="unchangeable">*</span>
- </ws-form-item>
- <ws-form-item
- v-show="dataList.salePlanType == '现货'"
- label="销售价格(元)"
- span="1"
- prop="salePrice"
- >
- <el-input
- v-model="dataList.salePrice"
- maxlength="120"
- size="small"
- placeholder="请输入销售价格"
- />
- <span class="unchangeable">*</span>
- </ws-form-item>
- <!--出货库-->
- <ws-form-item label="出货库" span="1" prop="sendWarehouse" >
- <ws-select
- v-model="dataList.sendWarehouse"
- placeholder
- class="typeselect"
- @change="sendWarehousechange"
- >
- <ws-option
- v-for="item in warehouseList"
- :key="item.warehouseName"
- :label="item.warehouseName"
- :value="item.warehouseName"
- />
- </ws-select>
- <span class="unchangeable">*</span>
- </ws-form-item>
- <ws-form-item label="出货库所在地区" span="1" prop="sendArea" >
- <el-cascader
- :options="options_"
- v-model="selectedOptions"
- clearable
- size="large"
- placeholder="请选择出货库所在地区"
- @change="handleChange"
- style="width: 200%"
- />
- <span class="unchangeable">*</span>
- </ws-form-item>
- <ws-form-item label="运费承担方" span="1" prop="freightPayer">
- <ws-select
- v-model="dataList.freightPayer"
- placeholder
- class="typeselect"
- @change="selectfreightPayer"
- >
- <ws-option
- v-for="item in freightPayerList"
- :key="item.constKey"
- :label="item.constValue"
- :value="item.constValue"
- />
- </ws-select>
- </ws-form-item>
- <ws-form-item label="包装方式" span="1" prop="packingType" >
- <ws-select
- v-model="dataList.packingType"
- placeholder
- class="typeselect"
- @change="selectpackingType"
- >
- <ws-option
- v-for="item in packingTypeList"
- :key="item.constKey"
- :label="item.constValue"
- :value="item.constValue"
- />
- </ws-select>
- <span class="unchangeable">*</span>
- </ws-form-item>
- <el-form-item
- v-if="dataList.packingType != '散装'"
- label="装袋备注"
- span="1"
- prop="baggingNotes"
- >
- <el-input
- maxlength="30"
- v-model="dataList.baggingNotes"
- size="small"
- placeholder="请输入装袋要求如:98斤,王中王彩袋"
- />
- </el-form-item>
- <ws-form-item label="卖方" span="1" prop="seller" >
- <el-input
- maxlength="25"
- v-model="dataList.seller"
- size="small"
- placeholder="请输入卖方名称"
- />
- <span class="unchangeable">*</span>
- </ws-form-item>
- <el-form-item label="卖方电话" span="1" prop="sellerPhone" >
- <el-input
- v-model="dataList.sellerPhone"
- filterable
- :filter-method="dataFilter"
- placeholder="请输入卖方电话"
- ></el-input>
- <span class="unchangeable">*</span>
- </el-form-item>
- <div class="small-title"></div>
- </el-form>
- </div>
- <div class="center1">
- <div class="small-title">
- <h3>货物要求</h3>
- </div>
- <el-form ref="dataList" :model="dataList" label-width="140px">
- <el-form-item label="水分(%)<=" span="1" prop="waterContent" >
- <el-input
- v-model="dataList.waterContent"
- class="typeselect"
- placeholder="请输入水分占比"
- />
- <span class="unchangeable">*</span>
- </el-form-item>
- <el-form-item label="容重(g/l)>=" span="1" prop="bulkDensity" >
- <el-input
- v-model="dataList.bulkDensity"
- class="typeselect"
- placeholder="请输入容重"
- />
- <span class="unchangeable">*</span>
- </el-form-item>
- <el-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
- <el-input
- v-model="dataList.jiaorenli"
- class="typeselect"
- placeholder="请输入热损伤占比"
- />
- </el-form-item>
- <el-form-item label="杂质(%)<=" span="1" prop="impurity">
- <el-input
- v-model="dataList.impurity"
- class="typeselect"
- placeholder="请输入杂质占比"
- />
- </el-form-item>
- <el-form-item label="霉变粒(%)<=" span="1" prop="mildewGrain">
- <el-input
- v-model="dataList.mildewGrain"
- placeholder="请输入霉变粒占比"
- />
- </el-form-item>
- <el-form-item label="不完善粒(%)<=" span="1" prop="imperfectGrain">
- <el-input
- v-model="dataList.imperfectGrain"
- maxlength="120"
- placeholder="请输入不完善粒占比"
- />
- </el-form-item>
- <el-form-item label="蛋白(%)>=" span="1" prop="protein">
- <el-input
- v-model="dataList.protein"
- class="typeselect"
- placeholder="请输入蛋白占比"
- />
- </el-form-item>
- <ws-form-item label="粒型" span="1" prop="grain">
- <ws-select
- v-model="dataList.grain"
- placeholder
- class="typeselect"
- @change="selectgrain"
- >
- <ws-option
- v-for="item in grainList"
- :key="item.constKey"
- :label="item.constValue"
- :value="item.constValue"
- />
- </ws-select>
- </ws-form-item>
- <ws-form-item label="品级" span="1" prop="grade">
- <ws-select
- v-model="dataList.grade"
- placeholder
- class="typeselect"
- @change="selectgrade"
- >
- <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="unitPrice">
- <el-cascader
- :options="options1_"
- v-model="selectedOptions1"
- clearable
- size="large"
- placeholder="请选择产地"
- @change="handleChange1"
- style="width: 200%"
- />
- </ws-form-item>
- <el-form-item label="产出年份" span="1" prop="outputYear">
- <el-date-picker
- v-model="dataList.outputYear"
- type="year"
- align="right"
- unlink-panels
- value-format='yyyy'
- range-separator="至"
- placeholder="产出年份"
- ></el-date-picker>
- </el-form-item>
- </el-form>
- </div>
- </div>
- <!-- 提交 -->
- <div style="text-align: right; padding: 10px" class="center">
- <el-button class="bg-bottom" type="primary" size="small" @click="submit()"
- >提交</el-button
- >
- </div>
- </div>
- </template>
- <script>
- import { saleAdd } from '@/model/salesManagement/index'
- import {
- regionData,
- provinceAndCityData,
- CodeToText,
- TextToCode,
- } from 'element-china-area-data'
- import { packList } from '@/model/contarct/index'
- import { getwarehousename } from '@/model/tasksport/index'
- import Pagination from '@/components/Pagination'
- import WsUpload from '@/components/WsUpload'
- // import { dayjs, fmoney, EventBus } from 'base-core-lib'
- import { dayjs, EventBus } from 'base-core-lib'
- export default {
- name: 'viewSpareMoney',
- components: {
- WsUpload,
- Pagination,
- },
- watch: {
- // vesselId(val) {
- // this.getList()
- // },
- isShow(val) {
- this.showType = val
- },
- },
- computed: {},
- data() {
- return {
- //弹出框
- dialogViewSpareMoney: false,
- dialogApproveFormVisible: false,
- // 是否显示
- showType: true,
- // 年
- year: '',
- options_: regionData,
- options1_: provinceAndCityData,
- packingTypeList: '',
- salePlanTypeList: '',
- freightPayerList: '',
- searchTypeText: '',
- selectedOptions: [],
- selectedOptions1: [],
- contractNoList: [],
- deptBudgetTotal: 0,
- readonly: true,
- currentPage: 1,
- pageSize: 10,
- searchType: 1,
- searchKeyWord: '',
- radio: '1',
- contractType: 2,
- startDate: null,
- endDate: null,
- goodnameList: {},
- grainList: [],
- checked: true,
- form: {},
- pcFlag: 1,
- staffList: [],
- options: [],
- storageType: [],
- storageType1: [],
- outContractNo: [],
- // 提交类型
- submitType: true,
- status: [],
- unitPricechange: [],
- warehouseNameList: [],
- warehouseNameList1: [],
- waterContentchange: [],
- appendixIdsAdd: '',
- uploadSuccess: {},
- warehouseList: [],
- warehouseInOutDetail: {},
- onChange: {},
- deptBudgetList1: [],
- gradeList: [],
- rules: {
- netWeight: [
- {
- required: true,
- type: 'number',
- message: '请输入活动名称',
- trigger: 'blur',
- },
- ],
- },
- outputYear: [],
- size: 10,
- compId: sessionStorage.getItem('ws-pf_compId'),
- deptCircularPage: {},
- packtypeList: {},
- date: {
- year: dayjs().format('YYYY'),
- month: dayjs().format('MM'),
- },
- contractList: [],
- inOutTaskNo: '',
- dataList: {
- taskTypeKey: '1',
- goodsName: '玉米',
- goodsNameKey: 1,
- salePlanType: '现货',
- salePlanTypeKey: 2,
- priceType: '定价销售',
- priceTypeKey: 2,
- packingType: '散装',
- packingTypeKey: 1,
- },
- historyList: [],
- pickerBeginDateBefore: {
- disabledDate: (time) => {
- return time.getTime() > Date.now()
- },
- },
- accessoryTFs: false,
- }
- },
- activated() {
- this.loaddata()
- },
- mounted() {},
- methods: {
- //返回按钮
- revert() {
- this.$router.go(-1)
- },
- returnsales() {
- this.dataList = {}
- // this.selectedOptions = ''
- this.$router.push({ path: 'salesPlanList' })
- },
- // 获取当前年月日
- 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 year + mouth + datetime
- },
- // 随机验证码
- verifyinit() {
- var arr = []
- for (var i = 48; i < 123; i++) {
- if (i > 57 && i < 65) continue
- if (i > 90 && i < 97) continue
- arr.push(String.fromCharCode(i))
- }
- arr.sort(function () {
- return Math.random() - 0.5
- })
- arr.length = 4
- return arr.join('')
- },
- dataFilter(val) {
- // console.log(val,"名")
- this.deptBudgetList.staffList = val
- if (val) {
- //val存在
- this.options = this.staffList.filter((item) => {
- if (
- !!~item.staffName.indexOf(val) ||
- !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
- ) {
- return true
- }
- })
- } else {
- //val为空时,还原数组
- this.options = this.staffList
- }
- },
- selecttaskType(e) {
- for (var i = 0; i < this.taskTypeList.length; i++) {
- if (this.taskTypeList[i].value == e) {
- this.searchType = this.taskTypeList[i].type
- }
- }
- },
- selectstaff(e) {
- for (var i = 0; i < this.staffList.length; i++) {
- if (this.staffList[i].staffName == e) {
- this.dataList.agentKey = this.staffList[i].staffId
- }
- }
- },
- selectstaff1(e) {
- for (var i = 0; i < this.staffList.length; i++) {
- if (this.staffList[i].staffName == e) {
- this.dataList1.agentKey = this.staffList[i].staffId
- }
- }
- },
- selectgrain(e) {
- for (var i = 0; i < this.grainList.length; i++) {
- if (this.grainList[i].constValue == e) {
- this.dataList.grainKey = this.grainList[i].constKey
- }
- }
- },
- selectpackingType(e) {
- for (var i = 0; i < this.packingTypeList.length; i++) {
- if (this.packingTypeList[i].constValue == e) {
- this.dataList.packingTypeKey = this.packingTypeList[i].constKey
- }
- }
- },
- selectfreightPayer(e) {
- for (var i = 0; i < this.freightPayerList.length; i++) {
- if (this.freightPayerList[i].constValue == e) {
- this.dataList.freightPayerKey = this.freightPayerList[i].constKey
- }
- }
- },
- selectgrade(e) {
- for (var i = 0; i < this.gradeList.length; i++) {
- if (this.gradeList[i].constValue == e) {
- this.dataList.gradeKey = this.gradeList[i].constKey
- }
- }
- },
- selectsalePlanType(e) {
- if (e == '现货') {
- this.dataList.priceType = '定价销售'
- this.dataList.priceTypeKey = 2
- } else {
- this.dataList.priceType = '期货盘面价+基差'
- this.dataList.priceTypeKey = 1
- }
- for (var i = 0; i < this.salePlanTypeList.length; i++) {
- if (this.salePlanTypeList[i].constValue == e) {
- this.dataList.procurementPlanTypekey =
- this.salePlanTypeList[i].constKey
- }
- }
- },
- handleChange(value) {
- this.selectedOptions = value
- this.dataList.sendPrivate = CodeToText[value[0]]
- this.dataList.sendCity = CodeToText[value[1]]
- this.dataList.sendArea = CodeToText[value[2]]
- },
- handleChange1(value) {
- this.selectedOptions1 = value
- this.dataList.outputPrivate = CodeToText[value[0]]
- this.dataList.outputCity = CodeToText[value[1]]
- },
- sendWarehousechange(e) {
- for (let i = 0; i < this.warehouseList.length; i++) {
- if (this.warehouseList[i].warehouseName == e) {
- var tmp = []
- tmp[0] = TextToCode[this.warehouseList[i].warehousePrivate].code
- tmp[1] =
- TextToCode[this.warehouseList[i].warehousePrivate][
- this.warehouseList[i].warehouseCity
- ].code
- tmp[2] =
- TextToCode[this.warehouseList[i].warehousePrivate][
- this.warehouseList[i].warehouseCity
- ][this.warehouseList[i].warehouseArea].code
- this.selectedOptions = tmp
- }
- }
- },
- //关闭
- close() {
- this.$router.push({ path: 'procurementPlanList' })
- },
- loaddata() {
- getwarehousename({
- compId: this.compId,
- warehouseType: 1,
- })
- .toPromise()
- .then((response) => {
- console.log(response)
- this.warehouseList = response
- })
- // 货名
- packList({ constId: 'CON2' })
- .toPromise()
- .then((response) => {
- this.goodnameList = response
- })
- // 品级
- packList({ constId: 'CON3' })
- .toPromise()
- .then((response) => {
- this.gradeList = response
- })
- //粒形
- packList({ constId: 'PRO4' })
- .toPromise()
- .then((response) => {
- this.grainList = response
- })
- //类型
- packList({ constId: 'PRO1' })
- .toPromise()
- .then((response) => {
- this.salePlanTypeList = response
- })
- //包装方式
- packList({ constId: 'PRO2' })
- .toPromise()
- .then((response) => {
- this.packingTypeList = response
- })
- //运费承担方
- packList({ constId: 'PRO3' })
- .toPromise()
- .then((response) => {
- this.freightPayerList = response
- })
- },
- 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 year + mouth + datetime
- },
- // 随机验证码
- verifyinit() {
- var arr = []
- for (var i = 48; i < 123; i++) {
- if (i > 57 && i < 65) continue
- if (i > 90 && i < 97) continue
- arr.push(String.fromCharCode(i))
- }
- arr.sort(function () {
- return Math.random() - 0.5
- })
- arr.length = 4
- return arr.join('')
- },
- submit() {
- if (!this.dataList.title) {
- this.$message({
- message: '标题不能为空!',
- type: 'warning',
- })
- return
- }
- if (this.dataList.title.length > 16) {
- this.$message({
- message: '标题输入错误!',
- type: 'warning',
- })
- return
- }
- if (!this.dataList.plannedSaleVolume) {
- this.$message({
- message: '计划销售量不能为空!',
- type: 'warning',
- })
- return
- }
- if (
- this.dataList.plannedSaleVolume > 10000000 ||
- this.dataList.plannedSaleVolume < 1
- ) {
- this.$message({
- message: '计划销售量输入错误!',
- type: 'warning',
- })
- return
- }
- if (this.dataList.plannedSaleVolume.indexOf('.') != -1) {
- if (this.dataList.plannedSaleVolume.split('.')[1].length > 2) {
- this.$message({
- message: '计划销售量输入错误!',
- type: 'warning',
- })
- return
- }
- }
- if (!this.dataList.minimumVolume) {
- this.$message({
- message: '最小成交量不能为空!',
- type: 'warning',
- })
- return
- }
- if (
- this.dataList.minimumVolume > 10000000 ||
- this.dataList.minimumVolume < 1
- ) {
- this.$message({
- message: '最小成交量输入错误!',
- type: 'warning',
- })
- return
- }
- if (
- this.dataList.minimumVolume.indexOf('.') != -1 &&
- this.dataList.minimumVolume.split('.')[1].length > 2
- ) {
- this.$message({
- message: '最小成交量输入错误!',
- type: 'warning',
- })
- return
- }
- if (
- this.dataList.basisPrice > 100000 ||
- this.dataList.basisPrice < 0 ||
- (String(this.dataList.basisPrice).indexOf(
- '.'
- ) != -1 &&
- String(this.dataList.basisPrice).length -
- (String(this.dataList.basisPrice).indexOf(
- '.'
- ) +
- 1) >
- 2)
- ) {
- this.$message({
- message: '基差输入错误',
- type: 'warning',
- })
- return
- }
- if (
- this.dataList.salePrice > 100000 ||
- this.dataList.salePrice < 0 ||
- (String(this.dataList.salePrice).indexOf(
- '.'
- ) != -1 &&
- String(this.dataList.salePrice).length -
- (String(this.dataList.salePrice).indexOf(
- '.'
- ) +
- 1) >
- 2)
- ) {
- this.$message({
- message: '销售价格输入错误',
- type: 'warning',
- })
- return
- }
- if (!this.dataList.sendWarehouse) {
- this.$message({
- message: '请选择出货库',
- type: 'warning',
- })
- return
- }
- if (this.selectedOptions.length == 0) {
- this.$message({
- message: '请选择出货库所在地区!',
- type: 'warning',
- })
- return
- }
- if (!this.dataList.seller) {
- this.$message({
- message: '卖方不能为空!',
- type: 'warning',
- })
- return
- }
- if (this.dataList.seller.length > 25 || this.dataList.seller.length < 1) {
- this.$message({
- message: '卖方输入错误!',
- type: 'warning',
- })
- return
- }
- if (!this.dataList.sellerPhone) {
- this.$message({
- message: '请输入卖方电话!',
- type: 'warning',
- })
- return
- }
- if (this.dataList.sellerPhone.length > 15 || this.dataList.sellerPhone.length < 6) {
- this.$message({
- message: '卖方电话输入错误!',
- type: 'warning',
- })
- return
- }
- if (!this.dataList.waterContent) {
- this.$message({
- message: '水分不能为空!',
- type: 'warning',
- })
- return
- }
- if (this.dataList.waterContent > 40 || this.dataList.waterContent < 1) {
- this.$message({
- message: '水分输入错误!',
- type: 'warning',
- })
- return
- }
- if (
- String(this.dataList.waterContent).indexOf('.') != -1 &&
- String(this.dataList.waterContent).length -
- (String(this.dataList.waterContent).indexOf('.') + 1) >
- 2
- ) {
- this.$message({
- message: '水分输入错误',
- type: 'warning',
- })
- return
- }
- if (!this.dataList.bulkDensity) {
- this.$message({
- message: '容重不能为空!',
- type: 'warning'
- })
- return
- }
- if (
- (this.dataList.bulkDensity &&
- String(this.dataList.bulkDensity).indexOf('.') != -1 &&
- String(this.dataList.bulkDensity).length -
- (String(this.dataList.bulkDensity).indexOf('.') + 1) >
- 2) ||
- this.dataList.bulkDensity > 1000 ||
- this.dataList.bulkDensity < 500
- ) {
- this.$message({
- message: '容重输入错误',
- type: 'warning',
- })
- return
- }
- if (
- this.dataList.protein&&String(this.dataList.protein).indexOf('.') != -1 &&
- String(this.dataList.protein).length -
- (String(this.dataList.protein).indexOf('.') + 1) >
- 2||this.dataList.protein&&this.dataList.protein>80||this.dataList.protein&&this.dataList.protein<1){
- this.$message({
- message: '蛋白占比输入错误',
- type: 'warning'
- })
- return
- }
- if (
- this.dataList.impurity&&String(this.dataList.impurity).indexOf('.') != -1 &&
- String(this.dataList.impurity).length -
- (String(this.dataList.impurity).indexOf('.') + 1) >2
- ||this.dataList.impurity&&this.dataList.impurity>40||this.dataList.impurity&&this.dataList.impurity<1) {
- this.$message({
- message: '杂质输入错误',
- type: 'warning'
- })
- return
- }
- if (
- this.dataList.mildewGrain&&String(this.dataList.mildewGrain).indexOf('.') != -1 &&
- String(this.dataList.mildewGrain).length -
- (String(this.dataList.mildewGrain).indexOf('.') + 1) >
- 2||this.dataList.mildewGrain&&this.dataList.mildewGrain>40||this.dataList.mildewGrain&&this.dataList.mildewGrain<1) {
- this.$message({
- message: '霉变粒输入错误',
- type: 'warning'
- })
- return
- }
- if (
- this.dataList.jiaorenli&&String(this.dataList.jiaorenli).indexOf('.') != -1 &&
- String(this.dataList.jiaorenli).length -
- (String(this.dataList.jiaorenli).indexOf('.') + 1) >
- 2||this.dataList.jiaorenli&&this.dataList.jiaorenli>40||this.dataList.jiaorenli&&this.dataList.jiaorenli<1) {
- this.$message({
- message: '热损伤输入错误',
- type: 'warning'
- })
- return
- }
- if (
- this.dataList.imperfectGrain&&String(this.dataList.imperfectGrain).indexOf('.') != -1 &&
- String(this.dataList.imperfectGrain).length -
- (String(this.dataList.imperfectGrain).indexOf('.') + 1) >
- 2||this.dataList.imperfectGrain&&this.dataList.imperfectGrain>40||this.dataList.imperfectGrain&&this.dataList.imperfectGrain<1) {
- this.$message({
- message: '不完善粒输入错误',
- type: 'warning'
- })
- return
- }
- this.dataList.id = this.$route.query.id
- this.$confirm(`提交后该销售信息将发布到交易平台,是否确定提交?`, {
- cancelButtonText: '取消',
- confirmButtonText: '确定',
- type: 'warning',
- })
- .then(() => {
- this.$refs.dataList.validate((valid) => {
- if (valid) {
- this.dataList.salePlanNo = 'XSJH' + this.getdate() + this.verifyinit()
- this.dataList.sourceProvince = CodeToText[this.selectedOptions[0]]
- this.dataList.sourceCity = CodeToText[this.selectedOptions[1]]
- this.dataList.sendPrivate = CodeToText[this.selectedOptions[0]]
- this.dataList.sendCity = CodeToText[this.selectedOptions[1]]
- this.dataList.sendArea = CodeToText[this.selectedOptions[2]]
- this.dataList.outputPrivate = CodeToText[this.selectedOptions1[0]]
- this.dataList.outputCity = CodeToText[this.selectedOptions1[1]]
- this.dataList.unitPrice=this.dataList.salePrice
- this.dataList.compId = this.compId
- this.dataList.pcFlag = 1
- this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
- console.log(this.dataList, '查看添加对象')
- saleAdd(this.dataList)
- .toPromise()
- .then((response) => {
- this.$message.success('添加成功')
- ;(this.outputYear = ''),
- this.$router.push({ path: 'salesPlanList' })
- })
- } else {
- EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
- return false
- }
- })
- })
- .catch(() => {
- return false
- })
- },
- selectwarehouseName() {},
- tarechange(e) {
- if (this.dataList.grossWeight && this.dataList.tare) {
- this.dataList.netWeight = Number(
- this.dataList.grossWeight - this.dataList.tare
- )
- }
- },
- grossWeightchange(e) {
- if (this.dataList.grossWeight && this.dataList.tare) {
- this.dataList.netWeight = Number(
- this.dataList.grossWeight - this.dataList.tare
- )
- }
- },
- selectgoodsName(e) {
- for (var i = 0; i < this.goodnameList.length; i++) {
- if (this.goodnameList[i].constValue == e) {
- this.dataList.goodsNameKey = this.goodnameList[i].constKey
- }
- }
- },
- selectpackingMethod(e) {
- for (var i = 0; i < this.packtypeList.length; i++) {
- if (this.packtypeList[i].constValue == e) {
- this.dataList.packingMethodKey = this.packtypeList[i].constKey
- }
- }
- },
- selectpackingMethod1(e) {
- for (var i = 0; i < this.packtypeList.length; i++) {
- if (this.packtypeList[i].constValue == e) {
- this.dataList1.packingMethodKey = this.packtypeList[i].constKey
- }
- }
- },
- selectstorageType(e) {
- for (var i = 0; i < this.storageType.length; i++) {
- if (this.storageType[i].constValue == e) {
- this.dataList.inOutTypeKey = this.storageType[i].constKey
- }
- }
- },
- selectstorageType1(e) {
- for (var i = 0; i < this.storageType1.length; i++) {
- if (this.storageType1[i].constValue == e) {
- this.dataList1.inOutTypeKey = this.storageType[i].constKey
- }
- }
- },
- handleClose() {
- this.accessoryTFs = false
- },
- tasktypechange() {
- this.tasknumber()
- },
- GetRandomNum(Min, Max) {
- var Range = Max - Min
- var Rand = Math.random()
- return Min + Math.round(Rand * Range)
- },
- // deletecontract(){},
- //删除
- approve() {},
- listQuery() {},
- total() {},
- clearfiltQuery() {},
- selectCrtDuty() {},
- },
- }
- </script>
- <style lang="scss" scoped>
- /deep/.basicInformation {
- .el-info-table {
- border: none;
- position: relative;
- }
- .el-form-item {
- width: 33.3333%;
- border: none;
- margin: 0;
- .el-form-item__label {
- text-align: left;
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #8890b1;
- }
- .el-form-item__content {
- padding-left: 0px;
- padding-right: 10px;
- // background: #fff;
- white-space: nowrap;
- height: 40px;
- display: flex;
- -webkit-box-align: center;
- align-items: center;
- text-align: left;
- overflow: hidden;
- }
- }
- }
- /deep/.el-radio {
- color: #606266;
- font-weight: 500;
- line-height: 1;
- cursor: pointer;
- white-space: nowrap;
- outline: 0;
- margin-right: 30px;
- margin-top: 15px;
- }
- /deep/.el-radio__inner {
- border: 1px solid #dcdfe6;
- border-radius: 100%;
- width: 14px;
- height: 14px;
- background-color: #fff;
- cursor: pointer;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- margin-left: 100px;
- }
- /deep/.el-radio__input {
- white-space: nowrap;
- cursor: pointer;
- outline: 0;
- line-height: 1;
- vertical-align: middle;
- margin-top: -1px;
- }
- .title {
- position: relative;
- padding-left: 10px;
- }
- .title::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 30px;
- background: #5473e8;
- position: absolute;
- left: 0;
- }
- .el-form {
- padding: 0 15%;
- display: flex;
- flex-wrap: wrap;
- margin-left: -50px;
- margin-top: 15px;
- width: 110%;
- }
- .el-button--primary {
- background-color: #5878e8;
- border-color: #5878e8;
- }
- .el-col {
- background: #f6f7fc;
- }
- .bg-right {
- text-align: right;
- padding: 16px 20px;
- }
- .center {
- position: relative;
- top: 50px;
- width: 40%;
- margin: 0 auto;
- margin-right: 180px;
- }
- /deep/.el-form-item__label {
- width: 160px;
- }
- .inspector {
- width: 50%;
- }
- /deep/.el-form-item--small .el-form-item__label,
- .el-form-item--small .el-form-item__content {
- text-align: left;
- }
- /deep/.el-input--small {
- font-size: 13px;
- position: relative;
- display: inline-block;
- }
- .center1 .small-title {
- margin-left: 323px;
- }
- .center1 {
- width: 90%;
- margin: 0 auto;
- margin-left: 10px;
- margin-top: 25px;
- }
- /deep/.el-input--small .el-input__inner {
- height: 32px;
- line-height: 32px;
- }
- /deep/.el-select {
- display: inline-block;
- position: relative;
- width: 100%;
- }
- .annu {
- height: 81px;
- background: #ffffff;
- border-radius: 4px;
- }
- .basicInformation .el-form-item {
- width: 50.3333%;
- border: none;
- margin: 0;
- }
- .el-form {
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #8890b1;
- line-height: 16px;
- margin-left: 130px;
- }
- .a {
- margin-left: -32px;
- }
- .el-radio-group {
- margin-left: 80px;
- }
- .ding {
- height: 23px;
- background: #e8ecf6;
- box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
- }
- .nav2 {
- height: 25px;
- background: #e8ecf6;
- margin-top: 15px;
- }
- .ziti {
- width: 72px;
- height: 20px;
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #8890b1;
- line-height: 20px;
- margin-left: 314px;
- /* margin-top: 112px; */
- }
- /deep/.ziti1 {
- height: 40px;
- font-size: 16px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #262626;
- line-height: 20px;
- margin-left: 381px;
- margin-top: -21px;
- width: 100px;
- }
- .winseaview-view {
- padding: 0 0 20px;
- }
- .container {
- overflow: scroll;
- height: 93vh;
- }
- /deep/.basicInformation .el-form-item .el-form-item__content {
- padding-left: 0px;
- padding-right: 10px;
- white-space: nowrap;
- height: 40px;
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- text-align: left;
- overflow: hidden;
- font-size: 12px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #232323;
- line-height: 14px;
- }
- .nav {
- width: 400px;
- height: 20px;
- }
- //*号
- .unchangeable {
- position: absolute;
- width: 9px;
- height: 22px;
- font-size: 16px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #ff2727;
- line-height: 22px;
- display: inline-block;
- right: -1px;
- }
- /deep/.typeselect .el-input__inner {
- color: #8890b1;
- }
- </style>
|