|
@@ -32,10 +32,25 @@
|
|
|
<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"/>
|
|
|
<selectComponent v-else-if="item.prop === 'corpId' || item.prop === 'salesCompany'" v-model="form[item.prop]"
|
|
|
- :configuration="configuration"/>
|
|
|
+ :configuration="configuration" style="width: 100%"/>
|
|
|
<el-select v-else-if="item.prop === 'purchaseMode'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small">
|
|
|
<el-option v-for="(item,index) in procurementMethodOption" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
|
|
|
</el-select>
|
|
|
+ <avue-input-tree
|
|
|
+ v-else-if="item.prop === 'warehouseType'"
|
|
|
+ leaf-only
|
|
|
+ placeholder="请选择内容"
|
|
|
+ :dic="warehouseType"
|
|
|
+ type="tree"
|
|
|
+ v-model="form[item.prop]"
|
|
|
+ style="width: 100%"
|
|
|
+ size="small"
|
|
|
+ @change="warehouseTreeChange"
|
|
|
+ >
|
|
|
+ </avue-input-tree>
|
|
|
+ <el-select v-else-if="item.prop === 'storageId'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small">
|
|
|
+ <el-option v-for="(item,index) in warehouseName" :key="index" :label="item.cname" :value="item.id" size="small"></el-option>
|
|
|
+ </el-select>
|
|
|
<el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -70,7 +85,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="small"
|
|
|
@click="commoditySelection"
|
|
|
- >新增
|
|
|
+ >录入明细
|
|
|
</el-button>
|
|
|
<el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
|
|
|
</template>
|
|
@@ -111,7 +126,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="small"
|
|
|
@click="costIncrease"
|
|
|
- >新增
|
|
|
+ >录入明细
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
@@ -362,6 +377,8 @@ import bankOfDeposit from "./configuration/bankOfDeposit.json"
|
|
|
import commodity from "./configuration/commodity.json"
|
|
|
import optionTwoCost from "./configuration/mainListCost.json"
|
|
|
import {getDeptLazyTree, customerList,getDeptLazyTreeTwo} from "@/api/basicData/basicFeesDesc";
|
|
|
+import {customerList as wareHouseType} from "@/api/basicData/basicStorageType"
|
|
|
+import {customerList as selectWareHouse} from "@/api/basicData/basicStorageDesc"
|
|
|
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
@@ -509,9 +526,9 @@ export default {
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
- label: '匹配订单号',
|
|
|
- prop: 'srcOrderNo',
|
|
|
+ },{
|
|
|
+ label: '仓库类型',
|
|
|
+ prop: 'warehouseType',//字典表
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -530,6 +547,16 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
}, {
|
|
|
+ label: '匹配订单号',
|
|
|
+ prop: 'srcOrderNo',
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },{
|
|
|
label: '入库金额',
|
|
|
prop: 'deliveryAmount',
|
|
|
rules: [
|
|
@@ -591,7 +618,16 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
statusOption: [],
|
|
|
- procurementMethodOption: []
|
|
|
+ procurementMethodOption: [],
|
|
|
+ // 仓库类型
|
|
|
+ warehouseType: [],
|
|
|
+ // 仓库名称
|
|
|
+ warehouseName: [],
|
|
|
+ // 第一次进入
|
|
|
+ firstComing: false,
|
|
|
+ // 费用信息排序的最大值
|
|
|
+ maxFeeNum: 0,
|
|
|
+ maxGoodsNum: 0,
|
|
|
}
|
|
|
},
|
|
|
//初始化查询
|
|
@@ -599,12 +635,56 @@ export default {
|
|
|
this.getWorkDicts("procurement_method").then(res => {
|
|
|
this.procurementMethodOption = res.data.data
|
|
|
})
|
|
|
+ wareHouseType().then(res => {
|
|
|
+ this.warehouseType = res.data.data.records
|
|
|
+ this.warehouseType.forEach(item => {
|
|
|
+ this.$set(item, 'label', item.cname)
|
|
|
+ this.$set(item, 'value', item.id)
|
|
|
+ if (item.hasChildren) {
|
|
|
+ this.$set(item, 'children', [])
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let result = [], temp = {}
|
|
|
+ for(let i = 0; i < this.warehouseType.length;i++) {
|
|
|
+ temp[this.warehouseType[i].id] = this.warehouseType[i]
|
|
|
+ }
|
|
|
+ for (let j = 0;j < this.warehouseType.length;j++) {
|
|
|
+ let current = this.warehouseType[j]
|
|
|
+ let tempCurrentParent = temp[current.parentId]
|
|
|
+ if (tempCurrentParent) {
|
|
|
+ if (!tempCurrentParent["children"]) {
|
|
|
+ tempCurrentParent["children"] = []
|
|
|
+ }
|
|
|
+ tempCurrentParent["children"].push(current)
|
|
|
+ } else {
|
|
|
+ result.push(current)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.warehouseType = result
|
|
|
+ });
|
|
|
if (this.detailData.id) {
|
|
|
this.queryData(this.detailData.id)
|
|
|
}else if (this.detailData.form){
|
|
|
+ console.log(this.detailData.form)
|
|
|
this.form = JSON.parse(this.detailData.form);
|
|
|
+ delete this.form.createTime
|
|
|
+ delete this.form.id
|
|
|
+ delete this.form.sysNo
|
|
|
this.contactsData = this.form.orderItemsList
|
|
|
delete this.form.orderItemsList
|
|
|
+ this.configuration.dicData = this.form.corpName
|
|
|
+ delete this.form.corpName
|
|
|
+ this.$set(this.form, 'deliveryStatus', '录入')
|
|
|
+ if (this.form.belongToCorpList) {
|
|
|
+ this.$set(this.form, 'salesCompany', this.form.belongToCorpId)
|
|
|
+ delete this.form.belongToCorpId
|
|
|
+ this.configuration.dicData = this.configuration.dicData.concat(this.form.belongToCorpList)
|
|
|
+ }
|
|
|
+ delete this.form.belongToCorpList
|
|
|
+ this.contactsData.forEach(item => {
|
|
|
+ delete item.id
|
|
|
+ delete item.pid
|
|
|
+ })
|
|
|
} else if (this.detailData.copyId) {
|
|
|
this.queryData(this.detailData.copyId, true)
|
|
|
}
|
|
@@ -639,7 +719,29 @@ export default {
|
|
|
delete this.form.deliveryFilesList
|
|
|
delete this.form.corpName
|
|
|
delete this.form.companyName
|
|
|
- console.log(this.configuration.dicData)
|
|
|
+ // 获取最大值
|
|
|
+ let num = []
|
|
|
+ this.advantageProjectData.forEach(item => {
|
|
|
+ num.push(item.sort)
|
|
|
+ })
|
|
|
+ if (num.length == 0) {
|
|
|
+ this.maxFeeNum = 0;
|
|
|
+ } else {
|
|
|
+ this.maxFeeNum = num.reduce((a, b) => {
|
|
|
+ return b > a? b: a;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ let goodsNum = []
|
|
|
+ this.contactsData.forEach(item => {
|
|
|
+ goodsNum.push(item.sort)
|
|
|
+ })
|
|
|
+ if (goodsNum.length == 0) {
|
|
|
+ this.maxGoodsNum = 0;
|
|
|
+ } else {
|
|
|
+ this.maxGoodsNum = goodsNum.reduce((a, b) => {
|
|
|
+ return b > a? b: a;
|
|
|
+ })
|
|
|
+ }
|
|
|
if (isCopy) {
|
|
|
delete this.form.id
|
|
|
delete this.form.sysNo
|
|
@@ -661,6 +763,24 @@ export default {
|
|
|
copyOrder() {
|
|
|
this.queryData(this.form.id, true)
|
|
|
},
|
|
|
+ // 类别变换时触发
|
|
|
+ warehouseTreeChange(id) {
|
|
|
+ this.warehouseName = []
|
|
|
+ if (this.firstComing) {
|
|
|
+ if (!this.form.storageId) {
|
|
|
+ this.$set(this.form, 'storageId', null)
|
|
|
+ } else {
|
|
|
+ this.form.storageId = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let data = {
|
|
|
+ storageTypeId: id
|
|
|
+ }
|
|
|
+ selectWareHouse(data).then(res => {
|
|
|
+ this.warehouseName = res.data.data.records
|
|
|
+ })
|
|
|
+ this.firstComing = true
|
|
|
+ },
|
|
|
//点击行可编辑
|
|
|
handleRowClick(row, event, column) {
|
|
|
console.log(row.$index)
|
|
@@ -731,6 +851,8 @@ export default {
|
|
|
console.log(this.tableDataCost[item])
|
|
|
this.tableDataCost[item].itemId = this.tableDataCost[item].id
|
|
|
this.tableDataCost[item].feeName = this.tableDataCost[item].cname
|
|
|
+ this.tableDataCost[item].sort = this.maxFeeNum + 1
|
|
|
+ this.maxFeeNum++
|
|
|
delete this.tableDataCost[item].id
|
|
|
this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
|
|
|
this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length - 1)
|
|
@@ -751,6 +873,8 @@ export default {
|
|
|
delete this.tableData[item].id
|
|
|
delete this.tableData[item].status
|
|
|
delete this.tableData[item].isDeleted
|
|
|
+ this.tableData[item].sort = this.maxGoodsNum + 1
|
|
|
+ this.maxGoodsNum++
|
|
|
this.$refs.crudContact.rowCellAdd(this.tableData[item]);
|
|
|
this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
|
|
|
}
|