|
@@ -51,6 +51,7 @@
|
|
|
<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="textarea" v-else-if="item.type === 'textarea'" v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled"></el-input>
|
|
|
<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>
|
|
@@ -67,6 +68,7 @@
|
|
|
@row-click="handleRowClick"
|
|
|
@row-update="rowUpdate"
|
|
|
@row-del="rowDel"
|
|
|
+ @saveColumn="saveColumn('goods')"
|
|
|
>
|
|
|
<template slot="code" slot-scope="{row,index}">
|
|
|
<span style="float: left;padding-top: 2px">{{ row.code }}</span>
|
|
@@ -88,6 +90,7 @@
|
|
|
>录入明细
|
|
|
</el-button>
|
|
|
<el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="sendOutGoods">确认发货</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
@@ -101,6 +104,7 @@
|
|
|
@row-save="rowSaveProject"
|
|
|
@row-update="rowUpdateProject"
|
|
|
@row-del="rowDelProject"
|
|
|
+ @saveColumn="saveColumn('fees')"
|
|
|
>
|
|
|
<template slot="code" slot-scope="{row,index}">
|
|
|
<span style="float: left;padding-top: 2px">{{ row.code }}</span>
|
|
@@ -236,7 +240,8 @@ import {
|
|
|
corpsattn,
|
|
|
corpsbank,
|
|
|
corpsitem,
|
|
|
- getList
|
|
|
+ getList,
|
|
|
+ sendOutGoods
|
|
|
} from "@/api/basicData/deliveryNotice"
|
|
|
import customerContact from "./configuration/customerContact.json"
|
|
|
import advantageProject from "./configuration/advantageProject.json"
|
|
@@ -347,8 +352,8 @@ export default {
|
|
|
tableDataCost: [],
|
|
|
dic: [],
|
|
|
tableData: [],
|
|
|
- customerContact: customerContact,
|
|
|
- advantageProject: advantageProject,
|
|
|
+ customerContact: {},
|
|
|
+ advantageProject: {},
|
|
|
bankOfDeposit: bankOfDeposit,
|
|
|
basicData: {
|
|
|
column: [
|
|
@@ -479,6 +484,7 @@ export default {
|
|
|
}, {
|
|
|
label: "备注",
|
|
|
span: 24,
|
|
|
+ type: 'textarea',
|
|
|
prop: "otherRemarks",
|
|
|
mock: {
|
|
|
type: 'county'
|
|
@@ -496,7 +502,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//初始化查询
|
|
|
- created() {
|
|
|
+ async created() {
|
|
|
+ this.customerContact = await this.getColumnData(this.getColumnName(21), customerContact);
|
|
|
+ this.advantageProject = await this.getColumnData(this.getColumnName(22), advantageProject);
|
|
|
this.getWorkDicts("order_status").then(res => {
|
|
|
this.statusOption = res.data.data
|
|
|
})
|
|
@@ -548,7 +556,16 @@ export default {
|
|
|
this.configuration.dicData = this.configuration.dicData.concat(this.form.belongToCorpList)
|
|
|
}
|
|
|
delete this.form.belongToCorpList
|
|
|
+ this.$set(this.form, 'deliveryAmount', 0)
|
|
|
+ this.$set(this.form, 'totalQuantity', 0)
|
|
|
+ this.$set(this.form, 'totalCost', 0)
|
|
|
this.contactsData.forEach(item => {
|
|
|
+ this.$set(item, "srcId", item.id)
|
|
|
+ this.$set(item, "actualQuantity", item.orderQuantity)
|
|
|
+ this.$set(item, "deliveryAmount", item.amount)
|
|
|
+ this.form.deliveryAmount += Number(item.deliveryAmount)
|
|
|
+ this.form.totalQuantity += Number(item.actualQuantity)
|
|
|
+ this.form.totalCost += Number(item.deliveryAmount)
|
|
|
delete item.id
|
|
|
delete item.pid
|
|
|
})
|
|
@@ -993,7 +1010,57 @@ export default {
|
|
|
}).catch(() => {
|
|
|
this.$emit("goBack");
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 确认发货
|
|
|
+ sendOutGoods() {
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ //商品信息
|
|
|
+ this.form.deliveryItemsList = this.contactsData
|
|
|
+ this.form.deliveryFeesList = this.advantageProjectData
|
|
|
+ this.form.deliveryFilesList = this.bankOfDepositData
|
|
|
+ if (typeof this.form.corpsTypeId == 'object') {
|
|
|
+ this.form.corpsTypeId = this.form.corpsTypeId.join(",")
|
|
|
+ }
|
|
|
+ sendOutGoods(this.form).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.$message.success('发货成功')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ // 保存列设置
|
|
|
+ async saveColumn(name) {
|
|
|
+ /**
|
|
|
+ * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
+ * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
+ * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
+ */
|
|
|
+ if (name == 'goods') {
|
|
|
+ const inSave = await this.saveColumnData(
|
|
|
+ this.getColumnName(21),
|
|
|
+ this.customerContact
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ } else if (name === 'fees') {
|
|
|
+ const inSave = await this.saveColumnData(
|
|
|
+ this.getColumnName(22),
|
|
|
+ this.advantageProject
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.crudProject.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|