|
@@ -33,7 +33,7 @@
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
<el-input type="age" v-else v-model="form[item.prop]" :disabled="item.disabled?true:false" size="small" value="0" autocomplete="off" placeholder="请输入">
|
|
|
- <template v-if="item.prop === 'debitAmount'|| item.prop === 'advanceAmount'||item.prop === 'settlmentAmount'||item.prop === 'balanceAmount'" slot="append">元</template>
|
|
|
+ <template v-if="item.prop === 'advanceAmount'||item.prop === 'settlmentAmount'||item.prop === 'balanceAmount'" slot="append">元</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -276,15 +276,15 @@
|
|
|
prop: 'debitAmount',
|
|
|
rules: [
|
|
|
{
|
|
|
- pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
|
|
|
+ required: true,
|
|
|
message: ' ',
|
|
|
trigger: 'blur'
|
|
|
},
|
|
|
{
|
|
|
- required: true,
|
|
|
+ pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
|
|
|
message: ' ',
|
|
|
trigger: 'blur'
|
|
|
- }
|
|
|
+ },
|
|
|
]
|
|
|
},
|
|
|
{
|
|
@@ -493,25 +493,16 @@
|
|
|
if(this.id){
|
|
|
projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
|
|
|
this.form = res.data.data;
|
|
|
- this.configuration.dicData = res.data.data.corpName;
|
|
|
+ if(res.data.data.corpName){
|
|
|
+ this.configuration.dicData = res.data.data.corpName; //给客户名称赋值
|
|
|
+ }
|
|
|
if(res.data.data.filesList){
|
|
|
this.upLoadData = res.data.data.filesList
|
|
|
}
|
|
|
if(res.data.data.itemList){
|
|
|
- this.data = res.data.data.itemList;
|
|
|
- let status = [];
|
|
|
- this.data.forEach(item =>{
|
|
|
- item.status == 0 ? status.push(true) : status.push(false)
|
|
|
- })
|
|
|
- //如果 明细列表存在 请核之后的状态 禁止编辑一些输入框
|
|
|
- if(status.findIndex(item => item == false) == 0){
|
|
|
- this.basicData.column.forEach(item =>{
|
|
|
- if(item.prop == "code" || item.prop == "cname" || item.prop == "corpId" || item.prop == "debitAmount"){
|
|
|
- item.disabled = true
|
|
|
- this.configuration.disabled = true
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ this.loading = true;
|
|
|
+ this.operationDetailList(res.data.data.itemList);
|
|
|
+ this.loading = false;
|
|
|
if(pleaseCheck === 10086){
|
|
|
this.pleaseCheck();
|
|
|
}
|
|
@@ -523,7 +514,7 @@
|
|
|
getSysNo().then(res =>{
|
|
|
this.$set(this.form,"sysNo", res.data.data)
|
|
|
let date = new Date();
|
|
|
- let strDate = date.getFullYear() + "-" + date.getMonth() + 1 + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
|
|
+ let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
|
|
this.$set(this.form,"createTime",strDate)
|
|
|
});
|
|
|
getUserInfo().then(res =>{
|
|
@@ -531,6 +522,22 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ operationDetailList(itemList){
|
|
|
+ this.data = itemList;
|
|
|
+ let status = [];
|
|
|
+ this.data.forEach(item =>{
|
|
|
+ item.status == 0 ? status.push(true) : status.push(false)
|
|
|
+ })
|
|
|
+ //如果 明细列表存在 请核之后的状态 禁止编辑一些输入框
|
|
|
+ if(status.findIndex(item => item == false) == 0){
|
|
|
+ this.basicData.column.forEach(item =>{
|
|
|
+ if(item.prop == "code" || item.prop == "cname" || item.prop == "corpId" || item.prop == "debitAmount"){
|
|
|
+ item.disabled = true
|
|
|
+ this.configuration.disabled = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
//删除列表后面的删除按钮触发触发(row, index, done)
|
|
|
rowDel(row, index, done) {
|
|
|
this.$confirm("确定将此明细删除?", {
|
|
@@ -551,36 +558,6 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //点击修改或保存时触发
|
|
|
- rowCellTwo(row,index){
|
|
|
- this.$refs.crud.rowCell(row, index);
|
|
|
- },
|
|
|
- //选择时
|
|
|
- selectionChange(row){
|
|
|
- this.crudSelection = row;
|
|
|
- },
|
|
|
- //新增修改时保存触发
|
|
|
- rowSave(row, done, loading) {
|
|
|
- done()
|
|
|
- },
|
|
|
- rowUpdate(row, index, done, loading) {
|
|
|
- done(row)
|
|
|
- },
|
|
|
- searchChange(params, done) {
|
|
|
- this.getList(this.page, params);
|
|
|
- done();
|
|
|
- },
|
|
|
- sizeChange(val) {
|
|
|
- this.page.pageSize = val;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- currentChange(val) {
|
|
|
- this.page.currentPage = val;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- saveColumn(row, column) {
|
|
|
- console.log(row, column);
|
|
|
- },
|
|
|
//新单
|
|
|
addMainProject(){
|
|
|
this.$confirm("需先将此单据保存", {
|
|
@@ -591,7 +568,7 @@
|
|
|
this.editMainProject(10010);
|
|
|
})
|
|
|
},
|
|
|
- //请核
|
|
|
+ //请核之前
|
|
|
beforePleaseCheck(){
|
|
|
if(this.crudSelection.length!=0){
|
|
|
let resultUserName = [];
|
|
@@ -618,8 +595,7 @@
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
- this.editMainProject();
|
|
|
- return
|
|
|
+ this.editMainProject(10086);
|
|
|
})
|
|
|
}
|
|
|
}else{
|
|
@@ -629,28 +605,6 @@
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- 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,1,2,3,4,5").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) => {
|
|
@@ -674,28 +628,45 @@
|
|
|
filesList:this.upLoadData
|
|
|
}
|
|
|
editMianProject(params).then(res =>{
|
|
|
- if(pleaseCheck !== 10086 && pleaseCheck !== 10010){
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- this.getProjectDetail()
|
|
|
- }else if(pleaseCheck === 10010){ //新单
|
|
|
+ if(pleaseCheck === 10086){ //请核
|
|
|
+ this.id = res.data.data;
|
|
|
+ this.getProjectDetail(pleaseCheck)
|
|
|
+ }else if(pleaseCheck === 10010){ //复制新单新单
|
|
|
this.$router.push({
|
|
|
path: "/mainItems_detailsPage",
|
|
|
query: {id: ''},
|
|
|
});
|
|
|
+ //清空关键信息
|
|
|
this.form = {}
|
|
|
this.data = []
|
|
|
this.upLoadData = []
|
|
|
this.id = ''
|
|
|
- }else if(pleaseCheck === 10086){
|
|
|
- this.getProjectDetail(pleaseCheck)
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.getProjectDetail()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ //请核
|
|
|
+ pleaseCheck(){
|
|
|
+ this.crudSelection.forEach(item =>{
|
|
|
+ updateItemStatus(this.data[item.$index].id,1).then(res =>{
|
|
|
+ if(res.data.success){
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "请核成功!"
|
|
|
+ });
|
|
|
+ //刷新列表
|
|
|
+ this.getProjectDetail();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
//返回主营项目列表
|
|
|
backToList(){
|
|
|
this.$router.$avueRouter.closeTag();
|
|
@@ -704,6 +675,36 @@
|
|
|
query: {}
|
|
|
});
|
|
|
},
|
|
|
+ //点击修改或保存时触发
|
|
|
+ rowCellTwo(row,index){
|
|
|
+ this.$refs.crud.rowCell(row, index);
|
|
|
+ },
|
|
|
+ //选择时
|
|
|
+ selectionChange(row){
|
|
|
+ this.crudSelection = row;
|
|
|
+ },
|
|
|
+ //新增修改时保存触发
|
|
|
+ rowSave(row, done, loading) {
|
|
|
+ done()
|
|
|
+ },
|
|
|
+ rowUpdate(row, index, done, loading) {
|
|
|
+ done(row)
|
|
|
+ },
|
|
|
+ searchChange(params, done) {
|
|
|
+ this.getList(this.page, params);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ sizeChange(val) {
|
|
|
+ this.page.pageSize = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ currentChange(val) {
|
|
|
+ this.page.currentPage = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ saveColumn(row, column) {
|
|
|
+ console.log(row, column);
|
|
|
+ },
|
|
|
//上传文件保存
|
|
|
upLoadSave(row, done, loading){
|
|
|
this.upLoadData.push(row)
|