|
@@ -8,10 +8,19 @@
|
|
|
</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-button class="el-button--small-yh" v-if="form.status == 1" style="margin-left: 6px;" type="success"
|
|
|
+ size="small" @click="editCustomer(2)">通 过
|
|
|
+ </el-button>
|
|
|
+ <el-button class="el-button--small-yh" v-if="form.status == 1" style="margin-left: 6px;" type="danger"
|
|
|
+ size="small" @click="approve()">驳 回
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -22,39 +31,38 @@
|
|
|
<!-- 联系人 -->
|
|
|
<el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" clearable
|
|
|
filterable allow-create default-first-option @change="contactsChange($event)"
|
|
|
- :disabled=isContacts>
|
|
|
+ :disabled="editButton || form.status == 2">
|
|
|
<el-option v-for="item in contactsOption" :key="item.cname" :label="item.cname"
|
|
|
:value="item.contacts" />
|
|
|
</el-select>
|
|
|
</template>
|
|
|
- <template slot-scope="{row,index}" slot="recAddress">
|
|
|
- <!-- 地址 -->
|
|
|
- <el-select v-model="form.recAddress" placeholder="请选择" size="small" style="width:60%" clearable
|
|
|
- filterable allow-create default-first-option :disabled=isContacts>
|
|
|
- <el-option v-for="item in recAddressOption" :key="item.id"
|
|
|
- :label="item.belongtoarea + item.detailedAddress"
|
|
|
- :value="item.belongtoarea + item.detailedAddress" />
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
+ <tempalte slot="customerName">
|
|
|
+ <dic-select v-model="form.customerName" placeholder="货主" key="id" label="cname" res="records"
|
|
|
+ url="/blade-sales-part/corpsDesc/list?current=1&size=20&&enableOrNot=1" :filterable="true"
|
|
|
+ :remote="true" dataName="cname" @selectChange="dicChange('customerName', $event)"
|
|
|
+ :disabled="editButton || form.status == 2"></dic-select>
|
|
|
+ </tempalte>
|
|
|
</avue-form>
|
|
|
</trade-card>
|
|
|
<trade-card title="明细信息">
|
|
|
<el-tabs v-model="activeName" type="card">
|
|
|
- <el-tab-pane label="入库明细" name="sale_detail">
|
|
|
+ <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"
|
|
|
- @row-close="rowClose" :before-close="beforeClose"
|
|
|
- @selection-change="selectionContacts"
|
|
|
- @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
|
|
|
- @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)">
|
|
|
+ :data="form.planItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
|
|
|
+ @row-close="rowClose" :before-close="beforeClose" @selection-change="selectionContacts"
|
|
|
+ @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
|
|
|
+ @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)">
|
|
|
<template slot-scope="{scope,row}" slot="menuLeft">
|
|
|
- <el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
|
|
|
- @click="rowAdd(row)">添加商品
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="small"
|
|
|
+ :disabled="editButton || form.status == 2" @click="rowAdd(row)">添加商品
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" size="small" :disabled="editButton || form.status == 2"
|
|
|
+ icon="el-icon-bottom" @click="excelDialogfun('code')">按Code导入
|
|
|
</el-button>
|
|
|
<el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印
|
|
|
</el-button>
|
|
|
<el-button type="danger" plain size="small" @click="batchDelete"
|
|
|
- :disabled="form.status != '录入' || editButton">一键删除
|
|
|
+ :disabled="editButton || form.status == 2 || selectionMultilist.length == 0">一键删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template slot="goodsId" slot-scope="{ row }">
|
|
@@ -88,10 +96,8 @@
|
|
|
<span v-else>{{ row.dot }}</span>
|
|
|
</template>
|
|
|
|
|
|
- <template slot="subTotalMoney" slot-scope="{ row }">{{
|
|
|
- (row.goodsNum *
|
|
|
- row.price).toFixed(2)
|
|
|
- }}
|
|
|
+ <template slot="subTotalMoney" slot-scope="{ row }">
|
|
|
+ {{ (row.goodsNum * row.price).toFixed(2) }}
|
|
|
</template>
|
|
|
|
|
|
<template slot="remarks" slot-scope="{ row }">
|
|
@@ -100,16 +106,16 @@
|
|
|
<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="disabled || isAdd" :type="type"
|
|
|
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
|
|
|
+ <el-button v-if="mingxibaocun" :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="disabled || isAdd" :type="type"
|
|
|
+ <el-button v-else :size="size" :disabled="editButton || form.status == 2" :type="type"
|
|
|
:icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
|
|
|
@click="hangbaocun(row, index)">保存
|
|
|
</el-button>
|
|
|
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled"
|
|
|
- :type="type" @click="rowDelBox(row, index, 'planItemsList')">删除
|
|
|
+ <el-button icon="el-icon-delete" :size="size" :disabled="editButton || form.status == 2"
|
|
|
+ :type="type" @click="rowDelBox(row, index, 'planItemsList')">删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
@@ -126,7 +132,20 @@
|
|
|
<report-dialog :switchDialog="switchDialog" reportName="轮胎商城-采购订单" :reportId="form.id"
|
|
|
@onClose="onClose()"></report-dialog>
|
|
|
</div>
|
|
|
-
|
|
|
+ <el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px"
|
|
|
+ :close-on-click-modal="false" v-dialog-drag>
|
|
|
+ <avue-form :option="excelOption" v-model="excelForm" table-loading="excelLoading"
|
|
|
+ :upload-before="uploadBefore" :upload-after="uploadAfter">
|
|
|
+ <template slot="excelTemplate">
|
|
|
+ <el-button type="primary" @click="derivation">
|
|
|
+ 点击下载<i class="el-icon-download el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-form>
|
|
|
+ <p style="text-align: center;color: #DC0505">
|
|
|
+ 温馨提示 第一次导入时请先下载模板
|
|
|
+ </p>
|
|
|
+ </el-dialog>
|
|
|
<el-dialog title="选择商品" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
|
|
|
:close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close="closeGoods">
|
|
|
<el-row :style="{ height: rowHeight }">
|
|
@@ -182,6 +201,17 @@
|
|
|
:loading="saveLoading">导入</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="驳回数据" append-to-body :visible.sync="approveVisible" width="30%" :close-on-click-modal="false"
|
|
|
+ v-dialog-drag>
|
|
|
+ <span>
|
|
|
+ <el-input type="textarea" :rows="5" placeholder="请输入驳回原因" v-model="textarea">
|
|
|
+ </el-input>
|
|
|
+ </span>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="approveVisible = false" size="mini">取消</el-button>
|
|
|
+ <el-button type="danger" @click="approveVisible = false; editCustomer(3)" size="mini">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -190,12 +220,7 @@ import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerI
|
|
|
import { getDetails as getDetailsLT } from "@/api/tirePartsMall/basicData/commodityInformation/index"
|
|
|
import { dateFormat } from "@/util/date";
|
|
|
import { getToken } from "@/util/auth";
|
|
|
-import {
|
|
|
- getDetails,
|
|
|
- submit,
|
|
|
- delOrderItem,
|
|
|
- shortcutWarehousing
|
|
|
-} from "@/api/tirePartsMall/salesManagement/saleOrder";
|
|
|
+import { shortcutWarehousing } from "@/api/tirePartsMall/salesManagement/saleOrder";
|
|
|
import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
import checkSchedule from "@/components/checkL/checkSchedule";
|
|
@@ -203,12 +228,14 @@ import check from "@/components/checkL/check";
|
|
|
import { getCorpType, getList } from "@/api/tirePartsMall/basicData/commodityInformation"
|
|
|
import { isProcurement } from "@/api/basicData/configuration";
|
|
|
import commodity from "../../configuration/commodity.json";
|
|
|
-import {submitPlan} from "@/api/storehouse/plan/plan-in";
|
|
|
-
|
|
|
+import { getDetails, submit, itemRemove } from "@/api/storehouse/plan.js";
|
|
|
+import dicSelect from "@/components/dicSelect/main";
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
|
data() {
|
|
|
return {
|
|
|
+ approveVisible: false,
|
|
|
+ excelBox: false,
|
|
|
numberDecimal: 0,
|
|
|
SelectSearch: {},
|
|
|
// 编辑还是保存
|
|
@@ -261,7 +288,6 @@ export default {
|
|
|
|
|
|
inventory: 0,
|
|
|
isStatus: 1,
|
|
|
- excelBox: false,
|
|
|
// 商品名称
|
|
|
goodsIdoptions: [],
|
|
|
dataList: [],
|
|
@@ -306,48 +332,44 @@ export default {
|
|
|
form: {
|
|
|
planItemsList: [],
|
|
|
outboundRecordsList: [],
|
|
|
- bsType: 'RP'
|
|
|
+ bsType: 'RP',
|
|
|
+ status: 0,
|
|
|
+ },
|
|
|
+ excelOption: {
|
|
|
+ submitBtn: false,
|
|
|
+ emptyBtn: false,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "模板下载",
|
|
|
+ prop: "excelTemplate",
|
|
|
+ formslot: true,
|
|
|
+ span: 24
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "导入明细",
|
|
|
+ prop: "excelFile",
|
|
|
+ type: "upload",
|
|
|
+ drag: true,
|
|
|
+ loadText: "上传中,请稍等",
|
|
|
+ accept: '.xls,.xlsx',
|
|
|
+ span: 24,
|
|
|
+ propsHttp: {
|
|
|
+ res: "data"
|
|
|
+ },
|
|
|
+ tip: "请上传 .xls,.xlsx 标准格式文件",
|
|
|
+ action: "/api/blade-sales-part/ship/import-item"
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
optionForm: {
|
|
|
menuBtn: false,
|
|
|
span: 8,
|
|
|
disabled: false,
|
|
|
+ labelWidth: 100,
|
|
|
column: [{
|
|
|
label: '货主',
|
|
|
- prop: "customerId",
|
|
|
+ prop: "customerName",
|
|
|
disabled: false,
|
|
|
- remote: true,
|
|
|
- type: 'select',
|
|
|
- props: {
|
|
|
- label: 'cname',
|
|
|
- value: 'id'
|
|
|
- },
|
|
|
- cascader: ['recAddress'],
|
|
|
- click: () => {
|
|
|
- this.$refs.form.dicInit()
|
|
|
- },
|
|
|
- change: (data) => {
|
|
|
- console.info('data----', data)
|
|
|
- if (this.$refs.form.DIC.customerId || !this.onLoad.id) {
|
|
|
- getCustom({ id: data.value }).then(res => {
|
|
|
- console.info('res----', res)
|
|
|
- this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
|
|
|
- // this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
|
|
|
- // this.form.storageId = res.data.data.deliveryWarehouseId
|
|
|
- this.form.storageId = this.form.storageId ? 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.corpsAttnList
|
|
|
- //地址
|
|
|
- this.recAddressOption = res.data.data.corpsAddrList
|
|
|
- console.log('contactsOption', this.contactsOption);
|
|
|
- this.form.recAddress = res.data.data.corpsAddrList[0].belongtoarea + res.data.data.corpsAddrList[0].detailedAddress
|
|
|
-
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=1',
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: " ",
|
|
@@ -370,7 +392,7 @@ export default {
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
- label: '业务日期',
|
|
|
+ label: '计划入库日期',
|
|
|
prop: "businesDate",
|
|
|
searchProp: "businesDateList",
|
|
|
disabled: false,
|
|
@@ -387,6 +409,21 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
+ label: "制单人",
|
|
|
+ prop: "createUserName",
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '单据编号',
|
|
|
+ prop: "ordNo",
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '计划总数量',
|
|
|
+ prop: "goodsTotalNum",
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
label: '联系人',
|
|
|
type: "select",
|
|
|
prop: "contacts",
|
|
@@ -403,18 +440,6 @@ export default {
|
|
|
disabled: false,
|
|
|
|
|
|
prop: "phone",
|
|
|
- }, {
|
|
|
- label: '地址',
|
|
|
- prop: "recAddress",
|
|
|
- type: 'select',
|
|
|
- allowCreate: true,
|
|
|
- filterable: true,
|
|
|
- disabled: false,
|
|
|
- props: {
|
|
|
- label: 'address',
|
|
|
- value: 'address'
|
|
|
- },
|
|
|
- dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
|
|
|
},
|
|
|
{
|
|
|
label: '备注',
|
|
@@ -545,11 +570,6 @@ export default {
|
|
|
}]
|
|
|
},
|
|
|
{
|
|
|
- label: '库存',
|
|
|
- prop: 'inventory',
|
|
|
- overHidden: true,
|
|
|
- width: 100
|
|
|
- }, {
|
|
|
label: '批次号',
|
|
|
prop: 'dot',
|
|
|
cell: true,
|
|
@@ -619,87 +639,6 @@ export default {
|
|
|
overHidden: true,
|
|
|
width: 100
|
|
|
},
|
|
|
-
|
|
|
- {
|
|
|
- label: '收货数量',
|
|
|
- prop: 'sendNum',
|
|
|
- overHidden: true,
|
|
|
- width: 100,
|
|
|
- disabled: true,
|
|
|
- editDisplay: false,
|
|
|
- addDisplay: false
|
|
|
- },
|
|
|
- {
|
|
|
- label: '返利后单价',
|
|
|
- prop: 'rebatePrice',
|
|
|
- overHidden: true,
|
|
|
- width: 100,
|
|
|
- cell: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '返利后成本价',
|
|
|
- prop: 'rebateCostprie',
|
|
|
- overHidden: true,
|
|
|
- width: 100,
|
|
|
- disabled: true,
|
|
|
- editDisplay: false,
|
|
|
- addDisplay: false
|
|
|
- },
|
|
|
- {
|
|
|
- label: '返利后利润',
|
|
|
- prop: 'rebateProfit',
|
|
|
- overHidden: true,
|
|
|
- width: 100,
|
|
|
- disabled: true,
|
|
|
- editDisplay: false,
|
|
|
- addDisplay: false
|
|
|
- },
|
|
|
- {
|
|
|
- label: '退货数量',
|
|
|
- prop: "returnsNumber",
|
|
|
- overHidden: true,
|
|
|
- width: 100,
|
|
|
- disabled: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '退货金额',
|
|
|
- prop: "returnsAmount",
|
|
|
- overHidden: true,
|
|
|
- width: 100,
|
|
|
- disabled: true,
|
|
|
- },
|
|
|
- // {
|
|
|
- // label: '利润',
|
|
|
- // prop: 'profit',
|
|
|
- // overHidden: true,
|
|
|
- // width: 100
|
|
|
- // },
|
|
|
-
|
|
|
- // {
|
|
|
- // label: '返利',
|
|
|
- // prop: 'thisAmount',
|
|
|
- // overHidden: true,
|
|
|
- // width: 100
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '成本',
|
|
|
- // prop: 'costprie',
|
|
|
- // overHidden: true,
|
|
|
- // width: 100,
|
|
|
- // disabled: true,
|
|
|
- // editDisplay: false,
|
|
|
- // addDisplay: false
|
|
|
-
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '毛利',
|
|
|
- // prop: 'grossProfit',
|
|
|
- // overHidden: true,
|
|
|
- // width: 100,
|
|
|
- // disabled: true,
|
|
|
- // editDisplay: false,
|
|
|
- // addDisplay: false
|
|
|
- // },
|
|
|
{
|
|
|
label: '备注',
|
|
|
prop: "remarks",
|
|
@@ -786,7 +725,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- components: { reportDialog, check, checkSchedule },
|
|
|
+ components: { reportDialog, check, checkSchedule, dicSelect },
|
|
|
props: {
|
|
|
onLoad: Object,
|
|
|
detailData: Object
|
|
@@ -849,11 +788,7 @@ export default {
|
|
|
if (this.onLoad.id && this.detailData.id) {
|
|
|
this.$set(this.optionForm, 'disabled', true)
|
|
|
this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
- this.isContacts = true
|
|
|
-
|
|
|
- this.isDisabled = true
|
|
|
- //添加删除按钮禁用
|
|
|
- this.isAdd = true
|
|
|
+ this.editButton = true
|
|
|
this.getDetail(this.onLoad.id, true)
|
|
|
} else if (this.onLoad.id) {
|
|
|
this.getDetail(this.onLoad.id, true)
|
|
@@ -871,6 +806,36 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ inEdit() {
|
|
|
+ if (this.form.status != 2) {
|
|
|
+ this.editButton = false
|
|
|
+ this.$set(this.optionForm, 'disabled', false)
|
|
|
+ this.$set(this.optionContactsBack, 'disabled', false)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dicChange(name, row) {
|
|
|
+ if (name == 'customerName') {
|
|
|
+ if (row) {
|
|
|
+ this.form.customerId = row.id
|
|
|
+ getCustom({ id: row.id }).then(res => {
|
|
|
+ if (res.data.data) {
|
|
|
+ this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
|
|
|
+ this.form.storageId = this.form.storageId ? 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
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.form.customerId = null
|
|
|
+ this.form.customerName = null
|
|
|
+ this.dicUrlWithCustomId = null
|
|
|
+ this.form.storageId = null
|
|
|
+ this.form.contacts = null
|
|
|
+ this.form.phone = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 一键入库
|
|
|
oneClickStorage() {
|
|
|
if (this.form.planItemsList.length == 0) {
|
|
@@ -1160,11 +1125,57 @@ export default {
|
|
|
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)
|
|
|
|
|
|
},
|
|
|
+ uploadAfter(res, done, loading, column) {
|
|
|
+ if (Array.isArray(res)) {
|
|
|
+ if (res instanceof Array) {
|
|
|
+ this.form.planItemsList = this.form.planItemsList.concat(res)
|
|
|
+ res.forEach(item => {
|
|
|
+ dotList({
|
|
|
+ storageId: this.form.storageId,
|
|
|
+ goodsId: res.goodsId
|
|
|
+ }).then(e => {
|
|
|
+ this.findObject(this.optionContactsBack.column, "dot").dicData = e.data.data
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message.error(res)
|
|
|
+ }
|
|
|
+ loading = false;
|
|
|
+ done(res);
|
|
|
+ },
|
|
|
+ derivation() {
|
|
|
+ window.open(
|
|
|
+ `${this.templateUrl}?${this.website.tokenHeader
|
|
|
+ }=${getToken()}&stockId=${this.form.storageId}`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ uploadBefore(file, done, loading) {
|
|
|
+ done();
|
|
|
+ loading = true;
|
|
|
+ },
|
|
|
+ // 销售明细 导入按钮
|
|
|
+ excelDialogfun(name) {
|
|
|
+ if (!this.form.customerId) {
|
|
|
+ this.$message.error('请选择货主')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (name == '名称') {
|
|
|
+ this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-name'
|
|
|
+ this.templateUrl = '/api/blade-sales-part/order/export-item-name'
|
|
|
+ } else if (name == 'code') {
|
|
|
+ this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/order/import-item-code'
|
|
|
+ this.templateUrl = '/api/blade-sales-part/order/export-item-code'
|
|
|
+ }
|
|
|
+ this.excelBox = true
|
|
|
+ },
|
|
|
+ approve(type) {
|
|
|
+ this.approveVisible = true
|
|
|
+ },
|
|
|
//修改提交触发
|
|
|
- editCustomer() {
|
|
|
+ editCustomer(type) {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
let picihao = false
|
|
@@ -1190,10 +1201,7 @@ export default {
|
|
|
this.form.planItemsList[i].sendNum = 0
|
|
|
}
|
|
|
}
|
|
|
- this.mingxibaocun = true
|
|
|
- if (picihao) {
|
|
|
- return
|
|
|
- }
|
|
|
+ this.form.status = type
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
text: '加载中',
|
|
@@ -1201,23 +1209,9 @@ export default {
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
this.form.storageName = this.form.$storageId ? this.form.$storageId : ''
|
|
|
- submitPlan({
|
|
|
- bsType: "RP",
|
|
|
- ...this.form
|
|
|
- }).then(res => {
|
|
|
- this.$message.success("保存成功");
|
|
|
- this.getDetail(res.data.data.id)
|
|
|
- this.isDisabledTask = false
|
|
|
- // this.editButton = true // 让编辑按钮出来
|
|
|
- // this.isDisabledTask = false;
|
|
|
- // this.viewDisabled = false;
|
|
|
- this.isAddBtn = false // 表格的添加商品禁用
|
|
|
- this.$set(this.optionForm, 'disabled', false)
|
|
|
- this.$set(this.optionContactsBack, 'disabled', false)
|
|
|
- this.isContacts = true // 基础信息联系人 和地址插槽禁用
|
|
|
- // 表格的删除按钮禁用
|
|
|
- this.isDisabled = false
|
|
|
- this.isAdd = false // 表格的编辑和保存按钮禁用
|
|
|
+ submit(this.form).then(res => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.getDetail(res.data.data)
|
|
|
loading.close();
|
|
|
}).finally(() => {
|
|
|
loading.close();
|
|
@@ -1244,35 +1238,10 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.formContacts.doLayout()
|
|
|
})
|
|
|
- if (this.form.status == '审核中') {
|
|
|
- this.isApplySettlement = false;
|
|
|
- this.isRevocationRequest = false // 撤销请核能点击
|
|
|
- }
|
|
|
- if (this.form.generateTask == '已生成') {
|
|
|
- this.buttonText = '撤销任务';
|
|
|
- this.buttonColor = 'warning'
|
|
|
- }
|
|
|
- this.optionForm.column.forEach(its => {
|
|
|
- if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('销售')) {
|
|
|
- if (its.prop == 'cost' || its.prop == 'grossProfit') {
|
|
|
- this.$set(its, 'display', false)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- this.form.planItemsList.forEach((items) => {
|
|
|
- if (!items.subTotalMoney) {
|
|
|
- items.subTotalMoney = items.goodsNum * items.price
|
|
|
- items.grossProfit = items.subTotalMoney - items.costprie
|
|
|
- }
|
|
|
- })
|
|
|
- if (res.data.data.checkStatus == '审核完成') {
|
|
|
- console.log('审核完成');
|
|
|
+ if (res.data.data.status==2) {
|
|
|
this.$set(this.optionForm, 'disabled', true)
|
|
|
this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
- this.isContacts = true
|
|
|
- this.isDisabled = true
|
|
|
- //添加删除按钮禁用
|
|
|
- this.isAdd = true
|
|
|
+ this.editButton = true
|
|
|
}
|
|
|
loading.close();
|
|
|
}).catch(() => {
|
|
@@ -1286,7 +1255,7 @@ export default {
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
if (row.id) {
|
|
|
- delOrderItem({ ids: row.id }).then(res => {
|
|
|
+ itemRemove({ ids: row.id }).then(res => {
|
|
|
this.form.planItemsList.splice(index, 1);
|
|
|
this.$message.success("操作成功!");
|
|
|
});
|
|
@@ -1326,7 +1295,7 @@ export default {
|
|
|
})
|
|
|
// 有id 的处理
|
|
|
if (itemsWithId.length != 0) {
|
|
|
- delOrderItem({ ids: arrIds.join(',') }).then(res => {
|
|
|
+ itemRemove({ ids: arrIds.join(',') }).then(res => {
|
|
|
this.$message.success("操作成功!");
|
|
|
});
|
|
|
}
|
|
@@ -1397,6 +1366,19 @@ export default {
|
|
|
backToList(type) {
|
|
|
this.$emit("backToList", type);
|
|
|
},
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ "form.planItemsList": {
|
|
|
+ // 执行方法
|
|
|
+ handler(Value, newValue) {
|
|
|
+ this.form.goodsTotalNum = 0
|
|
|
+ Value.forEach(item => {
|
|
|
+ this.form.goodsTotalNum += Number(item.goodsNum ? item.goodsNum : 0)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deep: false, // 深度监听
|
|
|
+ immediate: false // 第一次改变就执行
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -1405,4 +1387,8 @@ export default {
|
|
|
::v-deep .el-form-item {
|
|
|
margin-bottom: 8px !important;
|
|
|
}
|
|
|
+
|
|
|
+::v-deep .el-dialog__body {
|
|
|
+ padding: 10px 20px;
|
|
|
+}
|
|
|
</style>
|