|
@@ -8,11 +8,23 @@
|
|
|
</div>
|
|
|
<div class="add-customer-btn">
|
|
|
<el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
|
|
|
- v-if="editButton" @click="confirmEditing">编 辑
|
|
|
+ v-if="editButton" @click="inEdit">编 辑
|
|
|
</el-button>
|
|
|
<el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
|
|
|
- :disabled="isSaveBtn" @click="editCustomer">保 存
|
|
|
+ :disabled="isSaveBtn" @click="editCustomer(0)">保 存
|
|
|
</el-button>
|
|
|
+ <el-button class="el-button--small-yh" v-if="form.id && form.status == 0" style="margin-left: 6px;"
|
|
|
+ type="success" size="small" @click="editCustomer(1)" :disabled="form.status == 1">提 交
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown v-if="form.status == 1">
|
|
|
+ <el-button style="margin-left: 6px;" type="success" size="small">
|
|
|
+ 审 核<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item @click.native="auditPlan(2)">通过</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click.native="approve()">驳回</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="margin-top: 50px">
|
|
@@ -52,7 +64,7 @@
|
|
|
<el-tabs v-model="activeName" type="card">
|
|
|
<el-tab-pane label="销售明细" name="sale_detail">
|
|
|
<avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
|
|
|
- :data="form.planItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
|
|
|
+ :data="form.planItemsList.filter(item => item.isDeleted != 1)" :key="key"
|
|
|
@row-close="rowClose" :before-close="beforeClose" @selection-change="selectionContacts"
|
|
|
@resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.6)"
|
|
|
@saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.6)">
|
|
@@ -72,7 +84,15 @@
|
|
|
:disabled="selectionMultilist.length != 1">查看库存</el-button>
|
|
|
</el-popover>
|
|
|
</template>
|
|
|
- <template slot="goodsNum" slot-scope="{ row }">
|
|
|
+ <template slot="regionNameForm" slot-scope="{ row }">
|
|
|
+ <dic-select v-if="row.$cellEdit" v-model="row.regionName" placeholder="库区" key="id"
|
|
|
+ label="regionName"
|
|
|
+ :url="'/blade-sales-part/tire/center/warehouse/storage-region/getRegionSelected?storageId=' + form.storageId"
|
|
|
+ :filterable="true" :remote="true" dataName="regionName"
|
|
|
+ @selectChange="rowDicChange('regionName', $event, row)"></dic-select>
|
|
|
+ <span v-else>{{ row.regionName }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="goodsNumForm" slot-scope="{ row }">
|
|
|
<el-input-number v-if="row.$cellEdit" size="small" v-model="row.goodsNum"
|
|
|
:precision="numberDecimal" :controls="false" @blur="goodsNumblurfun(row)"
|
|
|
style="width: 100%" @change="moneyChange(row)"></el-input-number>
|
|
@@ -89,13 +109,9 @@
|
|
|
<span v-else>{{ row.remarks }}</span>
|
|
|
</template>
|
|
|
<template slot-scope="{type,size,row,index,disabled}" slot="menu">
|
|
|
- <el-button v-if="mingxibaocun" :size="size" :disabled="form.status == 2" :type="type"
|
|
|
+ <el-button :size="size" :disabled="editButton || form.status == 2" :type="type"
|
|
|
:icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
|
|
|
- @click="hangeditBtn(row, index)">编辑
|
|
|
- </el-button>
|
|
|
- <el-button v-else :size="size" :disabled="form.status == 2" :type="type"
|
|
|
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
|
|
|
- @click="hangbaocun(row, index)">保存
|
|
|
+ @click="rowEdit(row, index)">{{ row.$cellEdit ? '保存' : '编辑' }}
|
|
|
</el-button>
|
|
|
<el-button icon="el-icon-delete" :size="size" :disabled="form.status == 2" :type="type"
|
|
|
@click="rowDel(row, index, 'planItemsList')">删除
|
|
@@ -103,11 +119,92 @@
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="出库记录" name="outbound_records">
|
|
|
+ <el-tab-pane label="收费明细" name="outbound_records">
|
|
|
<avue-crud :option="optionOutboundRecords" v-model="formContacts" ref="outbound_records"
|
|
|
- :data="form.outboundRecordsList" @row-save="rowSave" @row-update="rowUpdate"
|
|
|
+ :data="form.centerShipCostList.filter(item => item.isDeleted != 1)"
|
|
|
@resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)"
|
|
|
@saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)">
|
|
|
+ <template slot="indexHeader" slot-scope="{row,index}">
|
|
|
+ <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editButton" circle
|
|
|
+ @click="addRowD()">
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot="index" slot-scope="{row,index}">
|
|
|
+ <span>{{ index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="costNameForm" slot-scope="{ row }">
|
|
|
+ <dic-select v-if="row.$cellEdit" v-model="row.costName" placeholder="费用名称" key="id"
|
|
|
+ res="records" label="cname"
|
|
|
+ url="/blade-sales-part/storageDesc/list?current=1&size=5" :filterable="true"
|
|
|
+ :remote="true" dataName="cname"
|
|
|
+ @selectChange="rowDicChange('costName', $event, row)"></dic-select>
|
|
|
+ <span v-else>{{ row.costName }}</span>
|
|
|
+ </template>
|
|
|
+ <tempalte slot="costPriceForm" slot-scope="{ row }">
|
|
|
+ <el-input-number v-if="row.$cellEdit" v-model="row.costPrice" @change="countChange(row)"
|
|
|
+ :controls="false" placeholder="请输入 单价" size="small"
|
|
|
+ style="width: 100%;"></el-input-number>
|
|
|
+ <span v-else>{{ row.costPrice }}</span>
|
|
|
+ </tempalte>
|
|
|
+ <tempalte slot="goodsNumForm" slot-scope="{ row }">
|
|
|
+ <el-input-number v-if="row.$cellEdit" v-model="row.goodsNum" @change="countChange(row)"
|
|
|
+ :controls="false" placeholder="请输入 数量" size="small"
|
|
|
+ style="width: 100%;"></el-input-number>
|
|
|
+ <span v-else>{{ row.goodsNum }}</span>
|
|
|
+ </tempalte>
|
|
|
+ <template slot-scope="{type,size,row,index,disabled}" slot="menu">
|
|
|
+ <el-button :size="size" :disabled="editButton || form.status == 2" :type="type"
|
|
|
+ :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
|
|
|
+ @click="rowEdit(row, index)">{{ row.$cellEdit ? '保存' : '编辑' }}
|
|
|
+ </el-button>
|
|
|
+ <el-button icon="el-icon-delete" :size="size" :disabled="editButton || form.status == 2"
|
|
|
+ :type="type" @click="rowDel(row, index, 'centerShipCostList')">删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="付费明细" name="outbound_records2">
|
|
|
+ <avue-crud :option="optionOutboundRecords" v-model="formContacts" ref="outbound_records2"
|
|
|
+ :data="form.centerShipPaymentCostList.filter(item => item.isDeleted != 1)"
|
|
|
+ @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)"
|
|
|
+ @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)">
|
|
|
+ <template slot="indexHeader" slot-scope="{row,index}">
|
|
|
+ <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editButton" circle
|
|
|
+ @click="addRowC()">
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot="index" slot-scope="{row,index}">
|
|
|
+ <span>{{ index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="costNameForm" slot-scope="{ row }">
|
|
|
+ <dic-select v-if="row.$cellEdit" v-model="row.costName" placeholder="费用名称" key="id"
|
|
|
+ res="records" label="cname"
|
|
|
+ url="/blade-sales-part/storageDesc/list?current=1&size=5" :filterable="true"
|
|
|
+ :remote="true" dataName="cname"
|
|
|
+ @selectChange="rowDicChange('costName', $event, row)"></dic-select>
|
|
|
+ <span v-else>{{ row.costName }}</span>
|
|
|
+ </template>
|
|
|
+ <tempalte slot="costPriceForm" slot-scope="{ row }">
|
|
|
+ <el-input-number v-if="row.$cellEdit" v-model="row.costPrice" @change="countChange(row)"
|
|
|
+ :controls="false" placeholder="请输入 单价" size="small"
|
|
|
+ style="width: 100%;"></el-input-number>
|
|
|
+ <span v-else>{{ row.costPrice }}</span>
|
|
|
+ </tempalte>
|
|
|
+ <tempalte slot="goodsNumForm" slot-scope="{ row }">
|
|
|
+ <el-input-number v-if="row.$cellEdit" v-model="row.goodsNum" @change="countChange(row)"
|
|
|
+ :controls="false" placeholder="请输入 数量" size="small"
|
|
|
+ style="width: 100%;"></el-input-number>
|
|
|
+ <span v-else>{{ row.goodsNum }}</span>
|
|
|
+ </tempalte>
|
|
|
+ <template slot-scope="{type,size,row,index,disabled}" slot="menu">
|
|
|
+ <el-button :size="size" :disabled="editButton || form.status == 2" :type="type"
|
|
|
+ :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
|
|
|
+ @click="rowEdit(row, index)">{{ row.$cellEdit ? '保存' : '编辑' }}
|
|
|
+ </el-button>
|
|
|
+ <el-button icon="el-icon-delete" :size="size" :disabled="editButton || form.status == 2"
|
|
|
+ :type="type" @click="rowDel(row, index, 'centerShipCostList')">删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
</avue-crud>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
@@ -355,7 +452,8 @@ export default {
|
|
|
key: 0,
|
|
|
form: {
|
|
|
planItemsList: [],
|
|
|
- outboundRecordsList: [],
|
|
|
+ centerShipCostList: [],
|
|
|
+ centerShipPaymentCostList: [],
|
|
|
status: 0,
|
|
|
bsType: 'CP'
|
|
|
},
|
|
@@ -531,12 +629,15 @@ export default {
|
|
|
refreshBtn: false,
|
|
|
dialogDrag: true,
|
|
|
addBtn: false,
|
|
|
- // 航编辑开启
|
|
|
- cellBtn: true,
|
|
|
span: 8,
|
|
|
height: 500,
|
|
|
+ // 添加
|
|
|
addRowBtn: false,
|
|
|
+ // 保存按钮
|
|
|
editBtn: false,
|
|
|
+ // 航编辑开启
|
|
|
+ // cellBtn: true,
|
|
|
+ rowKey: 'ids',
|
|
|
delBtn: false,
|
|
|
menuWidth: 140,
|
|
|
dialogTop: 25,
|
|
@@ -574,6 +675,12 @@ export default {
|
|
|
}],
|
|
|
column: [
|
|
|
{
|
|
|
+ label: '入库单号',
|
|
|
+ prop: 'planId',
|
|
|
+ width: 100,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '商品名称',
|
|
|
prop: 'goodsName',
|
|
|
width: 250,
|
|
@@ -582,12 +689,12 @@ export default {
|
|
|
overHidden: true,
|
|
|
},
|
|
|
{
|
|
|
- label: '数量',
|
|
|
- prop: 'goodsNum',
|
|
|
- overHidden: true,
|
|
|
- disabled: false,
|
|
|
+ label: '库区',
|
|
|
+ prop: 'regionName',
|
|
|
cell: true,
|
|
|
- width: 100,
|
|
|
+ slot: true,
|
|
|
+ formslot: true,
|
|
|
+ overHidden: true,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: " ",
|
|
@@ -595,12 +702,12 @@ export default {
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
- label: '价格',
|
|
|
- prop: 'price',
|
|
|
- overHidden: true,
|
|
|
- width: 100,
|
|
|
- disabled: false,
|
|
|
+ label: '数量',
|
|
|
+ prop: 'goodsNum',
|
|
|
cell: true,
|
|
|
+ slot: true,
|
|
|
+ formslot: true,
|
|
|
+ overHidden: true,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: " ",
|
|
@@ -608,6 +715,12 @@ export default {
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
+ label: '价格',
|
|
|
+ prop: 'price',
|
|
|
+ overHidden: true,
|
|
|
+ width: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '库存',
|
|
|
prop: 'inventory',
|
|
|
overHidden: true,
|
|
@@ -696,45 +809,76 @@ export default {
|
|
|
selectionMultilist: [], // 多选数据
|
|
|
optionOutboundRecords: {},
|
|
|
optionOutboundRecordsBack: {
|
|
|
+ height: 'auto',
|
|
|
+ calcHeight: 30,
|
|
|
+ menuWidth: 120,
|
|
|
align: 'center',
|
|
|
- index: true,
|
|
|
- menu: false,
|
|
|
- addBtnText: "录入明细",
|
|
|
+ border: true,
|
|
|
+ menu: true,
|
|
|
refreshBtn: false,
|
|
|
- dialogDrag: true,
|
|
|
addBtn: false,
|
|
|
span: 8,
|
|
|
- height: 600,
|
|
|
addRowBtn: false,
|
|
|
editBtn: false,
|
|
|
delBtn: false,
|
|
|
- // menuWidth: 140,
|
|
|
- dialogTop: 25,
|
|
|
- dialogWidth: "80%",
|
|
|
- column: [{
|
|
|
- label: '出库单号',
|
|
|
- prop: 'billno'
|
|
|
- },
|
|
|
- // {
|
|
|
- // label: '来源单号',
|
|
|
- // prop: 'ordNo'
|
|
|
- // },
|
|
|
- {
|
|
|
- label: '数量',
|
|
|
- prop: 'goodsTotalNum'
|
|
|
- }, {
|
|
|
- label: '实际数量',
|
|
|
- prop: 'sendTotalNum'
|
|
|
- }, {
|
|
|
- label: '业务类型',
|
|
|
- prop: 'bizTypeName'
|
|
|
- }, {
|
|
|
- label: '状态',
|
|
|
- prop: 'statusName'
|
|
|
- }, {
|
|
|
- label: '业务时间',
|
|
|
- prop: 'createTime'
|
|
|
- }]
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "index",
|
|
|
+ prop: "index",
|
|
|
+ width: "55",
|
|
|
+ headerslot: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '费用名称',
|
|
|
+ prop: 'costName',
|
|
|
+ headerslot: true,
|
|
|
+ cell: true,
|
|
|
+ slot: true,
|
|
|
+ formslot: true,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '单价',
|
|
|
+ prop: 'costPrice',
|
|
|
+ headerslot: true,
|
|
|
+ cell: true,
|
|
|
+ slot: true,
|
|
|
+ formslot: true,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '数量',
|
|
|
+ prop: 'goodsNum',
|
|
|
+ headerslot: true,
|
|
|
+ cell: true,
|
|
|
+ slot: true,
|
|
|
+ formslot: true,
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '金额',
|
|
|
+ prop: 'costAmount',
|
|
|
+ headerslot: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ prop: 'remark',
|
|
|
+ cell: true,
|
|
|
+ headerslot: true,
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -760,12 +904,35 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ inEdit() {
|
|
|
+ if (this.form.status != 2) {
|
|
|
+ this.editButton = false
|
|
|
+ this.$set(this.optionForm, 'disabled', false)
|
|
|
+ this.$set(this.optionContactsBack, 'disabled', false)
|
|
|
+ }
|
|
|
+ },
|
|
|
countChange(row) {
|
|
|
row.costAmount = _.multiply(Number(row.costPrice ? row.costPrice : 0), Number(row.goodsNum ? row.goodsNum : 0)).toFixed(2)
|
|
|
},
|
|
|
moneyChange(row) {
|
|
|
row.subTotalMoney = _.multiply(Number(row.price ? row.price : 0), Number(row.goodsNum ? row.goodsNum : 0)).toFixed(2)
|
|
|
},
|
|
|
+ addRowD() {
|
|
|
+ if (!this.form.id) {
|
|
|
+ return this.$message.error('请保存数据')
|
|
|
+ }
|
|
|
+ this.form.centerShipCostList.push({
|
|
|
+ $cellEdit: true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addRowC() {
|
|
|
+ if (!this.form.id) {
|
|
|
+ return this.$message.error('请保存数据')
|
|
|
+ }
|
|
|
+ this.form.centerShipPaymentCostList.push({
|
|
|
+ $cellEdit: true
|
|
|
+ })
|
|
|
+ },
|
|
|
dicChange(name, row) {
|
|
|
if (name == 'customerName') {
|
|
|
if (row) {
|
|
@@ -805,6 +972,24 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ rowDicChange(name, row, el) {
|
|
|
+ if (name == 'costName') {
|
|
|
+ if (row) {
|
|
|
+ el.costId = row.id
|
|
|
+ } else {
|
|
|
+ el.costId = null
|
|
|
+ el.costName = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (name == 'regionName') {
|
|
|
+ if (row) {
|
|
|
+ el.regionId = row.id
|
|
|
+ } else {
|
|
|
+ el.regionId = null
|
|
|
+ el.regionName = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
viewInventory() {
|
|
|
this.inventoryData = []
|
|
|
inventoryList({ cname: this.selectionMultilist[0].goodsName }).then(res => [
|
|
@@ -855,23 +1040,6 @@ export default {
|
|
|
}
|
|
|
this.excelBox = true
|
|
|
},
|
|
|
- // 获取详细明细信息
|
|
|
- getDetailsfun() {
|
|
|
- getDetails({
|
|
|
- id: this.detailData.id
|
|
|
- }).then(res => {
|
|
|
- this.form = res.data.data
|
|
|
- this.form.planItemsList = res.data.data.planItemsList
|
|
|
-
|
|
|
- console.log(this.isEditButton, 'bianj')
|
|
|
- console.log(this.isDisabledTask, 'chexiao')
|
|
|
- console.log(this.buttonColor, '123')
|
|
|
- // if (this.form.status == '待发货') {
|
|
|
- //
|
|
|
- // }
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
// 获取左侧筛选
|
|
|
getAllWorkDicts() {
|
|
|
getCorpTypes({ whetherIntegral: '0' }).then(res => {
|
|
@@ -969,7 +1137,7 @@ export default {
|
|
|
brandId: item.brandId,
|
|
|
goodsNo: item.code,
|
|
|
propertyName: item.specificationAndModel,
|
|
|
- inventory: item.inventory,
|
|
|
+ inventory: item.balanceQuantity,
|
|
|
pattern: item.brandItem,
|
|
|
goodsDescription: item.goodsDescription,
|
|
|
dot: item.dot,
|
|
@@ -987,6 +1155,8 @@ export default {
|
|
|
// 价格
|
|
|
pricetype: false,
|
|
|
// sendNum: 0,
|
|
|
+ // 是否是编辑状态
|
|
|
+ $cellEdit: true
|
|
|
}
|
|
|
if (item.goodsFilesList && item.goodsFilesList.length) {
|
|
|
for (let ite of item.goodsFilesList) {
|
|
@@ -1044,27 +1214,6 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- // 采购明细行编辑
|
|
|
- hangeditBtn(row, index) {
|
|
|
- // 获取是否管理批次号
|
|
|
- getDetailsGods({ id: row.goodsId }).then(res => {
|
|
|
- row.whether = res.data.data.whether
|
|
|
- row.dotedittype = true
|
|
|
- // 价格数量
|
|
|
- row.goodsNumtype = true
|
|
|
- row.pricetype = true
|
|
|
- // 编辑和保存状态切换
|
|
|
- this.mingxibaocun = false
|
|
|
- this.goodsPageXsfun()
|
|
|
- })
|
|
|
- },
|
|
|
- // 保存按钮
|
|
|
- hangbaocun(row) {
|
|
|
- row.dotedittype = false
|
|
|
- row.goodsNumtype = false
|
|
|
- row.pricetype = false
|
|
|
- this.mingxibaocun = true
|
|
|
- },
|
|
|
// 数量失焦触发
|
|
|
goodsNumblurfun(row) {
|
|
|
if (Number(row.goodsNum) > Number(row.inventory)) {
|
|
@@ -1082,38 +1231,42 @@ export default {
|
|
|
|
|
|
},
|
|
|
//修改提交触发
|
|
|
- editCustomer() {
|
|
|
+ editCustomer(type) {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
- if (this.form.planItemsList.length == 0) {
|
|
|
- this.$message.warning("请添加商品");
|
|
|
- return
|
|
|
+ for (let row of this.form.planItemsList.filter(item => item.isDeleted != 1)) {
|
|
|
+ if (!row.regionName || !row.goodsNum) {
|
|
|
+ this.$refs.formContacts.rowCell(row, row.$index)
|
|
|
+ return this.$message.error("请完善商品明细信息");
|
|
|
+ }
|
|
|
}
|
|
|
- for (let i in this.form.planItemsList) {
|
|
|
- this.form.planItemsList[i].subTotalMoney = Number(this.form.planItemsList[i].goodsNum * this.form.planItemsList[i].price) ? Number(this.form.planItemsList[i].goodsNum * this.form.planItemsList[i].price).toFixed(2) : 0
|
|
|
- if (this.form.planItemsList[i].goodsNum <= 0) {
|
|
|
- return this.$message.warning(`销售明细序号${Number(i) + 1}的数量不能为零`);
|
|
|
+ for (let row of this.form.centerShipCostList.filter(item => item.isDeleted != 1)) {
|
|
|
+ if (!row.costName || !row.goodsNum || !row.costPrice) {
|
|
|
+ this.$refs.outbound_records.rowCell(row, row.$index)
|
|
|
+ return this.$message.error("请完善费用明细信息");
|
|
|
}
|
|
|
- if (!this.form.planItemsList[i].sendNum) {
|
|
|
- this.form.planItemsList[i].sendNum = 0
|
|
|
+ }
|
|
|
+ for (let row of this.form.centerShipPaymentCostList.filter(item => item.isDeleted != 1)) {
|
|
|
+ if (!row.costName || !row.goodsNum || !row.costPrice) {
|
|
|
+ this.$refs.outbound_records2.rowCell(row, row.$index)
|
|
|
+ return this.$message.error("请完善费用明细信息");
|
|
|
}
|
|
|
}
|
|
|
- this.mingxibaocun = true
|
|
|
+ let obj = {
|
|
|
+ ...this.form,
|
|
|
+ vehiclePhoto: JSON.stringify(this.form.vehiclePhoto),
|
|
|
+ status: type,
|
|
|
+ }
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
text: '加载中',
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
- this.form.billType = this.form.billType ? this.form.billType : 0
|
|
|
- submit(this.form).then(res => {
|
|
|
+ submit(obj).then(res => {
|
|
|
this.$message.success("保存成功");
|
|
|
- this.getDetail(res.data.data.id)
|
|
|
- this.isDisabledTask = false
|
|
|
- // this.editButton = true
|
|
|
- this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
- loading.close();
|
|
|
+ this.getDetail(res.data.data)
|
|
|
}).finally(() => {
|
|
|
loading.close();
|
|
|
});
|
|
@@ -1164,11 +1317,26 @@ export default {
|
|
|
})
|
|
|
getDetails({ id: id }).then(res => {
|
|
|
this.form = res.data.data
|
|
|
- }).catch(() => {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.formContacts.doLayout()
|
|
|
+ })
|
|
|
+ if (res.data.data.status == 2) {
|
|
|
+ this.$set(this.optionForm, 'disabled', true)
|
|
|
+ this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
+ this.editButton = true
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
loading.close();
|
|
|
- })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ rowEdit(row, index) {
|
|
|
+ if (row.$cellEdit) {
|
|
|
+ this.$set(row, '$cellEdit', false)
|
|
|
+ } else {
|
|
|
+ this.$set(row, '$cellEdit', true)
|
|
|
+ }
|
|
|
},
|
|
|
- rowDel(row, index,list) {
|
|
|
+ rowDel(row, index, list) {
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
@@ -1221,16 +1389,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- rowSave(form, done, loading) {
|
|
|
- if (this.isStatus) {
|
|
|
- done(form)
|
|
|
- } else {
|
|
|
- this.$message.error('请选择相同公司的商品')
|
|
|
- }
|
|
|
- },
|
|
|
- rowUpdate(form, index, done, loading) {
|
|
|
- done(form)
|
|
|
- },
|
|
|
// 新增商品
|
|
|
rowAdd(row, type) {
|
|
|
if (!this.form.customerId) {
|
|
@@ -1290,4 +1448,21 @@ export default {
|
|
|
::v-deep .el-form-item {
|
|
|
margin-bottom: 8px !important;
|
|
|
}
|
|
|
+
|
|
|
+::v-deep .el-dialog__body {
|
|
|
+ padding: 10px 20px;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .el-table .cell {
|
|
|
+ padding: 0 2px !important;
|
|
|
+
|
|
|
+ .el-form-item {
|
|
|
+ margin-bottom: 0px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .avue-crud .el-table .el-form-item__label {
|
|
|
+ left: -1px;
|
|
|
+}
|
|
|
</style>
|