|
@@ -7,19 +7,52 @@
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="add-customer-btn">
|
|
|
- <el-button class="el-button--small-yh" style="margin-right: 10px" type="primary" size="small" v-if="!editButton"
|
|
|
- @click="confirmEditing">编辑
|
|
|
+ <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
|
|
|
+ v-if="!editButton" @click="confirmEditing">编 辑
|
|
|
</el-button>
|
|
|
- <el-button class="el-button--small-yh" type="primary" size="small" @click="editCustomer">保存数据
|
|
|
+ <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
|
|
|
+ @click="editCustomer">保 存
|
|
|
</el-button>
|
|
|
- <el-button class="el-button--small-yh" type="primary" size="small" v-if="form.status !== '已发货'"
|
|
|
- @click="generateOutbound">生成出库任务
|
|
|
+ <el-button class="el-button--small-yh" style="margin-left: 6px;" type="success" size="small"
|
|
|
+ v-if="form.generateTask !== '已生成'" @click="generateOutbound">生成任务
|
|
|
</el-button>
|
|
|
+ <el-dropdown style="padding: 0 6px;line-height: 0">
|
|
|
+ <el-button type="danger" :loading="buttonLoading" :disabled="!form.id || viewDisabled" size="small">
|
|
|
+ 售 后<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item @click.native="applySettlement('申请')">申请退款
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item @click.native="applySettlement('确认')">确认退款
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ <el-dropdown style="line-height: 0">
|
|
|
+ <el-button type="warning" :loading="buttonLoading" :disabled="!form.id || viewDisabled" size="small">
|
|
|
+ 审 批<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item @click.native="applySettlement('审批')">审批
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item @click.native="applySettlement('请核')">请核进度
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item @click.native="applySettlement('撤销')">撤销请核
|
|
|
+ </el-dropdown-item>
|
|
|
+
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="margin-top: 50px">
|
|
|
<trade-card title="基础信息">
|
|
|
- <avue-form :option="optionForm" v-model="form" ref="form"></avue-form>
|
|
|
+ <avue-form :option="optionForm" v-model="form" ref="form">
|
|
|
+ <template slot-scope="{row,index}" slot="contacts">
|
|
|
+ <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" filterable
|
|
|
+ @change="contactsChange($event)">
|
|
|
+ <el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts"
|
|
|
+ :value="item.contacts" />
|
|
|
+ </el-select>
|
|
|
+ </template></avue-form>
|
|
|
</trade-card>
|
|
|
<trade-card title="明细信息">
|
|
|
<el-tabs v-model="activeName" type="card">
|
|
@@ -37,8 +70,8 @@
|
|
|
:icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
|
|
|
@click="$refs.formContacts.rowEdit(row, index)">编辑
|
|
|
</el-button>
|
|
|
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled" :type="type"
|
|
|
- @click="rowDelBox(row, index, 'orderItemsList')">删除
|
|
|
+ <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled"
|
|
|
+ :type="type" @click="rowDelBox(row, index, 'orderItemsList')">删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
@@ -83,7 +116,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getDetails, submit, generateShipTask, tradingBox } from "@/api/tirePartsMall/salesManagement/saleOrder";
|
|
|
+import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerInformation"
|
|
|
+import { getDetails, submit, generateShipTask, tradingBox,delOrderItem } from "@/api/tirePartsMall/salesManagement/saleOrder";
|
|
|
import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
|
|
@@ -92,6 +126,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
isDisabled: false,
|
|
|
+ contactsOption: [],
|
|
|
switchDialog: false,
|
|
|
activeName: "sale_detail",
|
|
|
disabled: false,
|
|
@@ -107,7 +142,7 @@ export default {
|
|
|
column: [{
|
|
|
label: '客户',
|
|
|
prop: "customerId",
|
|
|
- disabled: true,
|
|
|
+ disabled: false,
|
|
|
type: 'select',
|
|
|
props: {
|
|
|
label: 'cname',
|
|
@@ -115,13 +150,30 @@ export default {
|
|
|
},
|
|
|
cascader: ['recAddress'],
|
|
|
change: (data) => {
|
|
|
- if (this.$refs.form.DIC.customerId || data.value) {
|
|
|
- for (let item of this.$refs.form.DIC.customerId) {
|
|
|
- if (item.id == data.value) {
|
|
|
- // 后端返回数据暂无联系人、地址等数据,无法下拉默认
|
|
|
- }
|
|
|
- }
|
|
|
+ console.log(data.value);
|
|
|
+ if (data.value) {
|
|
|
+ getCustom({ id: data.value }).then(res => {
|
|
|
+ console.log(res.data.data);
|
|
|
+ this.form.storageId = res.data.data.deliveryWarehouseId
|
|
|
+ this.form.contacts = res.data.data.corpsAttnList[0].cname
|
|
|
+ this.form.phone = res.data.data.corpsAttnList[0].tel
|
|
|
+ this.contactsOption = res.data.data.corpsAddrList
|
|
|
+ this.form.recAddress = res.data.data.corpsAddrList[0].id
|
|
|
+
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
+ // if (this.$refs.form.DIC.customerId || data.value) {
|
|
|
+ // for (let item of this.$refs.form.DIC.customerId) {
|
|
|
+ // if (item.id == data.value) {
|
|
|
+ // console.log(data);
|
|
|
+ // console.log(this.$refs.form);
|
|
|
+ // console.log(item);
|
|
|
+ // // 后端返回数据暂无联系人、地址等数据,无法下拉默认
|
|
|
+ // this.form.phone = item.tel
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
dicUrl: '/api/blade-sales-part/corpsDesc/listAll?corpType=KH',
|
|
|
rules: [{
|
|
@@ -167,7 +219,13 @@ export default {
|
|
|
value: '网络支付'
|
|
|
}, {
|
|
|
label: '联系人',
|
|
|
+ type: "select",
|
|
|
prop: "contacts",
|
|
|
+ props: {
|
|
|
+ label: 'address',
|
|
|
+ value: 'id'
|
|
|
+ },
|
|
|
+ dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
|
|
|
}, {
|
|
|
label: '电话',
|
|
|
prop: "phone",
|
|
@@ -175,17 +233,12 @@ export default {
|
|
|
label: '收货地址',
|
|
|
prop: "recAddress",
|
|
|
type: 'select',
|
|
|
- disabled:true,
|
|
|
+ disabled: true,
|
|
|
props: {
|
|
|
label: 'address',
|
|
|
value: 'id'
|
|
|
},
|
|
|
- dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}',
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
+ dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
|
|
|
}, {
|
|
|
label: '配送方式',
|
|
|
type: 'select',
|
|
@@ -348,7 +401,7 @@ export default {
|
|
|
disabled: false,
|
|
|
overHidden: true,
|
|
|
width: 100
|
|
|
- },
|
|
|
+ },
|
|
|
{
|
|
|
label: '单位',
|
|
|
prop: 'units',
|
|
@@ -383,7 +436,7 @@ export default {
|
|
|
disabled: false,
|
|
|
width: 100
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
{
|
|
|
label: '价格',
|
|
|
prop: 'price',
|
|
@@ -391,13 +444,15 @@ export default {
|
|
|
width: 100,
|
|
|
disabled: false,
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
{
|
|
|
label: '发货数量',
|
|
|
prop: 'sendNum',
|
|
|
disabled: false,
|
|
|
overHidden: true,
|
|
|
- width: 100
|
|
|
+ width: 100,
|
|
|
+ disabled: true
|
|
|
+
|
|
|
},
|
|
|
// {
|
|
|
// label: '利润',
|
|
@@ -409,8 +464,9 @@ export default {
|
|
|
label: '小计',
|
|
|
prop: 'subTotalMoney',
|
|
|
overHidden: true,
|
|
|
- width: 100
|
|
|
- },
|
|
|
+ width: 100,
|
|
|
+ disabled: true
|
|
|
+ },
|
|
|
// {
|
|
|
// label: '返利',
|
|
|
// prop: 'thisAmount',
|
|
@@ -421,13 +477,16 @@ export default {
|
|
|
label: '成本',
|
|
|
prop: 'costprie',
|
|
|
overHidden: true,
|
|
|
- width: 100
|
|
|
+ width: 100,
|
|
|
+ disabled: true
|
|
|
},
|
|
|
{
|
|
|
label: '毛利',
|
|
|
prop: 'grossProfit',
|
|
|
overHidden: true,
|
|
|
- width: 100
|
|
|
+ width: 100,
|
|
|
+ disabled: true
|
|
|
+
|
|
|
},
|
|
|
{
|
|
|
label: '备注',
|
|
@@ -510,8 +569,35 @@ export default {
|
|
|
detailData: Object
|
|
|
},
|
|
|
async created() {
|
|
|
+ this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
|
|
|
+ console.log('走i在');
|
|
|
+ if (this.formContacts.goodsId !== value) {
|
|
|
+ goodsDetail({ id: value }).then(res => {
|
|
|
+ this.formContacts.goodsNo = res.data.data.code
|
|
|
+ this.formContacts.brandId = res.data.data.brandId
|
|
|
+ this.formContacts.propertyName = res.data.data.specificationAndModel
|
|
|
+ this.formContacts.pattern = res.data.data.brandItem
|
|
|
+ this.formContacts.goodsDescription = res.data.data.goodsDescription
|
|
|
+ this.formContacts.units = res.data.data.unit
|
|
|
+ if (res.data.data.whether == 0) {
|
|
|
+ this.findObject(this.optionContactsBack.column, "dot").disabled = true
|
|
|
+ } else {
|
|
|
+ this.findObject(this.optionContactsBack.column, "dot").disabled = false
|
|
|
+ dotList({
|
|
|
+ storageId: this.form.storageId,
|
|
|
+ goodsId: this.formContacts.goodsId
|
|
|
+ }).then(res => {
|
|
|
+ this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(1);
|
|
|
this.optionContacts = await this.getColumnData(this.getColumnName(269.1), this.optionContactsBack);
|
|
|
+ console.log('this.optionContacts.column',this.optionContacts.column);
|
|
|
this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
|
|
|
+ console.log('走i在');
|
|
|
if (this.formContacts.goodsId !== value) {
|
|
|
goodsDetail({ id: value }).then(res => {
|
|
|
this.formContacts.goodsNo = res.data.data.code
|
|
@@ -538,19 +624,20 @@ export default {
|
|
|
this.optionOutboundRecords = await this.getColumnData(this.getColumnName(269.3), this.optionOutboundRecordsBack);
|
|
|
this.key++
|
|
|
if (this.onLoad.id && this.detailData.id) {
|
|
|
+ console.log(1);
|
|
|
this.refresh(this.onLoad.id, true)
|
|
|
} else if (this.onLoad.id) {
|
|
|
+ console.log(2);
|
|
|
this.refresh(this.onLoad.id, true)
|
|
|
}
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
generateOutbound() {
|
|
|
- this.$confirm(`${this.form.status === "待发货" ? '已生成是否重新生成?' : '是否确认生成'}`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
+ if(this.form.orderItemsList.length <=0){
|
|
|
+ this.$message.error('请录入明细');
|
|
|
+
|
|
|
+ }else{
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
@@ -568,7 +655,20 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
- })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //联系人change
|
|
|
+ contactsChange(e) {
|
|
|
+ console.log(e);
|
|
|
+ console.log(this.contactsOption);
|
|
|
+
|
|
|
+ // 假设this.contactsOption是你的数组对象
|
|
|
+ let matchedContact = this.contactsOption.find(item => item.contacts == e);
|
|
|
+ // 判断是否找到匹配的对象
|
|
|
+ this.$set(this.form,'phone',matchedContact.tel)
|
|
|
+ this.$set(this.form,'recAddress',matchedContact.belongtoarea + matchedContact.detailedAddress)
|
|
|
+
|
|
|
},
|
|
|
//修改提交触发
|
|
|
editCustomer() {
|
|
@@ -607,8 +707,8 @@ export default {
|
|
|
console.log('res', res);
|
|
|
this.form = res.data.data
|
|
|
// console.log(this.form.businessSource);
|
|
|
- this.form.orderItemsList.forEach((items)=>{
|
|
|
- if(!items.subTotalMoney){
|
|
|
+ this.form.orderItemsList.forEach((items) => {
|
|
|
+ if (!items.subTotalMoney) {
|
|
|
items.subTotalMoney = items.goodsNum * items.price
|
|
|
items.grossProfit = items.subTotalMoney - items.costprie
|
|
|
}
|
|
@@ -620,11 +720,11 @@ export default {
|
|
|
//不能录入不能删除
|
|
|
this.$set(this.optionContactsBack, "addBtn", false)
|
|
|
this.isDisabled = true
|
|
|
- this.$set(this.form,'shipType','物流')
|
|
|
- this.$set(this.form,'receivableType','网络支付')
|
|
|
+ this.$set(this.form, 'shipType', '物流')
|
|
|
+ this.$set(this.form, 'receivableType', '网络支付')
|
|
|
this.optionContactsBack.column.forEach(item => {
|
|
|
this.$set(item, 'disabled', true)
|
|
|
- if(item.label == '批次号' || item.label == '备注'){
|
|
|
+ if (item.label == '批次号' || item.label == '备注') {
|
|
|
item.disabled = false
|
|
|
}
|
|
|
})
|
|
@@ -639,13 +739,13 @@ export default {
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
- this.$set(this.form,'shipType','物流')
|
|
|
- this.$set(this.form,'receivableType','现金')
|
|
|
+ this.$set(this.form, 'shipType', '物流')
|
|
|
+ this.$set(this.form, 'receivableType', '现金')
|
|
|
this.optionContactsBack.column.forEach(item => {
|
|
|
this.$set(item, 'disabled', false)
|
|
|
})
|
|
|
this.optionContactsBack.column.forEach(item => {
|
|
|
- if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '商品描述' || item.label === '批次号') {
|
|
|
+ if (item.label === '规格型号' || item.label === '花纹' || item.label === '品牌' || item.label === '物料编码' || item.label === '单位' || item.label === '商品描述') {
|
|
|
item.disabled = true;
|
|
|
}
|
|
|
})
|
|
@@ -665,8 +765,10 @@ export default {
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
if (row.id) {
|
|
|
- tradingBox(row.id).then(res => {
|
|
|
- this.form.contactsList.splice(index, 1);
|
|
|
+ console.log(index);
|
|
|
+ console.log(this.form.orderItemsList);
|
|
|
+ delOrderItem({ids:row.id}).then(res => {
|
|
|
+ this.form.orderItemsList.splice(index, 1);
|
|
|
this.$message.success("操作成功!");
|
|
|
});
|
|
|
} else {
|