12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
- <!-- <el-form-item label="业务编号" prop="fBillno">-->
- <!-- <el-input-->
- <!-- v-model="queryParams.fBillno"-->
- <!-- placeholder="请输入业务编号"-->
- <!-- clearable-->
- <!-- size="small"-->
- <!-- @keyup.enter.native="handleQuery"-->
- <!-- />-->
- <!-- </el-form-item>-->
- <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="fGoodsid">-->
- <!-- <el-select-->
- <!-- v-model="queryParams.fGoodsid"-->
- <!-- filterable-->
- <!-- remote-->
- <!-- clearable-->
- <!-- style="width: 200px"-->
- <!-- :remote-method="goodsRemoteMethod"-->
- <!-- @keyup.enter.native="handleQuery"-->
- <!-- placeholder="请输入货物品名"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="(dict, index) in goodsOptions"-->
- <!-- :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>
- <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-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="['warehouseBusiness:agreement: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="['warehouseBusiness:agreement:edit']"
- v-if="form.fBillstatus === '2' || form.fBillstatus === '3'"
- >修改
- </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="['warehouseBusiness:agreement:remove']"
- >删除
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- v-hasPermi="['warehouseBusiness:agreement: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 label="合同编号" align="center" prop="fContractno"/>
- <el-table-column label="客户名称" align="center" prop="fCorpid"/>
- <!-- <el-table-column label="货物品名" align="center" prop="fGoodsid"/>-->
- <el-table-column label="有效期起" 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="有效期至" 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="check(scope.row,0)"
- v-if="scope.row.fBillstatus == 6"
- v-hasPermi="['warehouseBusiness:agreement:edit']"
- >查看
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="check(scope.row,1)"
- v-hasPermi="['finance:contrast:edit']"
- v-if="scope.row.fBillstatus == 4 || scope.row.fBillstatus == 5"
- >审批进度
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['warehouseBusiness:agreement:edit']"
- >修改
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['warehouseBusiness:agreement: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" width="65%" append-to-body :before-close="handleClose"
- :close-on-click-modal="false" :show-close="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
- :disabled="notChange"
- v-model="form.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="制单部门">
- <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="notChange"
- 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="form.fEnddate"
- :disabled="notChange"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择有效期至"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="合同编号" prop="fContractno">
- <el-input v-model="form.fContractno" :disabled="notChange" placeholder="请输入合同编号" style="width: 200px"/>
- </el-form-item>
- <el-form-item label="商品类别" prop="tPackages">
- <el-select v-model="form.tPackages" :disabled="notChange" placeholder="请选择商品类别">
- <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>
- <el-button type="primary" @click="submit" :disabled="notChange" v-if="form.fBillstatus < 4">请 核</el-button>
- <el-button type="success" @click="BackSubmit" v-if="form.fBillstatus === '6'">撤销请核</el-button>
- <div class="dialogTableTitle flex a-center jlr">
- <h2>标题</h2>
- <el-button @click="getList_s()" :disabled="notChange">新增</el-button>
- </div>
- <el-table v-loading="loading_s" :data="agreementitemsList" @selection-change="handleSelectionChange">
- <!-- <el-table-column type="selection" width="55" align="center"/>-->
- <el-table-column label="行号" align="center" type="index"/>
- <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">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fFromdays"
- placeholder="请输入开始天数"
- clearable
- size="small"
- :disabled="notChange"
- />
- </template>
- </el-table-column>
- <el-table-column label="结束天数" align="center">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fEndays"
- placeholder="请输入结束天数"
- clearable
- size="small"
- :disabled="notChange"
- />
- </template>
- </el-table-column>
- <el-table-column label="单价" align="center">
- <el-input
- slot-scope="scope"
- v-model="scope.row.fPrice"
- placeholder="请输入单价"
- clearable
- size="small"
- :disabled="notChange"
- />
- </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
- prop="fFeeid"
- header-align="center"
- align="center"
- width="180px"
- label="费用名称"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fFeeid"
- filterable
- remote
- :disabled="browseStatus"
- :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 label="操作" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click.native.prevent="deleteRow(scope.$index, agreementitemsList)"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
- <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
- <el-button v-if="approve === true" @click="goApproval">审批</el-button>
- <el-button type="danger" :disabled="disappear" @click="approvalRevocation" v-if="form.fBillstatus === '4'">撤销审批</el-button>
- <el-button type="info" v-if="notChange" @click="addOrUpdateHandle()">查看审批流</el-button>
- <el-button type="primary" @click="submitForm" :disabled="notChange">保 存</el-button>
- <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
- <el-button v-if="cancelButton === false" @click="homePage">取消</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import moment from 'moment'
- import {
- revocation,
- ReturnCheck,
- PleaseCheck,
- listAgreements,
- getAgreement,
- delAgreement,
- addAgreement,
- updateAgreement,
- updateAgreement_s,
- exportAgreement,
- listAgreementitems,
- queryUserVal
- } from '@/api/warehouseBusiness/agreement'
- import { listCorps } from '@/api/basicdata/corps'
- import { listGoods } from '@/api/basicdata/goods'
- import { delWarehousebills } from '@/api/warehouseBusiness/warehouseInStock'
- import { listGoodsTransfer } from '@/api/warehouseBusiness/goodsTransfer'
- import { listFees } from '@/api/basicdata/fees'
- import { changeUserStatus } from '@/api/system/user'
- import AddOrUpdate from '@/views/viewApproval'
- import ApprovalComments from '@/views/startApproval'
- import Global from '@/layout/components/global'
- // import { listUser, queryUserVal } from '@/api/system/user'
- export default {
- name: 'Agreement',
- components: {
- AddOrUpdate,
- ApprovalComments
- },
- data() {
- return {
- cancelButton:true,
- // 审批状态
- approve:false,
- addOrUpdateVisible: false,
- addOrUpdateVisib:false,
- disappear: false,
- notChange: false,
- dataList: '',
- value_s: [],
- // 遮罩层
- loading: true,
- loading_s: false,
- browseStatus: false,
- // 计价单位
- jFeetunitOptions: [
- { dictLabel: '件数', dictValue: '1' },
- { dictLabel: '毛重', dictValue: '2' },
- { dictLabel: '净重', dictValue: '3' },
- { dictLabel: '尺码', dictValue: '4' },
- { dictLabel: '固定', dictValue: '5' }
- ],
- agreementId: 310,
- goodsOptions: [],
- fTypeidOptions: [],
- // 选中数组
- ids: [],
- deptName: '',
- // 客户(客户数据)
- fMblnoOptions: [],
- fFeeunitidOptions: [],
- fWbuOptions: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 仓储费表格数据
- agreementList: [],
- // 弹出层标题
- title: '',
- add: '',
- // 是否显示弹出层
- open: false,
- // 结算方式,也可以从表t_stltypes中下拉选择,存储id,显示name字典
- fStltypeidOptions: [],
- // 货物类别,存储t_packages,f_id 显示名称,可以多选t_packages 中的no或 name,模糊查找选择后,存储f_id,显示name字典
- tPackagesOptions: [],
- // 贸易方式,对应t_trademodels 字典
- fTrademodeidOptions: [],
- // 仓储费明细表表格数据
- agreementitemsList: [],
- // 操作人
- Operator: '',
- // 查询参数
- 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,
- fStatus: null
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- fBillno: [
- {
- required: true,
- message: ' ',
- trigger: 'blur'
- }
- ],
- fCorpid: [
- { 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;
- // });
- },
- activated(){
- this.Jump()
- },
- methods: {
- homepaGe(){
- let view = {
- fullPath: "/agreement/agreementStorage",
- hash: "",
- matched: Array(2),
- meta: Object,
- name: "AgreementStorage",
- params: Object,
- path: "/agreement/agreementStorage",
- 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);
- },
- homePage() {
- this.open = false
- let view = {
- fullPath: "/agreement/agreementStorage",
- hash: "",
- matched: Array(2),
- meta: Object,
- name: "AgreementStorage",
- params: Object,
- path: "/agreement/agreementStorage",
- query: Object,
- title: "仓储费协议"
- }
- this.$router.push({ path: '/index' })
- this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
- console.log(visitedViews)
- if (this.isActive(view)) {
- this.toLastView(visitedViews, view)
- }
- })
- Global.$emit("removeCache", "closeSelectedTag", view);
- },
- Jump(){
- this.approval = this.$route.query.data
- if(this.approval) {
- this.approval = JSON.parse(this.approval)
- this.hide = false
- this.open = true
- this.notChange = true
- this.approve = true
- this.disappear = true
- this.cancelButton = false
- this.reset()
- getAgreement(this.approval.billId).then(response => {
- console.log(response)
- this.deptName = response.data.dept.deptName
- this.form = response.data.tWarehouseAgreement
- this.fMblnoOptions = response.data.corps
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
- }
- // console.log(response.data.feesList)
- this.fWbuOptions = response.data.feesList
- // this.add = row
- console.log(JSON.stringify(this.agreementitemsList))
- this.open = true
- this.browseStatus = true
- })
- }
- },
- goApproval(){
- this.addOrUpdateVisib = true
- console.log(this.approval)
- this.$nextTick(() => {
- this.$refs.ApprovalComments.init(this.form.fId,this.agreementId)
- })
- },
- returnData(){
- this.addOrUpdateVisib = false
- this.open = false
- this.homepaGe()
- },
- getDataList(){
- this.addOrUpdateVisible = false
- },
- // 查看审批流
- addOrUpdateHandle() {
- this.addOrUpdateVisible = true
- this.addOrUpdateVisib = false
- let id = '448'
- let actId = '110'
- console.log(this.form.fId)
- this.$nextTick(() => {
- this.$refs.addOrUpdate.init(this.form.fId, this.agreementId)
- })
- },
- register() {
- queryUserVal().then((response) => {
- this.Lander = response.user.userName
- })
- },
- // 查看按钮
- check(row, res) {
- this.notChange = true
- this.browseStatus = true
- getAgreement(row.fId).then(response => {
- console.log(response)
- this.Operator = response.data.corps.createBy
- console.log(response.data.corps.createBy)
- console.log(response)
- this.deptName = response.data.dept.deptName
- this.form = response.data.tWarehouseAgreement
- this.fMblnoOptions = response.data.corps
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
- }
- // console.log(response.data.feesList)
- this.fWbuOptions = response.data.feesList
- this.add = row
- console.log(JSON.stringify(this.agreementitemsList))
- this.open = true
- this.disappear = true
- this.title = '修改仓储费'
- if (res == 1) {
- this.notChange = true
- if (this.Operator == this.Lander) {
- this.disappear = false
- this.reset()
- const fId = row.fId || this.ids
- // getAgreement(row.fId).then(response => {
- // console.log(response)
- // this.deptName = response.data.dept.deptName
- // this.form = response.data.tWarehouseAgreement
- // this.fMblnoOptions = response.data.corps
- // this.agreementitemsList = response.data.tWarehouseAgreementitems
- // for (let item in this.agreementitemsList) {
- // this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- // // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
- // }
- // // console.log(response.data.feesList)
- // this.fWbuOptions = response.data.feesList
- // this.add = row
- // console.log(JSON.stringify(this.agreementitemsList))
- // this.open = true
- // })
- }else {
- this.notChange = true
- }
- }else{
- this.notChange = true
- this.reset()
- }
- })
- const fId = row.fId || this.ids
- getAgreement(row.fId).then(response => {
- console.log(response)
- this.deptName = response.data.dept.deptName
- this.form = response.data.tWarehouseAgreement
- this.fMblnoOptions = response.data.corps
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
- }
- // console.log(response.data.feesList)
- this.fWbuOptions = response.data.feesList
- this.add = row
- console.log(JSON.stringify(this.agreementitemsList))
- this.open = true
- })
- },
- //撤销审批
- approvalRevocation() {
- let data = {
- id: this.form.fId,
- actId: this.agreementId,
- billId: this.form.fId
- }
- console.log(this.queryParams)
- revocation(data).then(data => {
- console.log(data)
- if (data.code === 200) {
- this.$message.success('撤销成功')
- this.open = false
- this.getList()
- }
- })
- },
- // 撤销请核
- BackSubmit() {
- console.log(this.form)
- this.form.fBillstatus = '1'
- let formDate = new window.FormData()
- formDate.append('agreement', JSON.stringify(this.form))
- formDate.append('agreementitems', JSON.stringify(this.agreementitemsList))
- console.log(formDate)
- ReturnCheck(formDate).then(response => {
- this.open = false
- this.msgSuccess('操作成功')
- this.getList()
- })
- },
- // 请核按钮
- submit() {
- if (this.agreementitemsList.length !== 0) {
- this.form.fBillstatus = '4'
- let formData = new window.FormData()
- // 附件数据
- formData.append('agreement', JSON.stringify(this.form))
- formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
- PleaseCheck(formData).then(response => {
- this.msgSuccess('请核成功')
- this.open = false
- this.getList()
- })
- } else {
- this.$message.error('仓储费协议明细为空,无法操作')
- }
- },
- // 仓储费状态修改
- handleStatusChange(row) {
- if(row.fBillstatus == '6'){
- let text = row.fBillstatus === '0' ? '启用' : '停用'
- this.$confirm('确认要"' + text + '""' + row.fCorpid + '"用户吗?', '警告', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(function() {
- return updateAgreement_s(row.fId, row.fBillstatus)
- }).then(() => {
- this.msgSuccess(text + '成功')
- }).catch(function() {
- row.fBillstatus = row.fBillstatus === '0' ? '1' : '0'
- })
- }else{
- row.fStatus = 0
- this.$message.error('审核完成时才能启用');
- }
- },
- test_s() {
- console.log(this.agreementitemsList)
- },
- /** 创建仓储费明细表列表 */
- getList_s() {
- console.log(this.agreementitemsList)
- 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.$set("deptName", response.dept.deptName);
- this.deptName = response.dept.deptName
- this.form.fDeptid = response.dept.deptId
- this.agreementitemsList.createBy = response.user.userName
- // this.$set(this.agreementitemsList, "createBy", response.user.userName);
- //格式化时间戳
- // this.$set(this.agreementitemsList, "createTime", moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss"));
- })
- listAgreementitems(this.queryParams).then(response => {
- console.log(response)
- })
- },
- /* 远程模糊查询商品 */
- 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
- listAgreements(this.queryParams).then(response => {
- console.log(response)
- this.agreementList = response.rows
- this.total = response.total
- this.loading = false
- })
- },
- // 远程模糊查询费用名称
- fWRemoteMethod(name) {
- this.fWbuOptions = []
- if (name == null || name === '') {
- return false
- }
- let queryParams = { pageNum: 1, pageSize: 10, fName: name }
- listFees(queryParams).then((response) => {
- console.log(this.fWbuOptions)
- this.fWbuOptions = response.rows
- })
- },
- // 结算方式,也可以从表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.tPackagesOptions, row.tPackages)
- },
- // 贸易方式,对应t_trademodels 字典翻译
- fTrademodeidFormat(row, column) {
- return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid)
- },
- // 取消按钮
- cancel() {
- this.open = false
- this.agreementitemsList = []
- this.reset()
- },
- handleClose() {
- this.open = false
- this.agreementitemsList = []
- this.reset()
- },
- // 表单重置
- reset() {
- 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: 'T',
- delFlag: null,
- createBy: null,
- createTime: null,
- updateBy: null,
- updateTime: null,
- remark: null
- }
- this.resetForm('form')
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1
- this.getList()
- },
- // 变更计价单位
- changeFeeUnit(row) {
- console.log(this.fCntqty)
- console.log(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.single = selection.length !== 1
- this.multiple = !selection.length
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset()
- this.open = true
- this.notChange = false
- this.title = '添加仓储费'
- queryUserVal().then((response) => {
- // this.$set("deptName", response.dept.deptName);
- this.deptName = response.dept.deptName
- this.form.fDeptid = response.dept.deptId
- // this.agreementitemsList.createBy = response.user.userName
- // this.$set(this.agreementitemsList, "createBy", response.user.userName);
- //格式化时间戳
- // this.$set(this.agreementitemsList, "createTime", moment(Date.parse(new Date())).format("YYYY-MM-DD HH:mm:ss"));
- })
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset()
- this.notChange = false
- this.browseStatus = false
- const fId = row.fId || this.ids
- getAgreement(fId).then(response => {
- console.log(response)
- this.deptName = response.data.dept.deptName
- this.form = response.data.tWarehouseAgreement
- this.fMblnoOptions = response.data.corps
- this.agreementitemsList = response.data.tWarehouseAgreementitems
- for (let item in this.agreementitemsList) {
- this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
- // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
- }
- // console.log(response.data.feesList)
- this.fWbuOptions = response.data.feesList
- this.add = row
- console.log(JSON.stringify(this.agreementitemsList))
- this.open = true
- this.title = '修改仓储费'
- })
- },
- /** 远程模糊查询用户 */
- corpsRemoteMethod(name) {
- if (name == null || name === '') {
- return false
- }
- let queryParams = { pageNum: 1, pageSize: 10, fName: name, type: 1 }
- listCorps(queryParams).then((response) => {
- this.fMblnoOptions = response.rows
- this.KHblnoOptions = response.rows
- })
- },
- /** 提交按钮 */
- submitForm() {
- console.log(this.form)
- this.$refs['form'].validate(valid => {
- if (valid) {
- if (this.form.fId != null) {
- updateAgreement(this.form).then(response => {
- 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.open = false
- this.getList()
- this.agreementitemsList = []
- })
- })
- } else {
- 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.open = false
- this.getList()
- this.agreementitemsList = []
- })
- }
- }
- })
- },
- /** 删除按钮操作 */
- 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>
|