|
@@ -3,301 +3,139 @@
|
|
|
<div class="customer-head">
|
|
|
<div class="customer-back">
|
|
|
<!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- style="border: none;background: none;color: red"
|
|
|
- icon="el-icon-arrow-left"
|
|
|
- @click="backToList"
|
|
|
- >返回列表
|
|
|
+ <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
|
|
|
+ @click="backToList">返回列表
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="add-customer-btn" v-if="showBut">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- v-if="detailData.status == 1"
|
|
|
- class="el-button--small-yh "
|
|
|
- :disabled="form.ifEnquiry == '询价确认'"
|
|
|
- @click.stop="openEdit"
|
|
|
- >编辑
|
|
|
+ <el-button type="primary" size="small" v-if="detailData.status == 1" class="el-button--small-yh "
|
|
|
+ :disabled="form.ifEnquiry == '询价确认'" @click.stop="openEdit">编辑
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- :disabled="form.ifEnquiry == '询价确认'"
|
|
|
- v-if="detailData.status != 1"
|
|
|
- @click="editCustomer('submit')"
|
|
|
- size="small"
|
|
|
- >提交
|
|
|
+ <el-button type="primary" :disabled="form.ifEnquiry == '询价确认'" v-if="detailData.status != 1"
|
|
|
+ @click="editCustomer('submit')" size="small">提交
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- :disabled="!form.id"
|
|
|
- size="small"
|
|
|
- @click="copyDoc"
|
|
|
- >复制单据</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- :disabled="form.ifEnquiry == '询价确认'"
|
|
|
- @click="editCustomer('save')"
|
|
|
- :loading="subLoading"
|
|
|
- v-if="detailData.status != 1"
|
|
|
- size="small"
|
|
|
- >保存数据
|
|
|
+ <el-button type="success" :disabled="!form.id" size="small" @click="copyDoc">复制单据</el-button>
|
|
|
+ <el-button type="primary" :disabled="form.ifEnquiry == '询价确认'" @click="editCustomer('save')"
|
|
|
+ :loading="subLoading" v-if="detailData.status != 1" size="small">保存数据
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="customer-main">
|
|
|
<trade-card title="基础信息">
|
|
|
- <avue-form
|
|
|
- ref="form"
|
|
|
- class="trading-form"
|
|
|
- v-model="form"
|
|
|
- :option="option"
|
|
|
- >
|
|
|
+ <avue-form ref="form" class="trading-form" v-model="form" :option="option">
|
|
|
<template slot="corpId">
|
|
|
- <crop-select
|
|
|
- v-model="form.corpId"
|
|
|
- corpType="KH"
|
|
|
- :disabled="detailData.status == 1 || form.ifEnquiry == '询价确认'"
|
|
|
- ></crop-select>
|
|
|
+ <crop-select v-model="form.corpId" corpType="KH"
|
|
|
+ :disabled="detailData.status == 1 || form.ifEnquiry == '询价确认'"></crop-select>
|
|
|
</template>
|
|
|
<template slot="dateValidity">
|
|
|
- <el-date-picker
|
|
|
- format="yyyy-MM-dd"
|
|
|
- value-format="yyyy-MM-dd 00:00:00"
|
|
|
- v-model="form.dateValidity"
|
|
|
- type="date"
|
|
|
- placeholder="选择日期"
|
|
|
- :disabled="detailData.status == 1"
|
|
|
- :picker-options="pickerOptions"
|
|
|
- ></el-date-picker>
|
|
|
+ <el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd 00:00:00" v-model="form.dateValidity"
|
|
|
+ type="date" placeholder="选择日期" :disabled="detailData.status == 1" :picker-options="pickerOptions">
|
|
|
+ </el-date-picker>
|
|
|
</template>
|
|
|
</avue-form>
|
|
|
</trade-card>
|
|
|
<trade-card title="商品信息">
|
|
|
- <avue-crud
|
|
|
- ref="crud"
|
|
|
- :data="data"
|
|
|
- :option="tableOption"
|
|
|
- @row-del="rowDel"
|
|
|
- @saveColumn="saveColumn"
|
|
|
- @resetColumn="resetColumn"
|
|
|
- :summary-method="summaryMethod"
|
|
|
- :cell-style="cellStyle"
|
|
|
- >
|
|
|
+ <avue-crud ref="crud" :data="data" :option="tableOption" @row-del="rowDel" @saveColumn="saveColumn"
|
|
|
+ @resetColumn="resetColumn" :summary-method="summaryMethod" :cell-style="cellStyle">
|
|
|
<template slot="cname" slot-scope="{ row, index }">
|
|
|
<span v-if="row.$cellEdit" style="display:flex">
|
|
|
- <el-select
|
|
|
- v-model="row.cname"
|
|
|
- placeholder="请选择"
|
|
|
- size="small"
|
|
|
- style="width:60%"
|
|
|
- @change="cnameChange(row, index)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in goodsoptions"
|
|
|
- :key="item.id"
|
|
|
- :label="item.cname"
|
|
|
- :value="item.cname"
|
|
|
- >
|
|
|
+ <el-select v-model="row.cname" placeholder="请选择" size="small" style="width:60%"
|
|
|
+ @change="cnameChange(row, index)">
|
|
|
+ <el-option v-for="item in goodsoptions" :key="item.id" :label="item.cname" :value="item.cname">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <el-button
|
|
|
- icon="el-icon-search"
|
|
|
- size="mini"
|
|
|
- @click="rePick(row, index)"
|
|
|
- ></el-button>
|
|
|
+ <el-button icon="el-icon-search" size="mini" @click="rePick(row, index)"></el-button>
|
|
|
</span>
|
|
|
|
|
|
<span v-else> {{ row.cname }}</span>
|
|
|
</template>
|
|
|
<template slot="price" slot-scope="{ row }">
|
|
|
- <el-input
|
|
|
- v-if="row.$cellEdit"
|
|
|
- v-model="row.price"
|
|
|
- size="small"
|
|
|
+ <el-input v-if="row.$cellEdit" v-model="row.price" size="small"
|
|
|
oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
|
|
- @change="priceChange(row)"
|
|
|
- ></el-input>
|
|
|
+ @change="priceChange(row)"></el-input>
|
|
|
<span v-else>{{ row.price }}</span>
|
|
|
</template>
|
|
|
<template slot="taxRate" slot-scope="{ row }">
|
|
|
- <el-input
|
|
|
- v-if="row.$cellEdit"
|
|
|
- v-model="row.taxRate"
|
|
|
- size="small"
|
|
|
+ <el-input v-if="row.$cellEdit" v-model="row.taxRate" size="small"
|
|
|
oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
|
|
- @change="priceChange(row)"
|
|
|
- ></el-input>
|
|
|
+ @change="priceChange(row)"></el-input>
|
|
|
<span v-else>{{ row.taxRate ? row.taxRate : 0 }}%</span>
|
|
|
</template>
|
|
|
<template slot="coefficient" slot-scope="{ row }">
|
|
|
- <el-input
|
|
|
- v-if="row.$cellEdit"
|
|
|
- v-model="row.coefficient"
|
|
|
- size="small"
|
|
|
+ <el-input v-if="row.$cellEdit" v-model="row.coefficient" size="small"
|
|
|
oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
|
|
- @change="priceChange(row)"
|
|
|
- ></el-input>
|
|
|
+ @change="priceChange(row)"></el-input>
|
|
|
<span v-else>{{ row.coefficient ? row.coefficient : 0 }}%</span>
|
|
|
</template>
|
|
|
<template slot="orderQuantity" slot-scope="{ row }">
|
|
|
- <el-input
|
|
|
- v-if="row.$cellEdit"
|
|
|
- v-model="row.orderQuantity"
|
|
|
- size="small"
|
|
|
- oninput='this.value=this.value.replace(/[^(\d)]/g,"")'
|
|
|
- @change="quantityChange(row)"
|
|
|
- ></el-input>
|
|
|
+ <el-input v-if="row.$cellEdit" v-model="row.orderQuantity" size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d)]/g,"")' @change="quantityChange(row)"></el-input>
|
|
|
<span v-else>{{ row.orderQuantity | IntegerFormat }}</span>
|
|
|
</template>
|
|
|
<template slot="itemType" slot-scope="{ row }">
|
|
|
- <el-select
|
|
|
- v-if="row.$cellEdit"
|
|
|
- v-model="row.itemType"
|
|
|
- filterable
|
|
|
- allow-create
|
|
|
- default-first-option
|
|
|
- placeholder="请输入"
|
|
|
- size="small"
|
|
|
- @focus="itemTypeFocus(row)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in itemtypeList"
|
|
|
- :key="index"
|
|
|
- :label="item.value"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
+ <el-select v-if="row.$cellEdit" v-model="row.itemType" filterable allow-create default-first-option
|
|
|
+ placeholder="请输入" size="small" @focus="itemTypeFocus(row)">
|
|
|
+ <el-option v-for="(item, index) in itemtypeList" :key="index" :label="item.value" :value="item.value">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
<span v-else>{{ row.itemType }}</span>
|
|
|
</template>
|
|
|
<template slot="priorityReferrer" slot-scope="{ row }">
|
|
|
- <el-checkbox
|
|
|
- :disabled="!row.$cellEdit"
|
|
|
- v-model="row.priorityReferrer"
|
|
|
- :true-label="1"
|
|
|
- :false-label="0"
|
|
|
- />
|
|
|
+ <el-checkbox :disabled="!row.$cellEdit" v-model="row.priorityReferrer" :true-label="1" :false-label="0" />
|
|
|
</template>
|
|
|
<template slot="corpId" slot-scope="{ row, index }">
|
|
|
- <crop-select
|
|
|
- v-show="row.$cellEdit"
|
|
|
- v-model="row.corpId"
|
|
|
- :cropIndex="index"
|
|
|
- @getCorpData="rowCorpData"
|
|
|
- gysType="CK"
|
|
|
- corpType="GYS"
|
|
|
- ></crop-select>
|
|
|
+ <crop-select v-show="row.$cellEdit" v-model="row.corpId" :cropIndex="index" @getCorpData="rowCorpData"
|
|
|
+ gysType="CK" corpType="GYS"></crop-select>
|
|
|
<span v-show="!row.$cellEdit">{{ row.corpName }}</span>
|
|
|
</template>
|
|
|
<template slot="purchaseAmount" slot-scope="{ row }">
|
|
|
<span>{{ row.purchaseAmount | micrometerFormat }}</span>
|
|
|
</template>
|
|
|
<template slot="menuLeft">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- size="small"
|
|
|
- @click.stop="newDetails"
|
|
|
- :disabled="detailData.status == 1 || form.ifEnquiry == '询价确认'"
|
|
|
- >录入明细</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="info"
|
|
|
- icon="el-icon-printer"
|
|
|
- size="small"
|
|
|
- @click.stop="openReport()"
|
|
|
- >报表打印</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newDetails"
|
|
|
+ :disabled="detailData.status == 1 || form.ifEnquiry == '询价确认'">录入明细</el-button>
|
|
|
+ <el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印</el-button>
|
|
|
</template>
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- icon="el-icon-edit"
|
|
|
- type="text"
|
|
|
- @click="rowCell(row, index)"
|
|
|
- :disabled="detailData.status == 1 || form.ifEnquiry == '询价确认'"
|
|
|
- >{{ row.$cellEdit ? "保存" : "修改" }}</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- icon="el-icon-edit"
|
|
|
- type="text"
|
|
|
- @click="rowDel(row)"
|
|
|
- :disabled="detailData.status == 1 || form.ifEnquiry == '询价确认'"
|
|
|
- >删 除</el-button
|
|
|
- >
|
|
|
+ <el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)"
|
|
|
+ :disabled="detailData.status == 1 || form.ifEnquiry == '询价确认'">{{ row.$cellEdit ? "保存" : "修改" }}
|
|
|
+ </el-button>
|
|
|
+ <el-button size="small" icon="el-icon-edit" type="text" @click="rowDel(row)"
|
|
|
+ :disabled="detailData.status == 1 || form.ifEnquiry == '询价确认'">删 除</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</trade-card>
|
|
|
</div>
|
|
|
- <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"
|
|
|
- top="5vh"
|
|
|
- v-dialog-drag
|
|
|
- >
|
|
|
+ <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"
|
|
|
+ top="5vh" v-dialog-drag>
|
|
|
<span>
|
|
|
<el-row>
|
|
|
<el-col :span="4">
|
|
|
<div>
|
|
|
<el-scrollbar>
|
|
|
<basic-container>
|
|
|
- <avue-tree
|
|
|
- :option="treeOption"
|
|
|
- @node-click="nodeClick"
|
|
|
- :style="treeStyle"
|
|
|
- />
|
|
|
+ <avue-tree :option="treeOption" @node-click="nodeClick" :style="treeStyle" />
|
|
|
</basic-container>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="20">
|
|
|
- <avue-crud
|
|
|
- :option="goodsOption"
|
|
|
- :table-loading="loading"
|
|
|
- :data="goodsList"
|
|
|
- ref="goodsCrud"
|
|
|
- :search.sync="search"
|
|
|
- @search-change="searchChange"
|
|
|
- @refresh-change="refreshChange"
|
|
|
- @selection-change="selectionChange"
|
|
|
- @row-click="rowClick"
|
|
|
- :page.sync="page"
|
|
|
- @on-load="onLoad"
|
|
|
- @saveColumn="saveGoodsColumn"
|
|
|
- @resetColumn="resetGoodsColumn"
|
|
|
- :cell-style="cellStyle"
|
|
|
- ></avue-crud>
|
|
|
+ <avue-crud :option="goodsOption" :table-loading="loading" :data="goodsList" ref="goodsCrud"
|
|
|
+ :search.sync="search" @search-change="searchChange" @refresh-change="refreshChange"
|
|
|
+ @selection-change="selectionChange" @row-click="rowClick" :page.sync="page" @on-load="onLoad"
|
|
|
+ @saveColumn="saveGoodsColumn" @resetColumn="resetGoodsColumn" :cell-style="cellStyle"></avue-crud>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</span>
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="importGoods"
|
|
|
- :disabled="selectionList.length == 0"
|
|
|
- >导入</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="importGoods" :disabled="selectionList.length == 0">导入</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
- <report-dialog
|
|
|
- :switchDialog="switchDialog"
|
|
|
- :reportId="form.id"
|
|
|
- reportName="客户询价"
|
|
|
- @onClose="onClose()"
|
|
|
- ></report-dialog>
|
|
|
+ <report-dialog :switchDialog="switchDialog" :reportId="form.id" reportName="客户询价" @onClose="onClose()">
|
|
|
+ </report-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -441,7 +279,7 @@ export default {
|
|
|
treeOption: {
|
|
|
nodeKey: "id",
|
|
|
lazy: true,
|
|
|
- treeLoad: function(node, resolve) {
|
|
|
+ treeLoad: function (node, resolve) {
|
|
|
const parentId = node.level === 0 ? 0 : node.data.id;
|
|
|
getDeptLazyTree(parentId).then(res => {
|
|
|
resolve(
|
|
@@ -827,7 +665,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ this.data.forEach((e, index) => {
|
|
|
+ e.sort = Number(index) + 1
|
|
|
+ })
|
|
|
if (status == "save") {
|
|
|
this.subLoading = true;
|
|
|
submit({
|
|
@@ -1053,9 +893,11 @@ export default {
|
|
|
.trading-form ::v-deep .el-form-item {
|
|
|
margin-bottom: 8px !important;
|
|
|
}
|
|
|
+
|
|
|
::v-deep .el-form-item__error {
|
|
|
display: none !important;
|
|
|
}
|
|
|
+
|
|
|
::v-deep .select-component {
|
|
|
display: flex !important;
|
|
|
}
|