1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="88px">
- <el-row>
- <el-form-item label="客户名称" prop="fCorpid">
- <el-select
- v-model="queryParams.fCorpid"
- filterable
- remote
- clearable
- style="width: 200px"
- @keyup.enter.native="handleQuery"
- :remote-method="corpsRemoteMethod"
- placeholder="请输入客户名称"
- >
- <el-option
- v-for="(dict, index) in fMblnoOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="制单部门" prop="fDeptid">
- <el-input
- v-model="queryParams.fDeptid"
- placeholder="请输入制单部门"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="有效期起" prop="fBegindate">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="queryParams.fBegindate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择有效期起"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="有效期至" prop="fEnddate">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="queryParams.fEnddate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择有效期至"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="协议编号" prop="fContractno">
- <el-input
- v-model="queryParams.fContractno"
- placeholder="请输入协议编号"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="作业费类型" prop="fTaskType" label-width="90px">
- <el-select v-model="queryParams.fTaskType" clearable placeholder="请选择作业费类型" :disabled="browseStatus">
- <el-option label="车队作业费" value="1"/>
- <el-option label="劳务作业费" value="2"/>
- </el-select>
- </el-form-item>
- <el-form-item label="商品类别" prop="tPackages">
- <el-select v-model="queryParams.tPackages" clearable placeholder="请选择商品类别" :disabled="browseStatus">
- <el-option
- v-for="dict in fTypeidOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- style="width: 200px;"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="费用类型" prop="fDc">
- <el-select v-model="queryParams.fDc" clearable placeholder="请选择费用类型" style="width: 200px;" :disabled="browseStatus">
- <el-option label="收" value="D"></el-option>
- <el-option label="付" value="C"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-row>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd()"
- v-hasPermi="['agreement:agreementTask:add']"
- >新增
- </el-button>
- </el-col>
- <!-- <el-col :span="1.5">-->
- <!-- <el-button-->
- <!-- type="success"-->
- <!-- icon="el-icon-edit"-->
- <!-- size="mini"-->
- <!-- :disabled="single"-->
- <!-- @click="handleUpdate"-->
- <!-- v-hasPermi="['agreement:agreementTask:edit']"-->
- <!-- >修改-->
- <!-- </el-button>-->
- <!-- </el-col>-->
- <!-- <el-col :span="1.5">-->
- <!-- <el-button-->
- <!-- type="danger"-->
- <!-- icon="el-icon-delete"-->
- <!-- size="mini"-->
- <!-- :disabled="multiple"-->
- <!-- @click="handleDelete"-->
- <!-- v-hasPermi="['agreement:agreementTask:remove']"-->
- <!-- >删除-->
- <!-- </el-button>-->
- <!-- </el-col>-->
- <el-col :span="1.5">
- <el-button
- type="warning"
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- v-hasPermi="['agreement:agreementTask:export']"
- >导出
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="info"
- icon="el-icon-download"
- size="mini"
- :disabled="single"
- @click="handleUpdate(null,2)"
- v-hasPermi="['agreement:agreementStorage:export']"
- >复制新增
- </el-button>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-table v-loading="loading" :data="agreementList" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="55" align="center"/>
- <el-table-column type="index" label="行号" align="center" fixed/>
- <el-table-column label="客户名称" sortable align="center" prop="fCorpid" fixed width="220"/>
- <el-table-column label="作业费类型" sortable align="center" prop="fTaskType" fixed width="220">
- <template slot-scope="scope">
- <span v-if="scope.row.fTaskType === 1">车队作业费</span>
- <span v-if="scope.row.fTaskType === 2">劳务作业费</span>
- </template>
- </el-table-column>
- <el-table-column label="商品类别" sortable align="center" prop="tPackages" fixed width="220" :formatter="tPackagesFormat"/>
- <el-table-column label="费用类型" sortable align="center" prop="fDc" fixed width="220">
- <template slot-scope="scope">
- <span v-if="scope.row.fDc === 'D'">收</span>
- <span v-if="scope.row.fDc === 'C'">付</span>
- </template>
- </el-table-column>
- <el-table-column label="协议编号" sortable align="center" prop="fContractno" show-overflow-tooltip/>
- <!-- <el-table-column label="费用名称" align="center" prop="fFeeid"/>-->
- <el-table-column label="有效期起" sortable align="center" prop="fBegindate" width="180">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.fBegindate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column label="有效期至" sortable align="center" prop="fEnddate" width="180">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.fEnddate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="状态" align="center" prop="fId" />-->
- <el-table-column label="是否启用" align="center" prop="fStatus">
- <template slot-scope="scope">
- <el-switch
- v-model="scope.row.fStatus"
- active-value="0"
- inactive-value="1"
- @change="handleStatusChange(scope.row)"
- ></el-switch>
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center" prop="fBillstatus">
- <template slot-scope="scope">
- <span v-if="scope.row.fBillstatus == '1'">保存</span>
- <span v-else-if="scope.row.fBillstatus == '2'">暂存</span>
- <span v-else-if="scope.row.fBillstatus == '3'">审批驳回</span>
- <span v-else-if="scope.row.fBillstatus == '4'">提交审核</span>
- <span v-else-if="scope.row.fBillstatus == '5'">审核中</span>
- <span v-else-if="scope.row.fBillstatus == '6'">审核完成</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="speed_s(scope.row,0)"
- v-hasPermi="['agreement:agreementTask:remove']"
- >查看
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-if="scope.row.fBillstatus <= 3"
- v-hasPermi="['agreement:agreementTask:edit']"
- >修改
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-if="scope.row.fBillstatus <= 3"
- v-hasPermi="['agreement:agreementTask:remove']"
- >删除
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="speed(scope.row,1)"
- v-if="scope.row.fBillstatus === '4' || scope.row.fBillstatus === '5'"
- v-hasPermi="['agreement:agreementTask:remove']"
- >审批进度
- </el-button>
- </template>
- </el-table-column>
- <!-- <el-table-column label="业务编号" align="center" prop="fBillno" />-->
- <!-- <el-table-column label="制单部门" align="center" prop="fDeptid" />-->
- <!-- <el-table-column label="结算方式" align="center" prop="fStltypeid" :formatter="fStltypeidFormat" />-->
- <!-- <el-table-column label="费用类型" align="center" prop="fFeetypeid" />-->
- <!-- <el-table-column label="货物类别" align="center" prop="tPackages" :formatter="tPackagesFormat" />-->
- <!-- <el-table-column label="贸易方式" align="center" prop="fTrademodeid" :formatter="fTrademodeidFormat" />-->
- <!-- <el-table-column label="免堆天数" align="center" prop="fFreedays" />-->
- <!-- <el-table-column label="备注" align="center" prop="remark" />-->
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 添加或修改作业费对话框 -->
- <el-dialog :title="title" :visible.sync="open" :show-close="Xbutton" width="65%" append-to-body :before-close="handleClose" :close-on-click-modal="false">
- <el-form ref="form" :model="form" :rules="rules" label-width="80px"
- style="display: flex;flex-wrap: wrap;">
- <el-form-item label="客户名称" prop="fCorpid">
- <el-select
- v-model="form.fCorpid"
- filterable
- remote
- clearable
- :disabled="browseStatus"
- style="width: 200px"
- @keyup.enter.native="handleQuery"
- :remote-method="corpsRemoteMethod"
- placeholder="请输入客户名称"
- >
- <el-option
- v-for="(dict, index) in fMblnoOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="制单部门">
- <el-input v-model="deptName" :disabled="true" placeholder="请输入制单部门" style="width: 200px"/>
- </el-form-item>
- <el-form-item label="有效期起" prop="fBegindate">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.fBegindate"
- type="date"
- :disabled="browseStatus"
- value-format="timestamp"
- placeholder="选择有效期起"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="有效期至" prop="fEnddate">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.fEnddate"
- type="date"
- :disabled="browseStatus"
- value-format="timestamp"
- placeholder="选择有效期至"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="协议编号" prop="fContractno">
- <el-input v-model="form.fContractno" placeholder="请输入协议编号" :disabled="browseStatus" style="width: 200px"/>
- </el-form-item>
- <el-form-item label="商品类别" prop="tPackages">
- <el-select v-model="form.tPackages" placeholder="请选择商品类别" :disabled="browseStatus">
- <el-option
- v-for="dict in fTypeidOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- style="width: 210px;"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="作业费类型" prop="fTaskType" label-width="90px">
- <el-select v-model="form.fTaskType" placeholder="请选择作业费类型" :disabled="browseStatus">
- <el-option label="车队作业费" value="1"/>
- <el-option label="劳务作业费" value="2"/>
- </el-select>
- </el-form-item>
- <el-form-item label="费用类型" prop="fDc">
- <el-select v-model="form.fDc" @change="changefDc" placeholder="请选择费用类型" :disabled="browseStatus">
- <el-option label="收" value="D"></el-option>
- <el-option label="付" value="C"></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <el-button @click="confirmCharge" :disabled="stop" v-if="form.fBillstatus < 4" type="primary">请 核</el-button>
- <el-button @click="revokeCharge" v-if="form.fBillstatus === '6'" type="danger">撤销请核</el-button>
- <el-button @click="revocationApproval" :disabled="tablefilter" v-if="form.fBillstatus === '4' && operator === lander" type="danger">撤销审批</el-button>
- <div class="dialogTableTitle flex a-center jlr">
- <h2>作业费明细</h2>
- <el-button @click="getList_s" :disabled="browseStatus">新增</el-button>
- </div>
- <el-table v-loading="loading_s" :data="agreementitemsList">
- <el-table-column label="行号" align="center" type="index"/>
- <el-table-column
- prop="fFeeid"
- header-align="center"
- align="center"
- width="180px"
- label="费用名称"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fFeeid"
- filterable
- :disabled="browseStatus"
- remote
- :remote-method="fWRemoteMethod"
- placeholder="费用名称"
- >
- <el-option
- v-for="(dict, index) in fWbuOptions"
- :key="index.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="fFeeunitid"
- header-align="center"
- align="center"
- width="180px"
- label="计价单位"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fFeeunitid"
- placeholder="请选择计价单位"
- @change="changeFeeUnit(scope.row)"
- clearable
- :disabled="browseStatus"
- >
- <el-option
- v-for="(dict, index) in jFeetunitOptions"
- :key="index.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column label="单价" align="center">
- <el-input
- slot-scope="scope"
- v-model="scope.row.fPrice"
- placeholder="请输入单价"
- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
- :disabled="browseStatus"
- clearable
- size="small"
- />
- </el-table-column>
- <el-table-column label="录入人" align="center">
- <el-input
- slot-scope="scope"
- v-model="scope.row.createBy"
- :disabled="true"
- placeholder="默认录入人"
- clearable
- size="small"
- />
- </el-table-column>
- <el-table-column label="录入时间" align="center">
- <el-input
- slot-scope="scope"
- v-model="scope.row.createTime"
- placeholder="默认录入时间"
- :disabled="true"
- clearable
- size="small"
- />
- </el-table-column>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- :disabled="browseStatus"
- @click.native.prevent="deleteRow(scope.$index, agreementitemsList)"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button v-if="approvalProhibit" @click="immediateApproval">审批</el-button>
- <el-button v-if="form.fBillstatus > 2" @click="viewAudit">查看审批</el-button>
- <el-button type="primary" @click="submitForm" :disabled="determine || browseStatus">保 存</el-button>
- <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
- <el-button v-if="cancelButton === false" @click="homePage">取 消</el-button>
- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
- <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import moment from 'moment'
- import {
- listAgreement,
- getAgreement,
- delAgreement,
- addAgreement,
- exportAgreement,
- listAgreementitems,
- queryUserVal,
- updateAgreements,
- collecTask,
- backCharge,
- revocation
- } from '@/api/agreement/agreement'
- import { listCorps } from '@/api/basicdata/corps'
- import { listGoods } from '@/api/basicdata/goods'
- import { listFees } from '@/api/basicdata/fees'
- import AddOrUpdate from '@/views/viewApproval'
- import ApprovalComments from '@/views/startApproval'
- import Global from '@/layout/components/global.js'
- export default {
- name: 'Agreement',
- components: {
- AddOrUpdate,
- ApprovalComments
- },
- data() {
- return {
- addOrEdid:1,
- idCopy:'',
- stop:false,
- lander:'',
- operator:'',
- dataList: '',
- // 遮罩层
- loading: true,
- determine:false,
- cancelButton:true,
- approvalProhibit:false,
- loading_s: false,
- Xbutton:true,
- browseStatus:false,
- addOrUpdateVisible:false,
- addOrUpdateVisib:false,
- tablefilter:false,
- // 计价单位
- jFeetunitOptions: [
- /*{ dictLabel: "件数", dictValue: "1" },
- { dictLabel: "毛重", dictValue: "2" },
- { dictLabel: "净重", dictValue: "3" },
- { dictLabel: "尺码", dictValue: "4" },
- { dictLabel: "固定", dictValue: "5" },*/
- ],
- goodsOptions:[],
- fTypeidOptions: [],
- // 选中数组
- ids: [],
- deptName:'',
- // 客户(客户数据)
- fMblnoOptions: [],
- fFeeunitidOptions: [],
- fWbuOptions: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 仓储费表格数据
- agreementList: [],
- // 弹出层标题
- title: '',
- // 是否显示弹出层
- open: false,
- // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典
- fStltypeidOptions: [],
- // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典
- tPackagesOptions: [],
- // 贸易方式,对应t_trademodels 字典
- fTrademodeidOptions: [],
- // 仓储费明细表表格数据
- agreementitemsList: [],
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- fBillno: null,
- fDeptid: null,
- fContractno: null,
- fCorpid: null,
- fStltypeid: null,
- fGoodsid: null,
- fFeetypeid: null,
- tPackages: null,
- fTrademodeid: null,
- fFreedays: null,
- fBegindate: null,
- fEnddate: null,
- fBillstatus: null,
- fTaskType:null,
- fDc:null,
- },
- // 表单参数
- form: {
- fTaskType: '1',
- fDc : "D"
- },
- // 表单校验
- rules: {
- fBillno: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ],
- fCorpid: [
- { required: true, message: ' ', trigger: 'blur' }
- ],
- tPackages:[
- { required: true, message: ' ', trigger: 'blur' }
- ],
- fBegindate:[
- { required: true, message: ' ', trigger: 'blur' }
- ],
- fEnddate:[
- { required: true, message: ' ', trigger: 'blur' }
- ]
- }
- }
- },
- created() {
- this.getList()
- this.getDicts('data_settlement_method').then(response => {
- this.fStltypeidOptions = response.data
- })
- this.getDicts('data_package_unit').then(response => {
- this.tPackagesOptions = response.data
- })
- this.getDicts('data_trademodes').then(response => {
- this.fTrademodeidOptions = response.data
- })
- this.getDicts("data_goods_category").then(response => {
- this.fTypeidOptions = response.data;
- });
- this.getDicts("data_unitfees").then(response => {
- this.jFeetunitOptions = response.data;
- });
- let queryParams = { pageNum: 1, type: 1 };
- listCorps(queryParams).then((response) => {
- this.fMblnoOptions = response.rows;
- });
- this.register()
- },
- activated(){
- this.adoPt()
- },
- methods: {
- changefDc(){
- if(this.form.fDc === 'D'){
- console.log("111")
- let queryParams = { pageNum: 1, pageSize: 10, fDc:'D'};
- listFees(queryParams).then((response) => {
- this.fWbuOptions = response.rows;
- });
- }else if(this.form.fDc === 'C'){
- console.log("222")
- let queryParams = { pageNum: 1, pageSize: 10, fDc:'C'};
- listFees(queryParams).then((response) => {
- this.fWbuOptions = response.rows;
- });
- }
- },
- // 默认录入人
- register() {
- queryUserVal().then((response)=>{
- this.lander = response.user.userName
- })
- },
- immediateApproval(){
- this.addOrUpdateVisib = true
- this.$nextTick(() => {
- this.$refs.ApprovalComments.init(this.approval.billId,320)
- })
- },
- adoPt(){
- this.tablefilter = true
- this.approval = this.$route.query.data
- if (this.approval){
- this.cancelButton = false
- this.determine = true
- this.Xbutton = false
- this.tablefilter = true
- this.browseStatus = true
- this.approval = JSON.parse(this.approval)
- this.approvalProhibit = true
- this.pass = {
- fAmtdr: '', //应收合计
- fAmtcr: '', //应付合计
- fMblno: '', //提单号
- fName: '', //货权方
- fFeesName: '', //结算单位
- fCorpid: '' //结算单位ID
- }
- getAgreement(this.approval.billId).then(response => {
- this.deptName = response.data.dept.deptName
- this.form = response.data.tWarehouseAgreement
- this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
- this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- }
- this.fWbuOptions = response.data.feesList
- this.open = true
- this.title = '修改作业费'
- })
- }
- },
- viewAudit(){
- this.addOrUpdateVisible = true
- this.addOrUpdateVisib = false
- let id = '448'
- let actId = '110'
- this.$nextTick(() => {
- this.$refs.addOrUpdate.init(this.form.fId,320)
- })
- },
- returnData(){
- this.open = false
- this.addOrUpdateVisib = false
- this.homePage()
- },
- getDataList(){
- this.addOrUpdateVisible = false
- },
- homePage(){
- let view = {
- fullPath: "/agreement/agreementTask",
- hash: "",
- matched: Array(2),
- meta: Object,
- name: "AgreementTask",
- params: Object,
- path: "/agreement/agreementTask",
- query: Object,
- title: "作业费协议",
- }
- this.$router.push({ path: '/index' })
- this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
- if (this.isActive(view)) {
- this.toLastView(visitedViews, view)
- }
- })
- Global.$emit('removeCache', 'closeSelectedTag', view)
- },
- /** 创建仓储费明细表列表 */
- getList_s() {
- queryUserVal().then((response) => {
- this.agreementitemsList.push({
- //行号
- fLineno: '',
- //计价单位
- fFeeunitid: '',
- //费用名称
- fFeeid: '',
- //开始天数
- fFromdays: '',
- //结束天数
- fEndays: '',
- //单价
- fPrice: '',
- //录入人
- createBy: response.user.userName,
- //创建时间
- createTime: moment(Date.parse(new Date())).format('YYYY-MM-DD HH:mm:ss')
- })
- this.deptName = response.dept.deptName
- this.form.fDeptid = response.dept.deptId
- this.agreementitemsList.createBy = response.user.userName
- })
- },
- speed_s(row, res) {
- this.stop = true
- this.determine = true
- this.tablefilter = true
- this.browseStatus = true
- this.approvalProhibit = false
- const fId = row.fId || this.ids
- getAgreement(fId).then(response => {
- this.deptName = response.data.dept.deptName
- this.form = response.data.tWarehouseAgreement
- this.$set(this.form, 'fTaskType', this.form.fTaskType + '')
- this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
- this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
- this.operator = this.form.createBy
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- }
- this.fWbuOptions = response.data.feesList
- this.open = true
- this.title = '查看作业费'
- })
- },
- speed(row, res) {
- this.register()
- if (res === 1) {
- this.tablefilter = false
- }
- this.determine = true
- this.browseStatus = true
- this.approvalProhibit = false
- const fId = row.fId || this.ids
- getAgreement(fId).then(response => {
- this.deptName = response.data.dept.deptName
- this.form = response.data.tWarehouseAgreement
- this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
- this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
- this.operator = this.form.createBy
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- }
- this.fWbuOptions = response.data.feesList
- this.open = true
- this.title = '查看作业费'
- })
- },
- revocationApproval(){
- let data = {
- id:this.form.fId,
- actId: 320,
- billId:this.form.fId
- }
- revocation(data).then(data =>{
- if (data.code === 200){
- this.$message.success('撤销成功');
- this.open = false
- this.getList()
- }
- })
- },
- // 请核
- confirmCharge() {
- if (this.agreementitemsList.length <= 0) {
- this.$message.error('作业费明细为空无法操作')
- return false
- }
- for (let agr = 0; agr < this.agreementitemsList.length; agr ++) {
- if (!this.agreementitemsList[agr].fFeeid) {
- this.$message.error('请维护费用名称')
- return false
- }
- if (!this.agreementitemsList[agr].fFeeunitid) {
- this.$message.error('请维计价单位')
- return false
- }
- if (!this.agreementitemsList[agr].fPrice) {
- this.$message.error('请维单价')
- return false
- }
- }
- this.$refs['form'].validate(valid => {
- if (valid) {
- let formData = new window.FormData()
- formData.append('agreement', JSON.stringify(this.form))
- formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
- collecTask(formData).then(response => {
- this.msgSuccess('请核成功')
- this.open = false
- this.agreementitemsList = []
- this.getList()
- })
- }
- })
- },
- // 撤销作业费
- revokeCharge(){
- this.form.fBillstatus = '1'
- let formDate = new window.FormData()
- formDate.append('agreement', JSON.stringify(this.form))
- formDate.append('agreementitems', JSON.stringify(this.agreementitemsList))
- backCharge(formDate).then(response => {
- this.open = false
- this.msgSuccess('操作成功')
- this.getList()
- })
- },
- /* 远程模糊查询商品 */
- goodsRemoteMethod(name) {
- if (name == null || name === "") {
- return false;
- }
- let queryParams = { pageNum: 1, pageSize: 10, fName: name };
- listGoods(queryParams).then((response) => {
- this.goodsOptions = response.rows;
- });
- },
- // 计价单位
- fFeeunitidFormat(row, column) {
- return this.selectDictLabel(this.fFeeunitidOptions, row.fFeeunitid);
- },
- /** 查询作业费列表 */
- getList() {
- this.loading = true
- listAgreement(this.queryParams).then(response => {
- this.agreementList = response.rows
- this.total = response.total
- this.loading = false
- })
- },
- // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典翻译
- fStltypeidFormat(row, column) {
- return this.selectDictLabel(this.fStltypeidOptions, row.fStltypeid)
- },
- // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典翻译
- tPackagesFormat(row, column) {
- return this.selectDictLabel(this.fTypeidOptions, row.tPackages)
- },
- // 贸易方式,对应t_trademodels 字典翻译
- fTrademodeidFormat(row, column) {
- return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid)
- },
- // 取消按钮
- cancel() {
- this.idCopy = null
- this.reset()
- this.getList()
- this.open = false
- },
- handleClose(){
- this.reset()
- this.getList()
- this.open = false
- },
- // 表单重置
- reset() {
- this.determine = false
- this.browseStatus = false
- this.agreementitemsList = []
- this.form = {
- fId: null,
- fBillno: null,
- fDeptid: null,
- fContractno: null,
- fCorpid: null,
- fStltypeid: null,
- fGoodsid: null,
- fFeetypeid: null,
- tPackages: null,
- fTrademodeid: null,
- fFreedays: null,
- fBegindate: null,
- fEnddate: null,
- fBillstatus: '0',
- delFlag: null,
- createBy: null,
- createTime: null,
- updateBy: null,
- updateTime: null,
- remark: null
- }
- this.resetForm('form')
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1
- this.getList()
- },
- // 变更计价单位
- changeFeeUnit(row) {
- if (!row.fFeeUnitid) {
- return false;
- }
- if (row.fFeeUnitid === "0") {
- this.$set(row, "fQty", this.fCntqty);
- } else if (row.fFeeUnitid === "1") {
- this.$set(row, "fQty", this.fGrossweight);
- }
- if (row.fUnitprice) {
- this.$set(row, "fAmount", parseFloat(Number(row.fUnitprice) * Number(row.fQty)).toFixed(2));
- }
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm('queryForm')
- this.handleQuery()
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.fId)
- this.idCopy = this.ids[0]
- this.single = selection.length !== 1
- this.multiple = !selection.length
- },
- // 远程模糊查询费用名称
- fWRemoteMethod(name) {
- this.fWbuOptions = []
- if (name == null || name === "") {
- return false;
- }
- let fDc = this.form.fDc
- let queryParams = { pageNum: 1, pageSize: 10, fName: name, fDc:fDc};
- listFees(queryParams).then((response) => {
- this.fWbuOptions = response.rows
- });
- },
- // 作业费状态修改
- handleStatusChange(row) {
- if (row.fBillstatus == '6'){
- let text = row.fStatus === "0" ? "启用" : "停用";
- this.$confirm('确认要"' + text + '""' + row.fCorpid + '"用户吗?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return updateAgreements(row.fId, row.fStatus);
- }).then(() => {
- this.msgSuccess(text + "成功");
- }).catch(function() {
- row.fStatus = row.fStatus === "0" ? "1" : "0";
- });
- }else {
- row.fStatus = 0
- this.$message.error('审核完成时才能启用');
- }
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.stop = false
- this.determine = false
- this.browseStatus = false
- this.reset()
- this.open = true
- this.title = '添加作业费'
- this.form = {
- fTaskType :'1',
- fDc:"D"
- }
- queryUserVal().then((response) => {
- this.deptName = response.dept.deptName
- this.form.fDeptid = response.dept.deptId
- });
- this.changefDc()
- },
- /** 修改按钮操作 */
- handleUpdate(row,num) {
- if(num === 2){
- getAgreement(this.idCopy).then(response => {
- this.register()
- this.deptName = response.data.dept.deptName
- this.form = response.data.tWarehouseAgreement
- this.form.fId = null
- this.form.fBillstatus = ''
- this.$set(this.form, 'fTaskType', this.form.fTaskType + '')
- this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
- this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
- this.operator = this.form.createBy
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- }
- this.fWbuOptions = response.data.feesList
- this.open = true
- this.title = '修改作业费'
- })
- }else{
- this.stop = false
- this.browseStatus = false
- this.determine = false
- this.reset()
- this.cancelButton = true
- const fId = row.fId || this.ids
- getAgreement(fId).then(response => {
- this.register()
- this.deptName = response.data.dept.deptName
- this.form = response.data.tWarehouseAgreement
- this.$set(this.form, 'fTaskType', this.form.fTaskType + '')
- this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
- this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
- this.operator = this.form.createBy
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- }
- this.fWbuOptions = response.data.feesList
- this.open = true
- this.title = '修改作业费'
- })
- }
- },
- /** 远程模糊查询用户 */
- corpsRemoteMethod(name) {
- if (name == null || name === "") {
- return false;
- }
- let queryParams = { pageNum: 1, fName: name, type: 1 };
- listCorps(queryParams).then((response) => {
- console.log(response)
- this.fMblnoOptions = response.rows;
- this.KHblnoOptions = response.rows;
- });
- },
- /** 提交按钮 */
- submitForm() {
- if(this.addOrEdid == 2){
- this.$set(this.form, 'fId', null)
- }
- this.$refs['form'].validate(valid => {
- if (valid) {
- let formData = new window.FormData()
- formData.append('agreement', JSON.stringify(this.form))
- formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
- addAgreement(formData).then(response => {
- this.msgSuccess('操作成功')
- this.form = response.data.tWarehouseAgreement
- this.$set(this.form, 'fTaskType', this.form.fTaskType + '')
- this.$set(this.form, 'fEnddate', Date.parse(this.form.fEnddate))
- this.$set(this.form, 'fBegindate', Date.parse(this.form.fBegindate))
- })
- }
- })
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const fIds = row.fId || this.ids;
- this.$confirm('是否确认删除作业费编号为"' + fIds + '"的数据项?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return delAgreement(fIds);
- }).then(() => {
- this.getList();
- this.msgSuccess("删除成功");
- })
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams
- this.$confirm('是否确认导出所有作业费数据项?', '警告', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function() {
- return exportAgreement(queryParams)
- }).then(response => {
- this.download(response.msg)
- })
- },
- deleteRow(index, rows) {
- rows.splice(index, 1);
- },
- }
- }
- </script>
|