|
@@ -20,7 +20,7 @@
|
|
|
<containerTitle title="基础资料"></containerTitle>
|
|
|
<basic-container style="margin-bottom: 10px">
|
|
|
<el-row>
|
|
|
- <el-col v-for="item in basicData.column" :span="item.span?item.span:8">
|
|
|
+ <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
|
|
|
<el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
|
|
|
<!-- <avue-input-tree v-if="item.prop === 'corpsTypeId'" leaf-only multiple :props="{label:'title'}" v-model="form[item.prop]" placeholder="请选择内容" type="tree" :dic="dic"-->
|
|
|
<!-- ></avue-input-tree>-->
|
|
@@ -33,7 +33,7 @@
|
|
|
<containerTitle title="发货信息"></containerTitle>
|
|
|
<basic-container style="margin-bottom: 10px">
|
|
|
<el-row>
|
|
|
- <el-col v-for="item in contactInformation.column" :span="item.span?item.span:8">
|
|
|
+ <el-col v-for="(item,index) in contactInformation.column" :key="index" :span="item.span?item.span:8">
|
|
|
<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-input v-else type="age" v-model="form[item.prop]" size="small" autocomplete="off"></el-input>
|
|
@@ -53,6 +53,9 @@
|
|
|
@row-update="rowUpdate"
|
|
|
@row-del="rowDel"
|
|
|
>
|
|
|
+ <template slot="code" slot-scope="{row,index}">
|
|
|
+ <span style="float: left;padding-top: 2px">{{row.code}}</span><el-button type="text" size="mini" style="float: right" @click="commodityChoice(row)">选择</el-button>
|
|
|
+ </template>
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
|
<el-button
|
|
|
type="text"
|
|
@@ -61,12 +64,11 @@
|
|
|
>{{row.$cellEdit?'保存':'修改'}}</el-button>
|
|
|
</template>
|
|
|
<template slot="menuLeft" slot-scope="{size}">
|
|
|
- <el-button type="success"
|
|
|
- icon="el-icon-edit"
|
|
|
+ <el-button type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
size="small"
|
|
|
- plain
|
|
|
@click="dialogVisible = !dialogVisible"
|
|
|
- >导入</el-button>
|
|
|
+ >新增</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
@@ -81,6 +83,9 @@
|
|
|
@row-update="rowUpdateProject"
|
|
|
@row-del="rowDelProject"
|
|
|
>
|
|
|
+ <template slot="code" slot-scope="{row,index}">
|
|
|
+ <span style="float: left;padding-top: 2px">{{row.code}}</span><el-button type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
|
|
|
+ </template>
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
|
<el-button
|
|
|
type="text"
|
|
@@ -88,6 +93,13 @@
|
|
|
@click="rowCellTwo(row,index)"
|
|
|
>{{row.$cellEdit?'保存':'修改'}}</el-button>
|
|
|
</template>
|
|
|
+ <template slot="menuLeft" slot-scope="{size}">
|
|
|
+ <el-button type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="small"
|
|
|
+ @click="costIncrease"
|
|
|
+ >新增</el-button>
|
|
|
+ </template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
<containerTitle title="附件上传"></containerTitle>
|
|
@@ -110,6 +122,7 @@
|
|
|
:visible.sync="dialogVisible"
|
|
|
width="80%"
|
|
|
:close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
:close-on-press-escape="false">
|
|
|
<el-row style="height: 0;">
|
|
|
<el-col :span="5">
|
|
@@ -136,14 +149,54 @@
|
|
|
</el-row>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="importGoods">导入</el-button>
|
|
|
+ <el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>
|
|
|
+ <el-button type="primary" @click="importChoice" v-if="commodityData === true" :disabled="tableData.length !== 1">导入</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="导入费用"
|
|
|
+ append-to-body
|
|
|
+ class="el-dialogDeep"
|
|
|
+ :visible.sync="dialogCost"
|
|
|
+ width="80%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false">
|
|
|
+ <el-row style="height: 0;">
|
|
|
+ <el-col :span="5">
|
|
|
+ <div>
|
|
|
+ <el-scrollbar>
|
|
|
+ <basic-container>
|
|
|
+ <avue-tree :option="treeOptionCost" :data="treeData" @node-click="nodeClickCost"/>
|
|
|
+ </basic-container>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="19">
|
|
|
+ <basic-container>
|
|
|
+ <avue-crud :option="optionTwoCost"
|
|
|
+ :table-loading="loadingCost"
|
|
|
+ :data="dataCost"
|
|
|
+ ref="crud"
|
|
|
+ @refresh-change="refreshChangeCost"
|
|
|
+ @selection-change="selectionChangeCost"
|
|
|
+ :page.sync="pageCost"
|
|
|
+ @on-load="onLoadCost">
|
|
|
+ </avue-crud>
|
|
|
+ </basic-container>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogCost = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="importCost" v-if="choiceData !== true">导入</el-button>
|
|
|
+ <el-button type="primary" @click="choiceCost" v-if="choiceData === true" :disabled="tableDataCost.length !== 1">导入</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {customerList, typeSave, detail, deleteDetails,
|
|
|
+import {typeSave, detail, deleteDetails,
|
|
|
corpstypeTree,
|
|
|
corpsattn,
|
|
|
corpsbank,
|
|
@@ -154,14 +207,27 @@ import customerContact from "./configuration/customerContact.json"
|
|
|
import advantageProject from "./configuration/advantageProject.json"
|
|
|
import bankOfDeposit from "./configuration/bankOfDeposit.json"
|
|
|
import commodity from "./configuration/commodity.json"
|
|
|
-import {getDeptLazyTree} from "@/api/basicData/commodityType";
|
|
|
+import optionTwoCost from "./configuration/mainListCost.json"
|
|
|
+import {getDeptLazyTree,customerList} from "@/api/basicData/basicFeesDesc";
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
|
data() {
|
|
|
return {
|
|
|
form: {},
|
|
|
data:[],
|
|
|
+ loadingCost:false,
|
|
|
+ choiceData:false,
|
|
|
+ commodityData:false,
|
|
|
+ dataCost:[],
|
|
|
+ choiceIndex:'',
|
|
|
+ dialogCost:false,
|
|
|
treeDeptId:'',
|
|
|
+ treeDeptIdCost:'',
|
|
|
+ pageCost:{
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
page:{
|
|
|
pageSize: 10,
|
|
|
currentPage: 1,
|
|
@@ -170,6 +236,31 @@ export default {
|
|
|
loading:false,
|
|
|
contactsForm: {},
|
|
|
optionTwo:commodity,
|
|
|
+ optionTwoCost:optionTwoCost,
|
|
|
+ treeOptionCost:{
|
|
|
+ nodeKey: 'id',
|
|
|
+ lazy: true,
|
|
|
+ treeLoad: function (node, resolve) {
|
|
|
+ const parentId = (node.level === 0) ? 0 : node.data.id;
|
|
|
+ getDeptLazyTree(parentId).then(res => {
|
|
|
+ resolve(res.data.data.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ leaf: !item.hasChildren
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addBtn: false,
|
|
|
+ menu: false,
|
|
|
+ size: 'small',
|
|
|
+ props: {
|
|
|
+ labelText: '标题',
|
|
|
+ label: 'title',
|
|
|
+ value: 'value',
|
|
|
+ children: 'children'
|
|
|
+ }
|
|
|
+ },
|
|
|
treeOption: {
|
|
|
nodeKey: 'id',
|
|
|
lazy: true,
|
|
@@ -201,6 +292,7 @@ export default {
|
|
|
advantageProjectData: [],
|
|
|
disabled:false,
|
|
|
bankOfDepositData: [],
|
|
|
+ tableDataCost: [],
|
|
|
dic:[],
|
|
|
tableData:[],
|
|
|
customerContact:customerContact,
|
|
@@ -210,7 +302,7 @@ export default {
|
|
|
column: [
|
|
|
{
|
|
|
label: '销售金额',
|
|
|
- prop: 'orderAmount',//无
|
|
|
+ prop: 'orderAmount',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -621,9 +713,78 @@ export default {
|
|
|
console.log(row)
|
|
|
this.$refs.crudProject.rowCell(row, index)
|
|
|
},
|
|
|
+ //费用新增触发
|
|
|
+ costIncrease(){
|
|
|
+ this.dialogCost = !this.dialogCost
|
|
|
+ this.choiceData = false
|
|
|
+ },
|
|
|
+ //点击费用明细选择触发
|
|
|
+ choice(row){
|
|
|
+ this.dialogCost = !this.dialogCost
|
|
|
+ this.choiceData = true
|
|
|
+ console.log(row)
|
|
|
+ this.choiceIndex = row.$index
|
|
|
+ },
|
|
|
+ //点击商品明细选择触发
|
|
|
+ commodityChoice(row){
|
|
|
+ this.dialogVisible = !this.dialogVisible
|
|
|
+ this.commodityData = true
|
|
|
+ console.log(row)
|
|
|
+ this.choiceIndexT = row.$index
|
|
|
+ },
|
|
|
+ //导入商品触发
|
|
|
+ importChoice(){
|
|
|
+ if (this.tableData.length === 1){
|
|
|
+ this.contactsData[this.choiceIndexT].cname = this.tableData[0].cname
|
|
|
+ this.contactsData[this.choiceIndexT].code = this.tableData[0].code
|
|
|
+ this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
|
|
|
+ this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specificationAndModel
|
|
|
+ this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
|
|
|
+ }
|
|
|
+ this.dialogVisible = !this.dialogVisible
|
|
|
+ this.commodityData = false
|
|
|
+ },
|
|
|
+ //费用编辑导入触发
|
|
|
+ choiceCost(){
|
|
|
+ console.log('1111')
|
|
|
+ if (this.tableDataCost.length === 1){
|
|
|
+ this.advantageProjectData[this.choiceIndex].feeName = this.tableDataCost[0].cname
|
|
|
+ this.advantageProjectData[this.choiceIndex].itemId = this.tableDataCost[0].id
|
|
|
+ this.advantageProjectData[this.choiceIndex].code = this.tableDataCost[0].code
|
|
|
+ }
|
|
|
+ this.dialogCost = !this.dialogCost
|
|
|
+ this.choiceData = false
|
|
|
+ },
|
|
|
+ //费用导入触发
|
|
|
+ importCost(){
|
|
|
+ console.log('111111')
|
|
|
+ // this.advantageProjectForm = this.advantageProjectForm.concat(this.tableDataCost)
|
|
|
+ if (this.tableDataCost.length>0){
|
|
|
+ for(let item in this.tableDataCost){
|
|
|
+ console.log(this.tableDataCost[item])
|
|
|
+ this.tableDataCost[item].itemId = this.tableDataCost[item].id
|
|
|
+ this.tableDataCost[item].feeName = this.tableDataCost[item].cname
|
|
|
+ delete this.tableDataCost[item].id
|
|
|
+ this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
|
|
|
+ this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length-1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.tableDataCost = []
|
|
|
+ this.dialogCost = false
|
|
|
+ },
|
|
|
//确认导入触发
|
|
|
importGoods(){
|
|
|
- this.contactsData = this.contactsData.concat(this.tableData)
|
|
|
+ // this.contactsData = this.contactsData.concat(this.tableData)
|
|
|
+ if (this.tableData.length>0){
|
|
|
+ for(let item in this.tableData){
|
|
|
+ console.log(this.tableData[item])
|
|
|
+ this.tableData[item].itemId = this.tableData[item].id
|
|
|
+ delete this.tableData[item].id
|
|
|
+ this.$refs.crudContact.rowCellAdd(this.tableData[item]);
|
|
|
+ this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length-1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.tableData = []
|
|
|
this.dialogVisible = false
|
|
|
},
|
|
|
//选中触发
|
|
@@ -631,17 +792,33 @@ export default {
|
|
|
console.log(list);
|
|
|
this.tableData = list
|
|
|
},
|
|
|
+ //费用选中触发
|
|
|
+ selectionChangeCost(list){
|
|
|
+ console.log(list);
|
|
|
+ this.tableDataCost = list
|
|
|
+ },
|
|
|
nodeClick(data) {
|
|
|
this.treeDeptId = data.id;
|
|
|
this.page.currentPage = 1;
|
|
|
this.onLoad(this.page);
|
|
|
},
|
|
|
+ nodeClickCost(data){
|
|
|
+ this.treeDeptIdCost = data.id;
|
|
|
+ this.pageCost.currentPage = 1;
|
|
|
+ this.onLoadCost(this.pageCost);
|
|
|
+ },
|
|
|
//刷新触发
|
|
|
refreshChange() {
|
|
|
this.treeDeptId = '';
|
|
|
this.page.currentPage = 1;
|
|
|
this.onLoad(this.page);
|
|
|
},
|
|
|
+ //费用刷新触发
|
|
|
+ refreshChangeCost() {
|
|
|
+ this.treeDeptIdCost = '';
|
|
|
+ this.pageCost.currentPage = 1;
|
|
|
+ this.onLoadCost(this.pageCost);
|
|
|
+ },
|
|
|
//新增商品信息保存触发
|
|
|
rowSave(row, done, loading){
|
|
|
console.log(row)
|
|
@@ -698,6 +875,18 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ //费用查询
|
|
|
+ onLoadCost(page, params = {}) {
|
|
|
+ this.loadingCost = true;
|
|
|
+ let queryParams = Object.assign({}, params, {pageSize: page.pageSize, pageNum: page.currentPage,parentId:0,feesTypeId:this.treeDeptIdCost})
|
|
|
+ customerList(queryParams).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ const data = res.data.data;
|
|
|
+ this.pageCost.total = data.total;
|
|
|
+ this.dataCost = data.records;
|
|
|
+ this.loadingCost = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
//删除费用明细触发
|
|
|
rowDelProject(row, index, donerowDel) {
|
|
|
this.$confirm("确定将选择数据删除?", {
|