|
@@ -152,16 +152,26 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- <el-table-column label="状态" align="center" prop="fId" />-->
|
|
|
- <el-table-column label="状态" align="center" prop="fBillstatus">
|
|
|
+ <el-table-column label="是否启用" align="center" prop="fStatus">
|
|
|
<template slot-scope="scope">
|
|
|
<el-switch
|
|
|
- v-model="scope.row.fBillstatus"
|
|
|
+ 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
|
|
@@ -169,6 +179,7 @@
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
+ v-if="scope.row.fBillstatus <= 3"
|
|
|
v-hasPermi="['warehouseBusiness:agreement:edit']"
|
|
|
>修改
|
|
|
</el-button>
|
|
@@ -177,9 +188,28 @@
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
+ v-if="scope.row.fBillstatus <= 3"
|
|
|
v-hasPermi="['warehouseBusiness:agreement:remove']"
|
|
|
>删除
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="speed(scope.row,0)"
|
|
|
+ v-if="scope.row.fBillstatus == 6"
|
|
|
+ v-hasPermi="['warehouseBusiness:agreement: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="['warehouseBusiness:agreement:remove']"
|
|
|
+ >审批进度
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- <el-table-column label="业务编号" align="center" prop="fBillno" />-->
|
|
@@ -201,7 +231,7 @@
|
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改作业费对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="65%" append-to-body :before-close="handleClose" :close-on-click-modal="false">
|
|
|
+ <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;"
|
|
|
>
|
|
@@ -211,6 +241,7 @@
|
|
|
filterable
|
|
|
remote
|
|
|
clearable
|
|
|
+ :disabled="prohibit"
|
|
|
style="width: 200px"
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
:remote-method="corpsRemoteMethod"
|
|
@@ -232,6 +263,7 @@
|
|
|
<el-date-picker clearable size="small" style="width: 200px"
|
|
|
v-model="form.fBegindate"
|
|
|
type="date"
|
|
|
+ :disabled="prohibit"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="选择有效期起"
|
|
|
>
|
|
@@ -241,17 +273,18 @@
|
|
|
<el-date-picker clearable size="small" style="width: 200px"
|
|
|
v-model="form.fEnddate"
|
|
|
type="date"
|
|
|
+ :disabled="prohibit"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="选择有效期至"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="协议编号" prop="fContractno">
|
|
|
- <el-input v-model="form.fContractno" placeholder="请输入协议编号" style="width: 200px"/>
|
|
|
+ <el-input v-model="form.fContractno" placeholder="请输入协议编号" :disabled="prohibit" style="width: 200px"/>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="商品类别" prop="tPackages">
|
|
|
- <el-select v-model="form.tPackages" placeholder="请选择商品类别">
|
|
|
+ <el-select v-model="form.tPackages" placeholder="请选择商品类别" :disabled="prohibit">
|
|
|
<el-option
|
|
|
v-for="dict in fTypeidOptions"
|
|
|
:key="dict.dictValue"
|
|
@@ -262,10 +295,12 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <el-button @click="confirmCharge" type="primary">请 核</el-button>
|
|
|
+ <el-button @click="confirmCharge" 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" v-if="form.fBillstatus == 4" type="danger">撤销审批</el-button>
|
|
|
<div class="dialogTableTitle flex a-center jlr">
|
|
|
- <h2>标题</h2>
|
|
|
- <el-button @click="getList_s()">新增</el-button>
|
|
|
+ <h2>作业费明细</h2>
|
|
|
+ <el-button @click="getList_s" :disabled="prohibit">新增</el-button>
|
|
|
</div>
|
|
|
<el-table v-loading="loading_s" :data="agreementitemsList" @selection-change="handleSelectionChange">
|
|
|
<!-- <el-table-column type="selection" width="55" align="center"/>-->
|
|
@@ -326,6 +361,7 @@
|
|
|
slot-scope="scope"
|
|
|
v-model="scope.row.fPrice"
|
|
|
placeholder="请输入单价"
|
|
|
+ :disabled="prohibit"
|
|
|
clearable
|
|
|
size="small"
|
|
|
/>
|
|
@@ -358,6 +394,7 @@
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
+ :disabled="prohibit"
|
|
|
@click.native.prevent="deleteRow(scope.$index, agreementitemsList)"
|
|
|
>删除
|
|
|
</el-button>
|
|
@@ -365,8 +402,12 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <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">确 定</el-button>
|
|
|
<el-button @click="cancel">取 消</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>
|
|
@@ -384,27 +425,36 @@ import {
|
|
|
listAgreementitems,
|
|
|
queryUserVal,
|
|
|
updateAgreements,
|
|
|
- collecTask
|
|
|
+ collecTask,
|
|
|
+ backCharge,
|
|
|
+ revocation
|
|
|
} from '@/api/agreement/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 { updateAgreement_s } from '@/api/warehouseBusiness/agreement'
|
|
|
-import {collectFee} from "@/api/finance/charge";
|
|
|
-// import { listUser, queryUserVal } from '@/api/system/user'
|
|
|
+import AddOrUpdate from '@/views/viewApproval'
|
|
|
+import ApprovalComments from '@/views/startApproval'
|
|
|
+import Global from "@/layout/components/global.js";
|
|
|
|
|
|
export default {
|
|
|
name: 'Agreement',
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ AddOrUpdate,
|
|
|
+ ApprovalComments
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
dataList: '',
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
+ determine:false,
|
|
|
+ approvalProhibit:false,
|
|
|
loading_s: false,
|
|
|
browseStatus: false,
|
|
|
+ Xbutton:true,
|
|
|
+ prohibit:false,
|
|
|
+ addOrUpdateVisible:false,
|
|
|
+ addOrUpdateVisib:false,
|
|
|
// 计价单位
|
|
|
jFeetunitOptions: [
|
|
|
{ dictLabel: "件数", dictValue: "1" },
|
|
@@ -497,7 +547,95 @@ export default {
|
|
|
// this.jFeetunitOptions = response.data;
|
|
|
// });
|
|
|
},
|
|
|
+ activated(){
|
|
|
+ this.adoPt()
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ immediateApproval(){
|
|
|
+ this.addOrUpdateVisib = true
|
|
|
+ console.log(this.approval)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.ApprovalComments.init(this.approval.billId,320)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ adoPt(){
|
|
|
+ this.approval = this.$route.query.data
|
|
|
+ if (this.approval){
|
|
|
+ this.determine = true
|
|
|
+ this.prohibit = true
|
|
|
+ this.browseStatus = true
|
|
|
+ this.Xbutton = false
|
|
|
+ this.approval = JSON.parse(this.approval)
|
|
|
+ this.approvalProhibit = true
|
|
|
+ this.reset()
|
|
|
+ this.pass = {
|
|
|
+ fAmtdr: '', //应收合计
|
|
|
+ fAmtcr: '', //应付合计
|
|
|
+ fMblno: '', //提单号
|
|
|
+ fName: '', //货权方
|
|
|
+ fFeesName: '', //结算单位
|
|
|
+ fCorpid: '' //结算单位ID
|
|
|
+ }
|
|
|
+ getAgreement(this.approval.billId).then(response => {
|
|
|
+
|
|
|
+ console.log(this.deptName)
|
|
|
+ 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.fWbuOptions = response.data.feesList
|
|
|
+ console.log(JSON.stringify(this.agreementitemsList))
|
|
|
+
|
|
|
+ this.open = true
|
|
|
+ this.title = '修改作业费'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ viewAudit(){
|
|
|
+ this.addOrUpdateVisible = true
|
|
|
+ this.addOrUpdateVisib = false
|
|
|
+
|
|
|
+ console.log(this.form)
|
|
|
+ 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.open = false
|
|
|
+ this.addOrUpdateVisible = false
|
|
|
+ this.homePage()
|
|
|
+ },
|
|
|
+ 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);
|
|
|
+ },
|
|
|
test_s(){
|
|
|
console.log(this.agreementitemsList)
|
|
|
},
|
|
@@ -532,32 +670,113 @@ export default {
|
|
|
//格式化时间戳
|
|
|
// 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)
|
|
|
})
|
|
|
},
|
|
|
+ speed(row,res){
|
|
|
+ if(res == 1){
|
|
|
+ this.determine = true
|
|
|
+ this.prohibit = true
|
|
|
+ this.browseStatus = true
|
|
|
+ this.approvalProhibit = false
|
|
|
+ this.reset()
|
|
|
+ const fId = row.fId || this.ids
|
|
|
+ getAgreement(fId).then(response => {
|
|
|
+ console.log(this.deptName)
|
|
|
+ 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.fWbuOptions = response.data.feesList
|
|
|
+ console.log(JSON.stringify(this.agreementitemsList))
|
|
|
+
|
|
|
+ this.open = true
|
|
|
+ this.title = '查看作业费'
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.prohibit = true
|
|
|
+ this.determine = true
|
|
|
+ this.browseStatus = true
|
|
|
+ this.approvalProhibit = false
|
|
|
+ this.reset()
|
|
|
+ const fId = row.fId || this.ids
|
|
|
+ getAgreement(fId).then(response => {
|
|
|
+ console.log(this.deptName)
|
|
|
+ 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.fWbuOptions = response.data.feesList
|
|
|
+ console.log(JSON.stringify(this.agreementitemsList))
|
|
|
+
|
|
|
+ this.open = true
|
|
|
+ this.title = '查看作业费'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ revocationApproval(){
|
|
|
+ let data = {
|
|
|
+ id:this.form.fId,
|
|
|
+ actId: 320,
|
|
|
+ billId:this.form.fId
|
|
|
+ }
|
|
|
+ console.log(this.form)
|
|
|
+ revocation(data).then(data =>{
|
|
|
+ console.log(data)
|
|
|
+ if (data.code === 200){
|
|
|
+ this.$message.success('撤销成功');
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 请核
|
|
|
confirmCharge() {
|
|
|
- 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));
|
|
|
- collecTask(formData).then(response => {
|
|
|
- this.msgSuccess('请核成功')
|
|
|
- this.open = false
|
|
|
- this.getList()
|
|
|
- this.agreementitemsList = []
|
|
|
+ console.log(this.agreementitemsList)
|
|
|
+ if(this.agreementitemsList.length !== 0){
|
|
|
+ this.$refs['form'].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.fId != null) {
|
|
|
+ updateAgreement(this.form).then(response => {
|
|
|
+ let formData = new window.FormData();
|
|
|
+ // 附件数据
|
|
|
+ this.form.fBillstatus = 4
|
|
|
+ formData.append("agreement",JSON.stringify(this.form))
|
|
|
+ formData.append("agreementitems", JSON.stringify(this.agreementitemsList));
|
|
|
+ collecTask(formData).then(response => {
|
|
|
+ this.msgSuccess('请核成功')
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ this.agreementitemsList = []
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.$message.error('作业费明细为空无法操作');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 撤销作业费
|
|
|
+ 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 => {
|
|
|
+ console.log(response)
|
|
|
+ this.open = false
|
|
|
+ this.msgSuccess('操作成功')
|
|
|
+ this.getList()
|
|
|
})
|
|
|
},
|
|
|
/* 远程模糊查询商品 */
|
|
@@ -686,18 +905,23 @@ export default {
|
|
|
},
|
|
|
// 作业费状态修改
|
|
|
handleStatusChange(row) {
|
|
|
- let text = row.fBillstatus === "0" ? "启用" : "停用";
|
|
|
- this.$confirm('确认要"' + text + '""' + row.fCorpid + '"用户吗?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return updateAgreements(row.fId, row.fBillstatus);
|
|
|
- }).then(() => {
|
|
|
- this.msgSuccess(text + "成功");
|
|
|
- }).catch(function() {
|
|
|
- row.fBillstatus = row.fBillstatus === "0" ? "1" : "0";
|
|
|
- });
|
|
|
+ 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() {
|
|
@@ -750,7 +974,6 @@ export default {
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- console.log(this.form)
|
|
|
this.$refs['form'].validate(valid => {
|
|
|
if (valid) {
|
|
|
if (this.form.fId != null) {
|
|
@@ -761,9 +984,7 @@ export default {
|
|
|
formData.append("agreementitems", JSON.stringify(this.agreementitemsList));
|
|
|
addAgreement(formData).then(response => {
|
|
|
this.msgSuccess('修改成功')
|
|
|
- this.open = false
|
|
|
this.getList()
|
|
|
- this.agreementitemsList = []
|
|
|
})
|
|
|
})
|
|
|
} else {
|
|
@@ -773,9 +994,7 @@ export default {
|
|
|
formData.append("agreementitems", JSON.stringify(this.agreementitemsList));
|
|
|
addAgreement(formData).then(response => {
|
|
|
this.msgSuccess('新增成功')
|
|
|
- this.open = false
|
|
|
this.getList()
|
|
|
- this.agreementitemsList = []
|
|
|
})
|
|
|
}
|
|
|
}
|