|
@@ -5,8 +5,14 @@
|
|
|
<el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
|
|
|
@click="backToList">返回列表
|
|
|
</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ class="el-button--small-yh add-customer-btn-two"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ @click.stop="addMainProject">新 单
|
|
|
+ </el-button>
|
|
|
<el-button class="el-button--small-yh add-customer-btn" type="primary"
|
|
|
- >保存
|
|
|
+ @click.stop="editMainProject"
|
|
|
+ >{{this.id?"确认修改" :"确认保存"}}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -17,17 +23,20 @@
|
|
|
<el-row>
|
|
|
<el-col v-for="(item, index) in basicData.column" :span="item.span?item.span:6" :key="index">
|
|
|
<el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
|
|
|
- <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
|
|
|
+ <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" :disabled="item.disabled?true:false" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
|
|
|
<el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]" size="small" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"/>
|
|
|
- <el-select v-else-if="item.type === 'select'" style="width: 100%" size="small" placeholder="请选择" clearable filterable></el-select>
|
|
|
+ <el-select v-else-if="item.prop === 'paymentType'" style="width: 100%" size="small" placeholder="请选择" clearable filterable>
|
|
|
+ <el-option v-for="(item,index) in paymentTerm" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
|
|
|
+ </el-select>
|
|
|
<selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
|
|
|
- <el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
|
|
|
+ <el-input type="age" v-else v-model="form[item.prop]" :disabled="item.disabled?true:false" size="small" autocomplete="off" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</basic-container>
|
|
|
<containerTitle title="明细列表"></containerTitle>
|
|
|
+ {{data}}
|
|
|
<basic-container>
|
|
|
<avue-crud
|
|
|
ref="crud"
|
|
@@ -38,11 +47,11 @@
|
|
|
v-model="optionFrom"
|
|
|
@row-del="rowDel"
|
|
|
@row-save="rowSave"
|
|
|
+ @row-update="rowUpdate"
|
|
|
@size-change="sizeChange"
|
|
|
@current-change="currentChange"
|
|
|
+ @selection-change="selectionChange"
|
|
|
@search-change="searchChange"
|
|
|
- @refresh-change="refreshChange"
|
|
|
- @on-load="getList"
|
|
|
@saveColumn="saveColumn"
|
|
|
>
|
|
|
<template slot="menuLeft">
|
|
@@ -51,14 +60,9 @@
|
|
|
icon="el-icon-plus"
|
|
|
@click="serviceDialog = true">新增明细
|
|
|
</el-button>
|
|
|
- <el-button type="primary"
|
|
|
- size="small"
|
|
|
- icon="el-icon-plus"
|
|
|
- @click="">新 单
|
|
|
- </el-button>
|
|
|
<el-button type="info"
|
|
|
size="small"
|
|
|
- @click="">请 核
|
|
|
+ @click.stop="berforPleaseCheck">请 核
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template slot="menuRight">
|
|
@@ -77,8 +81,8 @@
|
|
|
@click="rowCellTwo(row,index)"
|
|
|
>{{row.$cellEdit?'保存':'修改'}}</el-button>
|
|
|
</template>
|
|
|
- <template slot="userId" slot-scope="{row,index}">
|
|
|
- <span style="float: left;padding-top: 2px">{{ row.userId }}</span>
|
|
|
+ <template slot="userid" slot-scope="{row,index}">
|
|
|
+ <span style="float: left;padding-top: 2px">{{ row.userName }}</span>
|
|
|
<el-button type="text" size="mini" style="float: right" @click="selectUser(row)">选择</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
@@ -179,31 +183,29 @@
|
|
|
|
|
|
<script>
|
|
|
import option from "./configuration/detailsPage.json";
|
|
|
- import { projectDetail } from "@/api/workManagement/mainProject";
|
|
|
+ import { projectDetail,editMianProject,updateItemStatus } from "@/api/workManagement/mainProject";
|
|
|
//上传文件json
|
|
|
import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.json"
|
|
|
//服务列表接口
|
|
|
import {getServiceProjectList,getServiceTypeTree,} from "@/api/workManagement/serviceProject";
|
|
|
import serviceOption from "./configuration/serviceDialogList.json";
|
|
|
- //任务部门树接口
|
|
|
- import {getLazyList} from "@/api/system/dept";
|
|
|
+ //业务字典
|
|
|
+ import { getDictionary } from "@/api/system/dictbiz";
|
|
|
//用户组件
|
|
|
import userOption from "./configuration/userList.json";
|
|
|
import { getList } from "@/api/system/user";
|
|
|
import { getDeptLazyTree} from "@/api/system/dept";
|
|
|
+ import type from "../service-items/type";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ id:'',
|
|
|
loading: false,
|
|
|
form:{},
|
|
|
optionFrom:{},
|
|
|
- data: [
|
|
|
- {
|
|
|
- deptId:'',
|
|
|
- userId:''
|
|
|
- }
|
|
|
- ],
|
|
|
+ data: [],
|
|
|
+ crudSelection:[],
|
|
|
deptDicData:[],//任务部门数据
|
|
|
serviceDialog:false,//服务导入窗口
|
|
|
userDialog:false,//用户导入窗口
|
|
@@ -222,6 +224,7 @@
|
|
|
pageSize: 10
|
|
|
},
|
|
|
detailsSelect: {},
|
|
|
+ paymentTerm:[],
|
|
|
//顶部from数据
|
|
|
basicData: {
|
|
|
column: [
|
|
@@ -294,7 +297,6 @@
|
|
|
{
|
|
|
label: '已收金额',
|
|
|
prop: 'settlmentAmount',
|
|
|
- disabled:true,
|
|
|
rules: [
|
|
|
{
|
|
|
pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
|
|
@@ -312,11 +314,13 @@
|
|
|
},
|
|
|
{
|
|
|
label: '制单人',
|
|
|
- prop: 'createUser',
|
|
|
+ prop: 'createUserName',
|
|
|
+ disabled: true
|
|
|
}, {
|
|
|
label: '制单日期',
|
|
|
prop: 'createTime',
|
|
|
- type: 'datetime'
|
|
|
+ type: 'datetime',
|
|
|
+ disabled: true
|
|
|
},
|
|
|
{
|
|
|
label: '电话',
|
|
@@ -328,7 +332,7 @@
|
|
|
type:'select',
|
|
|
dataType: "number",
|
|
|
width: 120,
|
|
|
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=payment_term",
|
|
|
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=affair_payment_term",
|
|
|
props: {
|
|
|
label: "dictValue",
|
|
|
value: "dictKey"
|
|
@@ -434,24 +438,42 @@
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- if(this.$route.query.id){
|
|
|
- projectDetail(this.$route.query.id).then(res =>{
|
|
|
- this.form = res.data.data;
|
|
|
- // this.data = res.data.data.itemList;
|
|
|
- })
|
|
|
+ this.id = BigInt(this.$route.query.id);
|
|
|
+ this.getProjectDetail();
|
|
|
+ const params = {
|
|
|
+ code : "affair_payment_term"
|
|
|
}
|
|
|
+ getDictionary(params).then(res =>{
|
|
|
+ this.paymentTerm = res.data.data;
|
|
|
+ })
|
|
|
},
|
|
|
mounted() {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ getProjectDetail(pleaseCheck){
|
|
|
+ if(this.id){
|
|
|
+ projectDetail(this.id,0).then(res =>{
|
|
|
+ this.form = res.data.data;
|
|
|
+ if(res.data.data.itemList){
|
|
|
+ this.dataList = res.data.data.itemList;
|
|
|
+ if(pleaseCheck === 10086){
|
|
|
+ this.pleaseCheck();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.data = [];
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
//删除列表后面的删除按钮触发触发(row, index, done)
|
|
|
rowDel(row, index, done) {
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
+ this.$confirm("确定将此明细删除?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
+ this.data.splice(index,0)
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: "操作成功!"
|
|
@@ -462,24 +484,18 @@
|
|
|
},
|
|
|
//点击修改或保存时触发
|
|
|
rowCellTwo(row,index){
|
|
|
- if(row.$cellEdit){
|
|
|
- setTimeout(() => {
|
|
|
- this.$message.success("保存成功");
|
|
|
- }, 1000);
|
|
|
- }else{
|
|
|
- this.$refs.crud.rowCell(row, index);
|
|
|
- }
|
|
|
+ this.$refs.crud.rowCell(row, index);
|
|
|
+ },
|
|
|
+ //选择时
|
|
|
+ selectionChange(row){
|
|
|
+ this.crudSelection = row;
|
|
|
},
|
|
|
//新增修改时保存触发
|
|
|
rowSave(row, done, loading) {
|
|
|
-
|
|
|
+ done()
|
|
|
},
|
|
|
- getList() {
|
|
|
- this.loading = true;
|
|
|
- setTimeout(() => {
|
|
|
- this.loading = false;
|
|
|
- this.page.total = 1;
|
|
|
- }, 1000);
|
|
|
+ rowUpdate(row, index, done, loading) {
|
|
|
+ done(row)
|
|
|
},
|
|
|
searchChange(params, done) {
|
|
|
this.getList(this.page, params);
|
|
@@ -493,13 +509,83 @@
|
|
|
this.page.currentPage = val;
|
|
|
this.getList();
|
|
|
},
|
|
|
- refreshChange() {
|
|
|
- this.page.currentPage = 1;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
saveColumn(row, column) {
|
|
|
console.log(row, column);
|
|
|
},
|
|
|
+ //新单
|
|
|
+ addMainProject(){
|
|
|
+ this.$confirm("需先将此单据保存", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(()=>{
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
+ if(valid){
|
|
|
+ this.$router.push({
|
|
|
+ path: "/mainItems_detailsPage",
|
|
|
+ query: {id: ''},
|
|
|
+ });
|
|
|
+ this.form = {}
|
|
|
+ this.data = []
|
|
|
+ this.id = ''
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //请核
|
|
|
+ berforPleaseCheck(){
|
|
|
+ if(this.crudSelection.length!=0){
|
|
|
+ this.editMainProject(10086);
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ type: "error",
|
|
|
+ message: "请先选择一条数据!"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ pleaseCheck(){
|
|
|
+ this.crudSelection.forEach(item =>{
|
|
|
+ updateItemStatus(this.data[item.$index].id,1).then(res =>{
|
|
|
+ if(res.data.success){
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "请核成功!"
|
|
|
+ });
|
|
|
+ //刷新列表
|
|
|
+ this.loading = true;
|
|
|
+ projectDetail(this.id,0).then(res =>{
|
|
|
+ if(res.data.data.itemList){
|
|
|
+ this.data = res.data.data.itemList;
|
|
|
+ }else{
|
|
|
+ this.data = [];
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //新增 修改
|
|
|
+ editMainProject(pleaseCheck){
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
+ if(valid){
|
|
|
+ const params = {
|
|
|
+ ...this.form,
|
|
|
+ itemList:this.data,
|
|
|
+ }
|
|
|
+ editMianProject(params).then(res =>{
|
|
|
+ if(pleaseCheck !== 10086){
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.getProjectDetail(pleaseCheck);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
//返回主营项目列表
|
|
|
backToList(){
|
|
|
this.$router.$avueRouter.closeTag();
|
|
@@ -567,16 +653,22 @@
|
|
|
serviceConfirm(){
|
|
|
if(this.serviceSelectList.length != 0){
|
|
|
this.serviceSelectList.forEach((item)=>{
|
|
|
- item.prop1 = item.code;
|
|
|
- item.prop2 = item.name;
|
|
|
- item.prop4 = item.unit;
|
|
|
- item.prop3 = item.remarks;
|
|
|
- this.$refs.crud.rowCellAdd(item);
|
|
|
+ const params = {
|
|
|
+ pname:item.cname,
|
|
|
+ remarks:item.remarks,
|
|
|
+ price:item.price,
|
|
|
+ unit:item.unit,
|
|
|
+ }
|
|
|
+ this.$refs.crud.rowCellAdd(params);
|
|
|
this.$refs.crud.rowCell(item, this.optionFrom.length-1)
|
|
|
})
|
|
|
}
|
|
|
this.serviceSelectList = []
|
|
|
this.serviceDialog = false
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "导入成功!"
|
|
|
+ });
|
|
|
},
|
|
|
//用户窗口事件
|
|
|
selectUser(row){
|
|
@@ -611,7 +703,8 @@
|
|
|
//确定
|
|
|
userConfirm(){
|
|
|
if(this.userSelection){
|
|
|
- this.data[this.detailsSelect].userId = this.userSelection[0].realName;
|
|
|
+ this.data[this.detailsSelect].userid = this.userSelection[0].id;
|
|
|
+ this.data[this.detailsSelect].userName = this.userSelection[0].realName;
|
|
|
this.userDialog = !this.userDialog
|
|
|
}
|
|
|
}
|
|
@@ -641,6 +734,11 @@
|
|
|
overflow: hidden;
|
|
|
max-height: 660px;
|
|
|
}
|
|
|
+ .add-customer-btn-two {
|
|
|
+ position: fixed;
|
|
|
+ right: 150px;
|
|
|
+ top: 115px;
|
|
|
+ }
|
|
|
.add-customer-btn {
|
|
|
position: fixed;
|
|
|
right: 36px;
|