| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258 |
- <!--费用模板详情-->
- <template>
- <div class="borderless" v-loading="pageLoading">
- <div class="customer-head">
- <div class="customer-back">
- <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button size="small" type="primary" style="margin-right: 8px" v-if="basicData.disabled"
- :loading="saveLoading" @click="editHandle">编 辑
- </el-button>
- <el-button size="small" type="primary" style="margin-right: 8px" v-else :loading="saveLoading"
- @click="editCustomer">保 存
- </el-button>
- </div>
- </div>
- <div class="customer-main">
- <containerTitle title="基础信息"></containerTitle>
- <basic-container>
- <avue-form :option="basicData" v-model="form" ref="form">
- <tempalte slot="shippingCompanyCname">
- <dic-select v-model="form.shippingCompanyCname" placeholder="船公司" key="id" label="cnName"
- res="records" url="/blade-los/bcorps/selectList?corpTypeName=船公司" :filterable="true"
- :remote="true" dataName="cnName" @selectChange="dicChange('shippingCompanyCname', $event)"
- :disabled="basicData.disabled"></dic-select>
- </tempalte>
- </avue-form>
- </basic-container>
- </div>
- <div class="customer-main margintop">
- <containerTitle title="应收费用详情"></containerTitle>
- <basic-container>
- <avue-crud :option="option" :data="feeDList" id="out-table" ref="crud"
- :header-cell-class-name="headerClassName" :row-style="{ height: '20px', padding: '0px' }"
- :cell-style="{ height: '20px', padding: '0px' }">
- <template slot="indexHeader" slot-scope="{row,index}">
- <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="basicData.disabled" circle
- @click="addDRow()">
- </el-button>
- </template>
- <template slot="index" slot-scope="{row,index}">
- <span>{{ index + 1 }}</span>
- </template>
- <template slot="corpTypeForm" slot-scope="{row,index}">
- <dic-select v-if="row.$cellEdit" v-model="row.corpType" label="cnName" res="records"
- url="/blade-los/bcorpstypedefine/list?status=0¤t=1&size=20" :filterable="true"
- :remote="true" dataName="cnName"
- @selectChange="rowDicChange('corpType', $event, row)"></dic-select>
- <span v-else>{{ row.corpType }}</span>
- </template>
- <template slot="feeCnNameForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" key="id" placeholder="费用名称"
- label="cnName" res="records" url="/blade-los/bfees/list?status=0¤t=1&size=20"
- :filterable="true" :remote="true" dataName="cnName"
- @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
- <span v-else>{{ row.feeCnName }}</span>
- </template>
- <template slot="quantityRuleForm" slot-scope="{row,index}">
- <dic-select v-if="row.$cellEdit" v-model="row.quantityRule" key="id" label="dictValue"
- url="/blade-system/dict-biz/dictionary?code=number_rule" :filterable="true"></dic-select>
- <span v-else>{{ row.quantityRule }}</span>
- </template>
- <template slot="unitNoForm" slot-scope="{row,index}">
- <dic-select v-if="row.$cellEdit" v-model="row.unitNo" key="id" label="cnName"
- url="/blade-los//bunits/listAll" :filterable="true" :disabled="row.quantityRule == '按箱型'"
- @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
- <span v-else>{{ row.unitNo }}</span>
- </template>
- <template slot="quantityForm" slot-scope="{row,index}">
- <el-input-number style="width: 100%;" v-if="row.$cellEdit" v-model="row.quantity"
- :disabled="row.quantityRule == '按箱型'" :controls="false" size="small"></el-input-number>
- <span v-else>{{ row.quantity }}</span>
- </template>
- <template slot="priceForm" slot-scope="{row,index}">
- <el-input-number style="width: 100%;" v-if="row.$cellEdit" v-model="row.price"
- :disabled="row.quantityRule == '按箱型'" :controls="false" size="small"></el-input-number>
- <span v-else>{{ row.price }}</span>
- </template>
- <template slot="costPriceForm" slot-scope="{row,index}">
- <el-input-number style="width: 100%;" v-if="row.$cellEdit" v-model="row.costPrice"
- :disabled="row.quantityRule == '按箱型'" :controls="false" size="small"></el-input-number>
- <span v-else>{{ row.costPrice }}</span>
- </template>
- <template slot="curCodeForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" :disabled="row.quantityRule == '按箱型'" v-model="row.curCode"
- placeholder="币别" label="dictValue"
- url="/blade-system/dict-biz/dictionary?code=currency"></dic-select>
- <span v-else>{{ row.curCode }}</span>
- </template>
- <template slot="menu" slot-scope="{ row, index }">
- <el-button v-if="row.quantityRule == '按箱型'" type="text" size="small"
- :disabled="basicData.disabled"
- @click="feestemplateCompanyEdit(index, row, 'D')">集装箱</el-button>
- <el-button size="small" type="text" :disabled="basicData.disabled" @click="rowCell(row, index)">
- {{ row.$cellEdit ? '保存' : '编辑' }}
- </el-button>
- <el-button size="small" type="text" :disabled="basicData.disabled"
- @click="feeDDelete(index, row)">删除</el-button>
- </template>
- </avue-crud>
- </basic-container>
- </div>
- <div class="customer-main margintop">
- <containerTitle title="应付费用详情"></containerTitle>
- <basic-container>
- <avue-crud :option="option" :data="feeCList" id="out-table" ref="crud"
- :header-cell-class-name="headerClassName" :row-style="{ height: '20px', padding: '0px' }"
- :cell-style="{ height: '20px', padding: '0px' }">
- <template slot="indexHeader" slot-scope="{row,index}">
- <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="basicData.disabled" circle
- @click="addCRow()">
- </el-button>
- </template>
- <template slot="index" slot-scope="{row,index}">
- <span>{{ index + 1 }}</span>
- </template>
- <template slot="corpTypeForm" slot-scope="{row,index}">
- <dic-select v-if="row.$cellEdit" v-model="row.corpType" key="id" label="dictValue"
- url="/blade-system/dict-biz/dictionary?code=corp_type" :filterable="true"
- @selectChange="rowDicChange('corpType', $event, row)"></dic-select>
- <span v-else>{{ row.corpType }}</span>
- </template>
- <template slot="feeCnNameForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" key="id" placeholder="费用名称"
- label="cnName" res="records" url="/blade-los/bfees/list?status=0¤t=1&size=20"
- :filterable="true" :remote="true" dataName="cnName"
- @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
- <span v-else>{{ row.feeCnName }}</span>
- </template>
- <template slot="quantityRuleForm" slot-scope="{row,index}">
- <dic-select v-if="row.$cellEdit" v-model="row.quantityRule" key="id" label="dictValue"
- url="/blade-system/dict-biz/dictionary?code=number_rule" :filterable="true"></dic-select>
- <span v-else>{{ row.quantityRule }}</span>
- </template>
- <template slot="unitNoForm" slot-scope="{row,index}">
- <dic-select v-if="row.$cellEdit" v-model="row.unitNo" key="id" label="cnName"
- url="/blade-los//bunits/listAll" :filterable="true" :disabled="row.quantityRule == '按箱型'"
- @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
- <span v-else>{{ row.unitNo }}</span>
- </template>
- <template slot="quantityForm" slot-scope="{row,index}">
- <el-input-number style="width: 100%;" v-if="row.$cellEdit" v-model="row.quantity"
- :disabled="row.quantityRule == '按箱型'" :controls="false" size="small"></el-input-number>
- <span v-else>{{ row.quantity }}</span>
- </template>
- <template slot="priceForm" slot-scope="{row,index}">
- <el-input-number style="width: 100%;" v-if="row.$cellEdit" v-model="row.price"
- :disabled="row.quantityRule == '按箱型'" :controls="false" size="small"></el-input-number>
- <span v-else>{{ row.price }}</span>
- </template>
- <template slot="costPriceForm" slot-scope="{row,index}">
- <el-input-number style="width: 100%;" v-if="row.$cellEdit" v-model="row.costPrice"
- :disabled="row.quantityRule == '按箱型'" :controls="false" size="small"></el-input-number>
- <span v-else>{{ row.costPrice }}</span>
- </template>
- <template slot="curCodeForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" :disabled="row.quantityRule == '按箱型'" v-model="row.curCode"
- placeholder="币别" label="dictValue"
- url="/blade-system/dict-biz/dictionary?code=currency"></dic-select>
- <span v-else>{{ row.curCode }}</span>
- </template>
- <template slot="menu" slot-scope="{ row, index }">
- <el-button v-if="row.quantityRule == '按箱型'" type="text" size="small"
- :disabled="basicData.disabled"
- @click="feestemplateCompanyEdit(index, row, 'C')">集装箱</el-button>
- <el-button size="small" type="text" :disabled="basicData.disabled" @click="rowCell(row, index)">
- {{ row.$cellEdit ? '保存' : '编辑' }}
- </el-button>
- <el-button size="small" type="text" :disabled="basicData.disabled"
- @click="feeCDelete(index, row)">删除</el-button>
- </template>
- </avue-crud>
- </basic-container>
- </div>
- <!--费用详细添加弹窗-->
- <el-dialog title="费用详情" :visible.sync="feestemplateVisible" width="60%" append-to-body :destroy-on-close="true"
- :modal-append-to-body="false" :close-on-click-modal="false" :before-close="feestemplateClose">
- <div>
- <avue-crud :option="sonOption" :data="feestemplateForm.sonItemsList">
- <template slot="indexHeader" slot-scope="{row,index}">
- <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="basicData.disabled" circle
- @click="addRow()">
- </el-button>
- </template>
- <template slot="index" slot-scope="{row,index}">
- <span>{{ index + 1 }}</span>
- </template>
- <template slot="typeForm" slot-scope="{row,index}">
- <dic-select v-if="row.$cellEdit" v-model="row.type" key="id" label="dictValue"
- url="/blade-system/dict-biz/dictionary?code=corp_type" :filterable="true"></dic-select>
- <span v-else>{{ row.type }}</span>
- </template>
- <template slot="feeCnNameForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" key="id" placeholder="箱型"
- label="cnName" res="records" url="/blade-los/bfees/list?status=0¤t=1&size=20"
- :filterable="true" :remote="true" dataName="cnName"
- @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
- <span v-else>{{ row.feeCnName }}</span>
- </template>
- <template slot="unitNoForm" slot-scope="{row,index}">
- <span>
- <dic-select
- v-if="row.$cellEdit && (feestemplateForm.quantityRule == '按箱型' || feestemplateForm.quantityRule == '按TEU')"
- v-model="row.unitNo" key="id" label="cnName" res="records"
- url="/blade-los/bcntrtypes/list?status=0¤t=1&size=20" :filterable="true"
- :remote="true" dataName="cnName"
- @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
- <dic-select
- v-if="row.$cellEdit && !(feestemplateForm.quantityRule == '按箱型' || feestemplateForm.quantityRule == '按TEU')"
- v-model="row.unitNo" key="id" label="cnName" res="records"
- url="/blade-los/bunits/list?status=0¤t=1&size=20" :filterable="true"
- :remote="true" dataName="cnName"
- @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
- <span v-if="!row.$cellEdit">{{ row.unitNo }}</span>
- </span>
- </template>
- <template slot="menu" slot-scope="{ row, index }">
- <el-button size="small" type="text" :disabled="basicData.disabled" @click="rowEdit(row, index)">
- {{ row.$cellEdit ? '保存' : '编辑' }}
- </el-button>
- <el-button type="text" size="small" :disabled="basicData.disabled"
- @click="rowDel(index, row)">删除</el-button>
- </template>
- </avue-crud>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="feestemplateVisible = false;">取 消</el-button>
- <el-button type="primary" @click="feestemplatecompanyConfirm">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { losbfeestemplateDetail, losbfeestemplateSubmit, copytemplateDetail, itemRemove, remove } from "@/api/iosBasicData/losbfeestemplate";
- import { bfeesList } from "@/api/iosBasicData/bfees";
- import { getBcorpsList } from "@/api/iosBasicData/bcorps";
- import { getRateList } from "@/api/iosBasicData/rateManagement";
- import { getBunitsList } from "@/api/iosBasicData/bunits";
- import SearchQuery from '@/components/iosbasic-data/searchquery.vue'
- import bcorps from "@/views/iosBasicData/bcorps/index.vue";
- import bfeesdefine from "@/views/iosBasicData/bfeesdefine/index.vue";
- import bbusinesstype from "@/views/iosBasicData/bbusinesstype/index.vue";
- import bunits from "@/views/iosBasicData/bunits/index.vue";
- import { getWorkDicts } from "@/api/system/dictbiz";
- import { bcntrtypesList } from "@/api/iosBasicData/bcntrtypes";
- import dicSelect from "@/components/dicSelect/main";
- export default {
- components: { SearchQuery, bcorps, bfeesdefine, bbusinesstype, bunits, dicSelect },
- props: {
- detailData: {
- type: Object
- }
- },
- data() {
- return {
- feeDList: [],
- feeCList: [],
- sonOption: {
- calcHeight: 30,
- // tip: false,
- border: true,
- // addBtn: false,
- // viewBtn: false,
- editBtn: false,
- delBtn: false,
- // refreshBtn: false,
- // selection: true,
- header: false,
- align: 'center',
- menu: true,
- menuWidth: 100,
- column: [
- {
- label: "index",
- prop: "index",
- width: "55",
- headerslot: true,
- },
- {
- label: '计量单位',
- prop: 'unitNo',
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- },
- {
- label: '销售价',
- prop: 'salesPrice',
- cell: true,
- type: 'number',
- controls: false,
- overHidden: true,
- },
- {
- label: '成本价',
- prop: 'costPrice',
- cell: true,
- type: 'number',
- controls: false,
- overHidden: true,
- },
- {
- label: '币种',
- prop: 'curCode',
- overHidden: true,
- cell: true,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- },
- ]
- },
- pageLoading: false,
- saveLoading: false,
- // 费用详细弹窗
- feestemplateVisible: false,
- // 费用详细弹窗绑定的数据
- feestemplateForm: {
- sonItemsList: []
- },
- feestemplateIndex: null,
- // 客户请求数据
- corpData: [],
- // 费用请求数据
- feeData: [],
- // 数量规则字典数据
- quantityRuleData: [],
- //客户类型
- corpTypeData: [],
- // 币别请求数据
- curCodeData: [],
- // 计算属性数据
- unitNoData: [],
- // 获取到的数据
- form: {
- isShared: '1',
- status: 0,
- feesTemplateItemsList: []
- },
- // 基础资料数据
- basicData: {
- menuBtn: false,
- span: 8,
- disabled: false,
- labelWidth: 100,
- column: [
- {
- label: "模版编号",
- prop: "code",
- disabled: false,
- rules: [{
- required: true,
- message: "请输入模版编号",
- trigger: "blur"
- }]
- },
- {
- label: "模版中文名称",
- prop: "cnName",
- disabled: false,
- rules: [{
- required: true,
- message: "请输入模版中文名称",
- trigger: "blur"
- }]
- },
- {
- label: "模版英文名称",
- prop: "enName",
- disabled: false,
- rules: [{
- required: true,
- message: "",
- trigger: "blur"
- }]
- },
- {
- label: "船公司",
- prop: "shippingCompanyCname",
- disabled: false,
- rules: [{
- required: true,
- message: "",
- trigger: "blur"
- }]
- },
- {
- label: "状态",
- prop: "status",
- disabled: false,
- type: 'select',
- dicData: [{
- label: '启用',
- value: 0
- }, {
- label: '停用',
- value: 1
- }],
- },
- {
- label: "备注",
- prop: "remarks",
- disabled: false,
- span: 24,
- type: 'textarea',
- minRows: 3,
- },
- ]
- },
- option: {
- // height: 'auto',
- calcHeight: 30,
- menuWidth: 160,
- border: true,
- header: false,
- editBtn: false,
- delBtn: false,
- align: 'center',
- menu: true,
- column: [
- {
- label: "index",
- prop: "index",
- width: "55",
- headerslot: true,
- },
- {
- label: "客户类型",
- prop: "corpType",
- width: "120",
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- },
- {
- label: "费用名称",
- prop: "feeCnName",
- width: "120",
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [{
- required: true,
- message: "请选择费用名称",
- trigger: "blur"
- }]
- },
- {
- label: "费用编码",
- prop: "feeCode",
- width: "120",
- overHidden: true,
- },
- {
- label: "费用英文",
- prop: "feeEnName",
- width: "120",
- overHidden: true,
- },
- {
- label: "数量规则",
- prop: "quantityRule",
- width: "120",
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [{
- required: true,
- message: "请选择数量规则",
- trigger: "blur"
- }]
- },
- {
- label: "计量单位",
- prop: "unitNo",
- width: "120",
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [{
- required: true,
- message: "请选择计量单位",
- trigger: "blur"
- }]
- },
- {
- label: "数量",
- prop: "quantity",
- width: "80",
- cell: true,
- slot: true,
- formslot: true,
- // cell: true,
- // type: 'number',
- // controls: false,
- overHidden: true,
- rules: [{
- required: true,
- message: "请输入数量",
- trigger: "blur"
- }]
- },
- {
- label: "销售价",
- prop: "price",
- width: "120",
- cell: true,
- slot: true,
- formslot: true,
- // cell: true,
- // type: 'number',
- // controls: false,
- overHidden: true,
- rules: [{
- required: true,
- message: "请输入销售价",
- trigger: "blur"
- }]
- },
- {
- label: "成本价",
- prop: "costPrice",
- width: "120",
- cell: true,
- slot: true,
- formslot: true,
- // cell: true,
- // type: 'number',
- // controls: false,
- overHidden: true,
- rules: [{
- required: true,
- message: "请输入成本价",
- trigger: "blur"
- }]
- },
- {
- label: "计量单位",
- prop: "unitNo",
- width: "120",
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [{
- required: true,
- message: "请选择计量单位",
- trigger: "blur"
- }]
- },
- {
- label: "币别",
- prop: "curCode",
- width: "100",
- cell: true,
- slot: true,
- formslot: true,
- // cell: true,
- // type: 'select',
- // dicData: [{
- // label: 'CNY',
- // value: 'CNY'
- // }, {
- // label: 'USD',
- // value: 'USD'
- // }],
- overHidden: true,
- rules: [{
- required: true,
- message: "请选择币别",
- trigger: "blur"
- }]
- },
- {
- label: "备注",
- prop: "remarks",
- cell: true,
- overHidden: true,
- }
- ]
- },
- // 费用详细数据
- feestemplateData: {
- column: [
- {
- label: "客户类型",
- prop: "corpType",
- },
- {
- label: "客户",
- prop: "corpCnName",
- // rules: [{
- // required: true,
- // message: "",
- // trigger: "blur"
- // }]
- },
- {
- label: "费用",
- prop: "feeCnName",
- rules: [{
- required: true,
- message: "",
- trigger: "blur"
- }]
- },
- {
- label: "费用编码",
- prop: "feeCode",
- disabled: true,
- },
- // {
- // label: "费用中文名称",
- // prop: "feeCnName",
- // disabled:true,
- // },
- {
- label: "费用英文名称",
- prop: "feeEnName",
- disabled: true,
- },
- {
- label: "数量规则",
- prop: "quantityRule",
- rules: [{
- required: true,
- message: "请输入数量规则,用于根据单位自动计算数量",
- trigger: "blur"
- }]
- },
- {
- label: "数量",
- prop: "quantity",
- rules: [{
- required: true,
- // message: "请输入数量",
- trigger: "blur"
- }, {
- pattern: /-?[1-9]\d*/,
- // message:"请输入数字",
- trigger: 'blur'
- }]
- },
- {
- label: "单价",
- prop: "price",
- rules: [{
- required: true,
- // message: "请输入单价",
- trigger: "blur"
- }, {
- // pattern:/[1-9]\d*.\d*|0\.\d*[1-9]\d*/,
- pattern: /-?[1-9]\d*/,
- // message:"请输入数字",
- trigger: 'blur'
- }]
- },
- {
- label: "计量单位",
- prop: "unitNo",
- rules: [{
- required: true,
- // message: "请输入计量单位",
- trigger: "blur"
- }]
- },
- {
- label: "币别",
- prop: "curCode",
- rules: [{
- required: true,
- // message: "请输入币别",
- trigger: "blur"
- }]
- },
- {
- label: "备注",
- prop: "remarks",
- span: 24,
- type: 'textarea',
- minRows: 3,
- },
- ]
- },
- }
- },
- created() {
- if (this.detailData.businessTypeId) {
- this.form = {
- businessTypeId: this.detailData.businessTypeId,
- businessTypeCnName: this.detailData.businessTypeCnName,
- businessTypeEnName: this.detailData.businessTypeEnName,
- businessTypeCode: this.detailData.businessTypeCode,
- isShared: '1',
- status: 0,
- feesTemplateItemsList: []
- }
- }
- this.getBcorpsListfun()
- this.bfeesListfun()
- this.quantityRuleWorkDictsfun()
- this.getRateListfun()
- this.getBunitsListfun()
- this.getcorpTypeData()
- if (this.detailData.id) {
- this.basicData.disabled = true
- this.losbfeestemplateDetailfun(this.detailData.id)
- }
- },
- methods: {
- rowCell(row, index) {
- if (!row.feeCnName || !row.quantityRule || !row.quantity || !row.price || !row.curCode) {
- this.$refs.crud.rowCell(row, index)
- return this.$message.error("请完善明细信息");
- }
- if (row.$cellEdit == true) {
- this.$set(row, "$cellEdit", false);
- } else {
- this.$set(row, "$cellEdit", true);
- }
- },
- rowEdit(row) {
- if (row.$cellEdit == true) {
- this.$set(row, "$cellEdit", false);
- } else {
- this.$set(row, "$cellEdit", true);
- }
- },
- rowDicChange(name, row, el) {
- if (name == 'corpCnName') {
- if (row) {
- el.corpId = row.id
- el.corpEnName = row.enName
- } else {
- el.corpId = null
- el.corpEnName = null
- el.corpCnName = null
- }
- }
- if (name == 'feeCnName') {
- if (row) {
- el.feeId = row.id
- el.feeCode = row.code
- el.feeEnName = row.enName
- } else {
- el.feeId = null
- el.feeCode = null
- el.feeCnName = null
- el.feeEnName = null
- }
- }
- if (name == 'unitNo') {
- if (row) {
- el.unitId = row.id
- } else {
- el.unitId = null
- el.unitNo = null
- }
- }
- if (name == 'corpType') {
- if (!row) {
- el.corpType = null
- }
- }
- },
- dicChange(name, row) {
- if (name == 'shippingCompanyCname') {
- if (row) {
- this.form.shippingCompanyId = row.id
- this.form.shippingCompanyCode = row.code
- } else {
- this.form.shippingCompanyId = null
- this.form.shippingCompanyCode = null
- this.form.shippingCompanyCname = null
- }
- }
- if (name == 'addressCname') {
- if (row) {
- this.form.addressId = row.id
- this.form.addressCode = row.code
- } else {
- this.form.addressId = null
- this.form.addressCode = null
- this.form.addressCname = null
- }
- }
- },
- addRow() {
- this.feestemplateForm.sonItemsList.push({
- pid: this.form.id,
- unitId: this.feestemplateForm.unitId,
- unitNo: this.feestemplateForm.unitNo,
- curCode: this.feestemplateForm.curCode,
- salesPrice: 0,
- costPrice: 0,
- $cellEdit: true
- })
- },
- copyItem(index, row) {
- let item = this.deepClone(row)
- item.id = null;
- item.sonItemsList.forEach(e => {
- delete e.id
- delete e.createUser
- delete e.createUserName
- delete e.createTime
- delete e.updateUser
- delete e.updateUserName
- delete e.updateTime
- })
- this.form.feesTemplateItemsList.push({ ...item, $cellEdit: true })
- // item.pid = null;
- // this.feestemplateForm = item
- // this.feestemplateVisible = true
- // this.form.feesTemplateItemsList.push(item)
- },
- getCopyTemplate(id) {
- this.pageLoading = true
- copytemplateDetail(id).then(res => {
- this.form = res.data.data;
- this.pageLoading = false
- this.editHandle()
- })
- },
- // 获取客户数据
- getBcorpsListfun(cnName) {
- getBcorpsList(1, 10, { cnName }).then(res => {
- this.corpData = res.data.data.records
- })
- },
- bfeesListfun(cnName) {
- bfeesList(1, 10, { cnName }).then(res => {
- this.feeData = res.data.data.records
- })
- },
- getcorpTypeData() {
- getWorkDicts('corp_type').then(res => {
- this.corpTypeData = res.data.data
- })
- },
- // 获取数量规则字典数据
- quantityRuleWorkDictsfun() {
- getWorkDicts('number_rule').then(res => {
- this.quantityRuleData = res.data.data
- })
- },
- // 获取币别数据
- getRateListfun(cnName) {
- getRateList({
- current: 1,
- size: 10,
- cnName
- }).then(res => {
- this.curCodeData = res.data.data.records
- })
- },
- // 获取计算属性
- getBunitsListfun(code) {
- if (this.feestemplateForm.quantityRule == 1 || this.feestemplateForm.quantityRule == 4) {
- bcntrtypesList(1, 10, { code, status: 0 }).then(res => {
- this.unitNoData = res.data.data.records
- })
- } else {
- getBunitsList(1, 10, { code, status: 0 }).then(res => {
- this.unitNoData = res.data.data.records
- })
- }
- },
- // 客户选择之后的回调
- corpCorpChange(value) {
- if (value) {
- for (let item of this.corpData) {
- if (item.cnName == value) {
- this.$set(this.feestemplateForm, 'corpId', item.id)
- this.$set(this.feestemplateForm, 'corpEnName', item.enName)
- this.$set(this.feestemplateForm, 'corpCnName', item.cnName)
- }
- }
- } else {
- this.$set(this.feestemplateForm, 'corpId', null)
- this.$set(this.feestemplateForm, 'corpEnName', null)
- this.$set(this.feestemplateForm, 'corpCnName', null)
- }
- },
- // 费用选择之后的回调
- feeCorpChange(value) {
- for (let item of this.feeData) {
- if (item.id == value) {
- this.$set(this.feestemplateForm, 'feeId', item.id)
- this.$set(this.feestemplateForm, 'feeCode', item.code)
- this.$set(this.feestemplateForm, 'feeEnName', item.enName)
- this.$set(this.feestemplateForm, 'feeCnName', item.cnName)
- // 核算要素
- this.$set(this.feestemplateForm, 'elementsId', item.accElementId)
- this.$set(this.feestemplateForm, 'elementsCnName', item.accElementName)
- this.$set(this.feestemplateForm, 'elementsCode', item.elementsCode)
- this.$set(this.feestemplateForm, 'elementsEnName', item.elementsEnName)
- }
- }
- },
- corpTypeChange(value) {
- if (value) {
- this.$set(this.feestemplateForm, 'corpType', value)
- } else {
- this.$set(this.feestemplateForm, 'corpType', null)
- }
- },
- // 数量规则下拉回调
- quantityRuleChange(value) {
- console.log(value)
- if (value == 1 || value == 4) {
- bcntrtypesList(1, 10, { status: 0 }).then(res => {
- this.unitNoData = res.data.data.records
- })
- } else {
- getBunitsList(1, 10, { status: 0 }).then(res => {
- this.unitNoData = res.data.data.records
- })
- }
- this.$set(this.feestemplateForm, 'quantityRule', value)
- this.$set(this.feestemplateForm, 'unitNo', '')
- },
- // 币别选择之后的回调
- curCodeCorpChange(value) {
- this.$set(this.feestemplateForm, 'curCode', value)
- },
- // 计算属性选择之后
- unitNoCorpChange(value) {
- for (let item of this.unitNoData) {
- if (item.code == value) {
- this.$set(this.feestemplateForm, 'unitId', item.id)
- this.$set(this.feestemplateForm, 'unitNo', item.code)
- }
- }
- },
- // 查找弹窗里选择导出
- eldialogConfirm(name) {
- console.log(name)
- if (name == 'corpCnName') {
- if (this.$refs.bcorps[0].isShow) {
- console.log('列表确认')
- this.$set(this.feestemplateForm, 'corpId', this.$refs.bcorps[0].selectionList[0].id)
- this.$set(this.feestemplateForm, 'corpEnName', this.$refs.bcorps[0].selectionList[0].enName)
- this.$set(this.feestemplateForm, 'corpCnName', this.$refs.bcorps[0].selectionList[0].cnName)
- } else {
- console.log('详情确认')
- this.$refs.bcorps[0].$refs.detail.submitForm()
- this.$set(this.feestemplateForm, 'corpCnName', this.$refs.bcorps[0].$refs.detail.formData.cnName)
- this.$set(this.feestemplateForm, 'corpEnName', this.$refs.bcorps[0].$refs.detail.formData.enName)
- this.$set(this.feestemplateForm, 'corpId', this.$refs.bcorps[0].$refs.detail.formData.id)
- }
- this.$refs.SearchCorp[0].corpVisible = false
- } else if (name == 'feeCnName') {
- this.$set(this.feestemplateForm, 'feeId', this.$refs.bfeesdefine[0].selectionList[0].id)
- this.$set(this.feestemplateForm, 'feeCode', this.$refs.bfeesdefine[0].selectionList[0].code)
- this.$set(this.feestemplateForm, 'feeEnName', this.$refs.bfeesdefine[0].selectionList[0].enName)
- this.$set(this.feestemplateForm, 'feeCnName', this.$refs.bfeesdefine[0].selectionList[0].cnName)
- // 核算要素
- this.$set(this.feestemplateForm, 'elementsId', this.$refs.bfeesdefine[0].selectionList[0].accElementId)
- this.$set(this.feestemplateForm, 'elementsCnName', this.$refs.bfeesdefine[0].selectionList[0].accElementName)
- this.$set(this.feestemplateForm, 'elementsCode', this.$refs.bfeesdefine[0].selectionList[0].elementsCode)
- this.$set(this.feestemplateForm, 'elementsEnName', this.$refs.bfeesdefine[0].selectionList[0].elementsEnName)
- this.$refs.SearchFee[0].corpVisible = false
- } else if (name == 'unitNo') {
- this.$set(this.feestemplateForm, 'unitId', this.$refs.bunits[0].selectionList[0].id)
- this.$set(this.feestemplateForm, 'unitNo', this.$refs.bunits[0].selectionList[0].code)
- this.$refs.SearchUnitNo[0].corpVisible = false
- }
- },
- // 下拉多选弹窗数据多选回调
- eldialogMultipleChoice(list, name) {
- console.log(list, name)
- let arr = []
- if (list.length > 1) {
- this.$refs[name][0].$refs.crud.toggleSelection() // 先清空所以选择的数据
- arr = [list[list.length - 1]] // 获取最新点击的数组
- this.$refs[name][0].$refs.crud.toggleSelection(arr, true) // 把刚点击的数组变成选择状态
- } else {
- arr = list
- }
- this.$refs[name][0].selectionList = arr
- },
- // 获取详情数据
- losbfeestemplateDetailfun(id) {
- this.pageLoading = true
- losbfeestemplateDetail(id).then(res => {
- this.feeDList = res.data.data.feesTemplateItemsList.filter(item => item.dc == 'D')
- this.feeCList = res.data.data.feesTemplateItemsList.filter(item => item.dc == 'C')
- this.form = res.data.data;
- }).finally(() => {
- this.pageLoading = false
- })
- },
- // 编辑按钮更改状态
- editHandle() {
- this.basicData.disabled = false;
- },
- // 保存按钮
- editCustomer() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- this.form.feesTemplateItemsList = [...this.feeDList, ...this.feeCList]
- if (this.form.feesTemplateItemsList && this.form.feesTemplateItemsList.length) {
- let ids = []
- for (let item of this.form.feesTemplateItemsList) {
- if (item.quantityRule != '按箱型') {
- if (item.sonItemsList.length) {
- for (let row of item.sonItemsList) {
- if (row.id) {
- ids.push(row.id)
- }
- }
- }
- }
- }
- if (ids.length) {
- this.form.feesTemplateItemsList.forEach(item => {
- if (item.quantityRule != '按箱型') {
- item.sonItemsList = []
- }
- })
- remove({ ids: ids.join(',') })
- }
- }
- this.losbfeestemplateSubmitfun()
- } else {
- return false;
- }
- })
- },
- // 保存接口
- losbfeestemplateSubmitfun() {
- this.saveLoading = true
- losbfeestemplateSubmit(this.form).then((res) => {
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.losbfeestemplateDetailfun(res.data.data.id)
- // this.basicData.disabled = true;
- }).finally(() => {
- this.saveLoading = false;
- })
- },
- // 费用详细添加
- addDRow() {
- if (!this.form.id) {
- this.$message({
- type: "error",
- message: "请保存数据!"
- });
- return
- }
- this.feeDList.push({
- quantity: 1,
- price: 1,
- dc: 'D',
- quantityRule: '按箱型',
- curCode: 'CNY',
- sonItemsList: [],
- $cellEdit: true
- })
- },
- // 费用详细添加
- addCRow() {
- if (!this.form.id) {
- this.$message({
- type: "error",
- message: "请保存数据!"
- });
- return
- }
- this.feeCList.push({
- quantity: 1,
- price: 1,
- dc: 'C',
- quantityRule: '按箱型',
- curCode: 'CNY',
- sonItemsList: [],
- $cellEdit: true
- })
- },
- // 费用详细编辑
- feestemplateCompanyEdit(index, row) {
- if (!row.feeCnName || !row.quantityRule || !row.quantity || !row.price || !row.curCode) {
- this.$refs.crud.rowCell(row, index)
- return this.$message.error("请完善明细信息");
- }
- this.feestemplateForm = JSON.parse(JSON.stringify(row))
- this.feestemplateIndex = index
- this.feestemplateVisible = true
- },
- // 费用详细删除
- feeDDelete(index, row, dc) {
- if (row.id) {
- itemRemove({ ids: row.id }).then(res => {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.feeDList.splice(index, 1)
- })
- } else {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.feeDList.splice(index, 1)
- }
- },
- // 费用详细删除
- feeCDelete(index, row, dc) {
- if (row.id) {
- itemRemove({ ids: row.id }).then(res => {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.feeCList.splice(index, 1)
- })
- } else {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.feeCList.splice(index, 1)
- }
- },
- // 费用详细删除
- rowDel(index, row) {
- if (row.id) {
- remove({ ids: row.id }).then(res => {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.feestemplateForm.sonItemsList.splice(index, 1)
- })
- } else {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.feestemplateForm.sonItemsList.splice(index, 1)
- }
- },
- // 费用详细确认
- feestemplatecompanyConfirm() {
- if (this.feestemplateIndex != null) {
- console.log(this.feestemplateForm, this.feestemplateIndex)
- if (this.feestemplateForm.dc == 'D') {
- this.feeDList.splice(this.feestemplateIndex, 1, this.feestemplateForm)
- }
- if (this.feestemplateForm.dc == 'C') {
- this.feeCList.splice(this.feestemplateIndex, 1, this.feestemplateForm)
- console.log(this.feeCList)
- }
- }
- this.feestemplateForm = {}
- this.feestemplateIndex = null
- this.feestemplateVisible = false
- },
- // 费用详细关闭
- feestemplateClose(done) {
- done();
- // this.$confirm('确认关闭?')
- // .then(_ => {
- // done();
- // })
- // .catch(_ => {});
- },
- //返回列表
- backToList() {
- this.$emit('goBack')
- },
- // 表头样式
- tableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
- return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff;textAlign:center"
- },
- // 更改表格颜色
- headerClassName(tab) {
- //颜色间隔
- let back = ""
- if (tab.columnIndex >= 0 && tab.column.level === 1) {
- if (tab.columnIndex % 2 === 0) {
- back = "back-one"
- } else if (tab.columnIndex % 2 === 1) {
- back = "back-two"
- }
- }
- return back;
- },
- }
- }
- </script>
- <style scoped>
- ::v-deep#out-table .back-one {
- background: #ecf5ff !important;
- }
- ::v-deep#out-table .back-two {
- background: #ecf5ff !important;
- }
- .borderless {
- height: 100%;
- box-sizing: border-box
- }
- .customer-main {
- margin-bottom: 15px;
- }
- .margintop {
- margin-top: 10px;
- }
- ::v-deep.el-form-item {
- margin-bottom: 0;
- }
- .isShow {
- display: none;
- }
- .nowrapClass {
- width: 100%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- </style>
|