|
|
@@ -2,16 +2,14 @@
|
|
|
<div class="borderless">
|
|
|
<div class="customer-head">
|
|
|
<div class="customer-back">
|
|
|
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
|
|
|
- @click="backToList">返回列表
|
|
|
- </el-button>
|
|
|
+ <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">
|
|
|
<el-button type="success" :disabled="!form.id" size="small" @click="copyDoc">
|
|
|
复制单据
|
|
|
</el-button>
|
|
|
- <el-button class="el-button--small-yh" type="primary" :disabled="disabled" size="small" @click="editCustomer">{{
|
|
|
- form.id ? "确认修改" : "确认新增" }}
|
|
|
+ <el-button class="el-button--small-yh" type="primary" :disabled="disabled" size="small" @click="editCustomer"
|
|
|
+ >{{ form.id ? "确认修改" : "确认新增" }}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -22,29 +20,60 @@
|
|
|
<el-row>
|
|
|
<el-col v-for="(item, index) in basicData.column" :key="index" :span="item.span ? item.span : 6">
|
|
|
<el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
|
|
|
- <avue-input-tree v-if="item.prop === 'goodsTypeId'" leaf-only multiple style="width: 100%;"
|
|
|
- :props="{ label: 'title' }" v-model="form[item.prop]" placeholder=" " type="tree" size="small"
|
|
|
- dataType="string" :dic="dicData" tags/>
|
|
|
+ <avue-input-tree
|
|
|
+ v-if="item.prop === 'goodsTypeId'"
|
|
|
+ leaf-only
|
|
|
+ multiple
|
|
|
+ style="width: 100%;"
|
|
|
+ :props="{ label: 'title' }"
|
|
|
+ v-model="form[item.prop]"
|
|
|
+ placeholder=" "
|
|
|
+ type="tree"
|
|
|
+ size="small"
|
|
|
+ dataType="string"
|
|
|
+ :dic="dicData"
|
|
|
+ tags
|
|
|
+ />
|
|
|
|
|
|
- <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model="form[item.prop]" size="small"
|
|
|
- autocomplete="off" placeholder=" "></el-input>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ v-else-if="item.type === 'textarea'"
|
|
|
+ v-model="form[item.prop]"
|
|
|
+ size="small"
|
|
|
+ autocomplete="off"
|
|
|
+ placeholder=" "
|
|
|
+ ></el-input>
|
|
|
|
|
|
- <el-select v-else-if="item.type === 'select'" style="width: 100%" v-model="form[item.prop]" size="small"
|
|
|
- placeholder="请选择" clearable filterable>
|
|
|
+ <el-select
|
|
|
+ v-else-if="item.type === 'select'"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form[item.prop]"
|
|
|
+ size="small"
|
|
|
+ placeholder="请选择"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ >
|
|
|
<!-- <el-option v-for="(item,index) in selectData" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>-->
|
|
|
</el-select>
|
|
|
|
|
|
- <el-select v-model="form[item.prop]" style="width: 300px;" size="medium" v-else-if="item.prop === 'supervisorUserIdList'" multiple placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in userList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
+ <el-select
|
|
|
+ v-model="form[item.prop]"
|
|
|
+ style="width: 300px;"
|
|
|
+ size="medium"
|
|
|
+ v-else-if="item.prop === 'supervisorUserIdList'"
|
|
|
+ multiple
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
|
|
|
</el-select>
|
|
|
|
|
|
- <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]"
|
|
|
- :configuration="configuration" typeData="GYS" style="width: 100%" />
|
|
|
+ <selectComponent
|
|
|
+ v-else-if="item.prop === 'corpId'"
|
|
|
+ v-model="form[item.prop]"
|
|
|
+ :configuration="configuration"
|
|
|
+ typeData="GYS"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
<el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -55,10 +84,23 @@
|
|
|
<el-row>
|
|
|
<el-col v-for="(item, index) in packingData.column" :key="index" :span="item.span ? item.span : 6">
|
|
|
<el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
|
|
|
- <el-input type="textarea" v-if="item.type === 'textarea'" v-model="form[item.prop]" size="small"
|
|
|
- autocomplete="off" placeholder=" "></el-input>
|
|
|
- <el-select v-else-if="item.type === 'select'" style="width: 100%" v-model="form[item.prop]" size="small"
|
|
|
- placeholder="请选择" clearable filterable>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ v-if="item.type === 'textarea'"
|
|
|
+ v-model="form[item.prop]"
|
|
|
+ size="small"
|
|
|
+ autocomplete="off"
|
|
|
+ placeholder=" "
|
|
|
+ ></el-input>
|
|
|
+ <el-select
|
|
|
+ v-else-if="item.type === 'select'"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form[item.prop]"
|
|
|
+ size="small"
|
|
|
+ placeholder="请选择"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ >
|
|
|
<!-- <el-option v-for="(item,index) in selectData" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>-->
|
|
|
</el-select>
|
|
|
<el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off"></el-input>
|
|
|
@@ -97,24 +139,19 @@
|
|
|
<basic-container>
|
|
|
<avue-crud :data="sftData" :option="sftOption" @row-del="rowSftDel">
|
|
|
<template slot="menuLeft" slot-scope="{ row, index }">
|
|
|
- <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addSftRow(row, index)">新增明细
|
|
|
- </el-button>
|
|
|
- <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addSftRow2(row, index)">默认模板
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addSftRow(row, index)">新增明细 </el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addSftRow2(row, index)">默认模板 </el-button>
|
|
|
</template>
|
|
|
<template slot="attributeName" slot-scope="{ row, index }">
|
|
|
<span v-if="row.$cellEdit">
|
|
|
<el-select v-model="row.attributeName" placeholder="请选择" size="small" @change="cnameChange(row)">
|
|
|
- <el-option v-for="item in goodsProps" :key="item.id" :label="item.dictValue" :value="item.dictValue">
|
|
|
- </el-option>
|
|
|
+ <el-option v-for="item in goodsProps" :key="item.id" :label="item.dictValue" :value="item.dictValue"> </el-option>
|
|
|
</el-select>
|
|
|
</span>
|
|
|
<span v-else> {{ row.attributeName }}</span>
|
|
|
</template>
|
|
|
<template slot="status" slot-scope="{ row, index }">
|
|
|
- <el-switch v-model="row.status" active-color="#13ce66" inactive-color="#ff4949" :active-value="0"
|
|
|
- :inactive-value="1">
|
|
|
- </el-switch>
|
|
|
+ <el-switch v-model="row.status" active-color="#13ce66" inactive-color="#ff4949" :active-value="0" :inactive-value="1"> </el-switch>
|
|
|
</template>
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
<el-button size="small" icon="el-icon-edit" type="text" @click.stop="rowSftEdit(row, index)">
|
|
|
@@ -128,60 +165,68 @@
|
|
|
</basic-container>
|
|
|
<containerTitle title="配件信息"></containerTitle>
|
|
|
<basic-container style="margin-bottom: 10px">
|
|
|
- <avue-crud ref="crud" :data="partList" :option="partOption" @saveColumn="partsaveColumn"
|
|
|
- :cell-style="cellStyle">
|
|
|
+ <avue-crud ref="crud" :data="partList" :option="partOption" @saveColumn="partsaveColumn" :cell-style="cellStyle">
|
|
|
<template slot="menuLeft">
|
|
|
- <el-button type="primary" :disabled="partList.length>0" size="small" @click.stop="rowAdd">默认模板</el-button>
|
|
|
+ <el-button type="primary" :disabled="partList.length > 0" size="small" @click.stop="rowAdd">默认模板</el-button>
|
|
|
</template>
|
|
|
<template slot="status" slot-scope="{ row, index }">
|
|
|
- <el-switch v-model="row.status" active-color="#13ce66" inactive-color="#ff4949" :active-value="0"
|
|
|
- :inactive-value="1">
|
|
|
- </el-switch>
|
|
|
+ <el-switch v-model="row.status" active-color="#13ce66" inactive-color="#ff4949" :active-value="0" :inactive-value="1"> </el-switch>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
<containerTitle title="销售价格"></containerTitle>
|
|
|
<basic-container style="margin-bottom: 10px">
|
|
|
- <avue-crud :option="customerContact" v-model="contactsForm" :data="contactsData" ref="crudContact"
|
|
|
- @row-save="rowContactSave" @row-del="rowContactsDel">
|
|
|
+ <avue-crud
|
|
|
+ :option="customerContact"
|
|
|
+ v-model="contactsForm"
|
|
|
+ :data="contactsData"
|
|
|
+ ref="crudContact"
|
|
|
+ @row-save="rowContactSave"
|
|
|
+ @row-del="rowContactsDel"
|
|
|
+ >
|
|
|
<template slot-scope="{ row, index }" slot="menu">
|
|
|
- <el-button type="text" size="small" @click="rowContactCell(row, index)">{{ row.$cellEdit ? "修改完成" : "修改"
|
|
|
- }}
|
|
|
- </el-button>
|
|
|
+ <el-button type="text" size="small" @click="rowContactCell(row, index)">{{ row.$cellEdit ? "修改完成" : "修改" }} </el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
<containerTitle title="采购价格"></containerTitle>
|
|
|
<basic-container style="margin-bottom: 10px">
|
|
|
- <avue-crud :option="customerPurchase" v-model="contactsForm" :data="purchaseData" ref="crudPurchase"
|
|
|
- @row-save="rowPurchaseSave" @row-del="rowPurchaseDel">
|
|
|
+ <avue-crud
|
|
|
+ :option="customerPurchase"
|
|
|
+ v-model="contactsForm"
|
|
|
+ :data="purchaseData"
|
|
|
+ ref="crudPurchase"
|
|
|
+ @row-save="rowPurchaseSave"
|
|
|
+ @row-del="rowPurchaseDel"
|
|
|
+ >
|
|
|
<template slot="corpId" slot-scope="{ row }">
|
|
|
<span v-if="row.$cellEdit" style="float: left;color: #F56C6C;">*</span>
|
|
|
- <span style="margin-left: 12px;padding-top: 2px">{{
|
|
|
- row.corpName
|
|
|
- }}</span>
|
|
|
- <el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="selectUser(row)">选择
|
|
|
- </el-button>
|
|
|
+ <span style="margin-left: 12px;padding-top: 2px">{{ row.corpName }}</span>
|
|
|
+ <el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="selectUser(row)">选择 </el-button>
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="menu">
|
|
|
- <el-button type="text" size="small" @click="rowPurchaseCell(row, index)">{{ row.$cellEdit ? "修改完成" : "修改"
|
|
|
- }}
|
|
|
- </el-button>
|
|
|
+ <el-button type="text" size="small" @click="rowPurchaseCell(row, index)">{{ row.$cellEdit ? "修改完成" : "修改" }} </el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
<containerTitle title="商品图片"></containerTitle>
|
|
|
<basic-container style="margin-bottom: 10px">
|
|
|
- <avue-crud ref="imgUpload" :option="imgUploadList" :data="imgUploadData" @row-save="imgUploadSave"
|
|
|
- @row-update="imgUploadUpdate" @row-del="imgUploadDel" :upload-before="uploadBefore"></avue-crud>
|
|
|
+ <avue-crud
|
|
|
+ ref="imgUpload"
|
|
|
+ :option="imgUploadList"
|
|
|
+ :data="imgUploadData"
|
|
|
+ @row-save="imgUploadSave"
|
|
|
+ @row-update="imgUploadUpdate"
|
|
|
+ @row-del="imgUploadDel"
|
|
|
+ :upload-before="uploadBefore"
|
|
|
+ ></avue-crud>
|
|
|
</basic-container>
|
|
|
<containerTitle title="详情页编辑"></containerTitle>
|
|
|
<basic-container style="margin-bottom: 10px">
|
|
|
<avue-ueditor v-model="text" :options="options"></avue-ueditor>
|
|
|
</basic-container>
|
|
|
</el-form>
|
|
|
- <el-dialog title="导入供应商" :visible.sync="userDialog" class="el-dialogDeep" append-to-body
|
|
|
- :close-on-click-modal="false" width="80%">
|
|
|
+ <el-dialog title="导入供应商" :visible.sync="userDialog" class="el-dialogDeep" append-to-body :close-on-click-modal="false" width="80%">
|
|
|
<el-row style="margin-top: -5px;height: 0">
|
|
|
<el-col :span="5">
|
|
|
<div class="box">
|
|
|
@@ -194,18 +239,26 @@
|
|
|
</el-col>
|
|
|
<el-col :span="19">
|
|
|
<basic-container>
|
|
|
- <avue-crud ref="userCrud" :option="userOption" :data="userDataList" :table-loading="userLoading"
|
|
|
- :page.sync="userPage" v-model="userForm" @search-change="userSearchChange"
|
|
|
- @search-reset="userSearchReset" @refresh-change="userRefreshChange"
|
|
|
- @selection-change="userSelectionChange" @on-load="userOnLoad">
|
|
|
+ <avue-crud
|
|
|
+ ref="userCrud"
|
|
|
+ :option="userOption"
|
|
|
+ :data="userDataList"
|
|
|
+ :table-loading="userLoading"
|
|
|
+ :page.sync="userPage"
|
|
|
+ v-model="userForm"
|
|
|
+ @search-change="userSearchChange"
|
|
|
+ @search-reset="userSearchReset"
|
|
|
+ @refresh-change="userRefreshChange"
|
|
|
+ @selection-change="userSelectionChange"
|
|
|
+ @on-load="userOnLoad"
|
|
|
+ >
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="userDialog = false">取 消</el-button>
|
|
|
- <el-button type="primary" :disabled="this.userSelection.length == 1 ? false : true" @click="userConfirm">确 定
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" :disabled="this.userSelection.length == 1 ? false : true" @click="userConfirm">确 定 </el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -217,16 +270,8 @@ import customerContact from "./configuration/customerContact.json";
|
|
|
import customerPurchase from "./configuration/customerPurchase.json";
|
|
|
import { detail, corpsattn, typeSave } from "@/api/maintenance/priceManagement";
|
|
|
import imgUploadList from "./configuration/imgUploadList.json";
|
|
|
-import {
|
|
|
- getDetail,
|
|
|
- updateDetail,
|
|
|
- getDeptTree,
|
|
|
- priceDelete
|
|
|
-} from "@/api/basicData/commodityType";
|
|
|
-import {
|
|
|
- customerList,
|
|
|
- getDeptLazyTree
|
|
|
-} from "@/api/basicData/customerInformation";
|
|
|
+import { getDetail, updateDetail, getDeptTree, priceDelete } from "@/api/basicData/commodityType";
|
|
|
+import { customerList, getDeptLazyTree } from "@/api/basicData/customerInformation";
|
|
|
import userOption from "../customerInformation/configuration/mainList.json";
|
|
|
import sftOption from "./configuration/specification.json";
|
|
|
import { mapGetters } from "vuex";
|
|
|
@@ -414,10 +459,10 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- label: '分管员',
|
|
|
- prop: 'supervisorUserIdList',
|
|
|
- multiple:true,
|
|
|
- dicData: [],
|
|
|
+ label: "分管员",
|
|
|
+ prop: "supervisorUserIdList",
|
|
|
+ multiple: true,
|
|
|
+ dicData: []
|
|
|
},
|
|
|
{
|
|
|
label: "HS代码",
|
|
|
@@ -658,7 +703,7 @@ export default {
|
|
|
userTreeOption: {
|
|
|
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(
|
|
|
@@ -693,7 +738,7 @@ export default {
|
|
|
total: 0,
|
|
|
pageSize: 10
|
|
|
},
|
|
|
- userList: [],
|
|
|
+ userList: []
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
|
@@ -768,9 +813,9 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- console.log(res.data.data.supervisorUserIdGroup)
|
|
|
- if (res.data.data.supervisorUserIdGroup != null && res.data.data.supervisorUserIdGroup != '') {
|
|
|
- res.data.data.supervisorUserIdList = res.data.data.supervisorUserIdGroup.split(',')
|
|
|
+ console.log(res.data.data.supervisorUserIdGroup);
|
|
|
+ if (res.data.data.supervisorUserIdGroup != null && res.data.data.supervisorUserIdGroup != "") {
|
|
|
+ res.data.data.supervisorUserIdList = res.data.data.supervisorUserIdGroup.split(",");
|
|
|
}
|
|
|
|
|
|
this.form = res.data.data;
|
|
|
@@ -780,17 +825,16 @@ export default {
|
|
|
if (res.data.data.buyGoodsPrice) {
|
|
|
this.purchaseData = res.data.data.buyGoodsPrice;
|
|
|
}
|
|
|
- this.sftData = this.form.goodsSpecificationList
|
|
|
- ? this.form.goodsSpecificationList.filter(e => e.type == 0)
|
|
|
- : [];
|
|
|
- this.partList = this.form.goodsSpecificationList
|
|
|
- ? this.form.goodsSpecificationList.filter(e => e.type == 1)
|
|
|
- : [];
|
|
|
+ this.sftData = this.form.goodsSpecificationList ? this.form.goodsSpecificationList.filter(e => e.type == 0) : [];
|
|
|
+ this.partList = this.form.goodsSpecificationList ? this.form.goodsSpecificationList.filter(e => e.type == 1) : [];
|
|
|
});
|
|
|
}
|
|
|
this.propertyOption = await this.getColumnData(this.getColumnName(52), this.propertyOption);
|
|
|
if (!this.permission.goods_gys) {
|
|
|
- this.basicData.column.splice(this.basicData.column.findIndex(item => item.prop == 'corpId'), 1)
|
|
|
+ this.basicData.column.splice(
|
|
|
+ this.basicData.column.findIndex(item => item.prop == "corpId"),
|
|
|
+ 1
|
|
|
+ );
|
|
|
}
|
|
|
this.getWorkDicts("goods_Props").then(res => {
|
|
|
this.goodsProps = res.data.data;
|
|
|
@@ -814,38 +858,43 @@ export default {
|
|
|
this.sftData.push({
|
|
|
type: 0,
|
|
|
status: 1,
|
|
|
- $cellEdit: true,
|
|
|
+ $cellEdit: true
|
|
|
});
|
|
|
},
|
|
|
addSftRow2() {
|
|
|
- if(this.sftData.length>0){
|
|
|
- return this.$message.error('配置信息已存在数据,暂不能生成模板')
|
|
|
+ if (this.sftData.length > 0) {
|
|
|
+ return this.$message.error("配置信息已存在数据,暂不能生成模板");
|
|
|
}
|
|
|
- this.sftData.push({
|
|
|
- type: 0,
|
|
|
- attributeName: '螺纹',
|
|
|
- attributeNo: 'Thread',
|
|
|
- status: 1,
|
|
|
- $cellEdit: true,
|
|
|
- }, {
|
|
|
- type: 0,
|
|
|
- attributeName: '介质',
|
|
|
- attributeNo: 'medium',
|
|
|
- status: 1,
|
|
|
- $cellEdit: true,
|
|
|
- }, {
|
|
|
- type: 0,
|
|
|
- attributeName: '颜色',
|
|
|
- attributeNo: 'property_color',
|
|
|
- status: 1,
|
|
|
- $cellEdit: true,
|
|
|
- }, {
|
|
|
- type: 0,
|
|
|
- attributeName: '电压',
|
|
|
- attributeNo: 'stencil',
|
|
|
- status: 1,
|
|
|
- $cellEdit: true,
|
|
|
- });
|
|
|
+ this.sftData.push(
|
|
|
+ {
|
|
|
+ type: 0,
|
|
|
+ attributeName: "螺纹",
|
|
|
+ attributeNo: "Thread",
|
|
|
+ status: 1,
|
|
|
+ $cellEdit: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 0,
|
|
|
+ attributeName: "介质",
|
|
|
+ attributeNo: "medium",
|
|
|
+ status: 1,
|
|
|
+ $cellEdit: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 0,
|
|
|
+ attributeName: "颜色",
|
|
|
+ attributeNo: "property_color",
|
|
|
+ status: 1,
|
|
|
+ $cellEdit: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 0,
|
|
|
+ attributeName: "电压",
|
|
|
+ attributeNo: "stencil",
|
|
|
+ status: 1,
|
|
|
+ $cellEdit: true
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
rowContactSave(row, done, loading) {
|
|
|
done();
|
|
|
@@ -907,14 +956,14 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
rowSftDel(row) {
|
|
|
- console.log(row)
|
|
|
+ console.log(row);
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
if (row.id) {
|
|
|
- console.log('待开发')
|
|
|
+ console.log("待开发");
|
|
|
// priceDelete(row.id).then(res => {
|
|
|
// this.$message({
|
|
|
// type: "success",
|
|
|
@@ -965,39 +1014,40 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.sftData.forEach((e, index) => {
|
|
|
- e.sort = Number(index + 1)
|
|
|
- })
|
|
|
+ e.sort = Number(index + 1);
|
|
|
+ });
|
|
|
this.partList.forEach((e, index) => {
|
|
|
- e.sort = Number(index + 1)
|
|
|
- })
|
|
|
+ e.sort = Number(index + 1);
|
|
|
+ });
|
|
|
|
|
|
- var userName = null
|
|
|
+ var userName = null;
|
|
|
if (this.form.supervisorUserIdList != null) {
|
|
|
- userName = ''
|
|
|
+ userName = "";
|
|
|
for (const userId of this.form.supervisorUserIdList) {
|
|
|
for (const user of this.userList) {
|
|
|
if (user.id == userId) {
|
|
|
- userName += user.name + ','
|
|
|
+ userName += user.name + ",";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
userName = userName.substring(0, userName.length - 1);
|
|
|
}
|
|
|
- this.form.singleVolumn = this.form.singleVolumn?this.form.singleVolumn:0
|
|
|
- this.form.singleGrossWeight = this.form.singleGrossWeight?this.form.singleGrossWeight:0
|
|
|
- this.form.singleWeight = this.form.singleWeight?this.form.singleWeight:0
|
|
|
- this.form.cntrVolumn = this.form.cntrVolumn?this.form.cntrVolumn:0
|
|
|
- this.form.cntrGrossWeight = this.form.cntrGrossWeight?this.form.cntrGrossWeight:0
|
|
|
- this.form.cntrWeight = this.form.cntrWeight?this.form.cntrWeight:0
|
|
|
- this.form.ctn = this.form.ctn?this.form.ctn:0
|
|
|
+ this.form.singleVolumn = this.form.singleVolumn ? this.form.singleVolumn : 0;
|
|
|
+ this.form.singleGrossWeight = this.form.singleGrossWeight ? this.form.singleGrossWeight : 0;
|
|
|
+ this.form.singleWeight = this.form.singleWeight ? this.form.singleWeight : 0;
|
|
|
+ this.form.cntrVolumn = this.form.cntrVolumn ? this.form.cntrVolumn : 0;
|
|
|
+ this.form.cntrGrossWeight = this.form.cntrGrossWeight ? this.form.cntrGrossWeight : 0;
|
|
|
+ this.form.cntrWeight = this.form.cntrWeight ? this.form.cntrWeight : 0;
|
|
|
+ this.form.ctn = this.form.ctn ? this.form.ctn : 0;
|
|
|
const params = {
|
|
|
...this.form,
|
|
|
type: 0,
|
|
|
saleGoodsPrice: this.contactsData,
|
|
|
buyGoodsPrice: this.purchaseData,
|
|
|
- supervisorUserIdGroup: this.form.supervisorUserIdList == null || this.form.supervisorUserIdList == [] ? '' : this.form.supervisorUserIdList.toString(),
|
|
|
+ supervisorUserIdGroup:
|
|
|
+ this.form.supervisorUserIdList == null || this.form.supervisorUserIdList == [] ? "" : this.form.supervisorUserIdList.toString(),
|
|
|
supervisorUserNameGroup: userName,
|
|
|
- goodsSpecificationList: this.sftData.concat(this.partList),
|
|
|
+ goodsSpecificationList: this.sftData.concat(this.partList)
|
|
|
};
|
|
|
updateDetail(params).then(res => {
|
|
|
this.$message({
|
|
|
@@ -1019,7 +1069,7 @@ export default {
|
|
|
this.userOnLoad(this.userPage, params);
|
|
|
done();
|
|
|
},
|
|
|
- userSearchReset() { },
|
|
|
+ userSearchReset() {},
|
|
|
userRefreshChange() {
|
|
|
this.userOnLoad(this.userPage);
|
|
|
},
|
|
|
@@ -1047,11 +1097,7 @@ export default {
|
|
|
userConfirm() {
|
|
|
if (this.userSelection) {
|
|
|
this.purchaseData[this.detailsSelect].corpId = this.userSelection[0].id;
|
|
|
- this.$set(
|
|
|
- this.purchaseData[this.detailsSelect],
|
|
|
- "corpName",
|
|
|
- this.userSelection[0].cname
|
|
|
- );
|
|
|
+ this.$set(this.purchaseData[this.detailsSelect], "corpName", this.userSelection[0].cname);
|
|
|
this.userDialog = !this.userDialog;
|
|
|
}
|
|
|
},
|
|
|
@@ -1092,25 +1138,22 @@ export default {
|
|
|
if (row.attributeName) {
|
|
|
this.goodsProps.forEach(e => {
|
|
|
if (row.attributeName == e.dictValue) {
|
|
|
- row.attributeNo = e.dictKey
|
|
|
+ row.attributeNo = e.dictKey;
|
|
|
this.getWorkDicts(e.dictKey).then(res => {
|
|
|
// row.attributeData =JSON.stringify(res.data.data);
|
|
|
this.$set(row, "attributeData", JSON.stringify(res.data.data));
|
|
|
});
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
} else {
|
|
|
- row.attributeNo = null
|
|
|
- row.attributeData = null
|
|
|
+ row.attributeNo = null;
|
|
|
+ row.attributeData = null;
|
|
|
}
|
|
|
},
|
|
|
// 上传前
|
|
|
uploadBefore(file, done, loading, column) {
|
|
|
const is2M = file.size / 1024 / 1024 < 2;
|
|
|
- const isType =
|
|
|
- file.type === "image/jpeg" ||
|
|
|
- file.type === "image/png" ||
|
|
|
- file.type === "image/jpg";
|
|
|
+ const isType = file.type === "image/jpeg" || file.type === "image/png" || file.type === "image/jpg";
|
|
|
if (!isType) {
|
|
|
this.$message.error("图片只能是JPG、JPEG、PNG格式");
|
|
|
loading();
|
|
|
@@ -1121,22 +1164,22 @@ export default {
|
|
|
}
|
|
|
const img = new Image();
|
|
|
const _URL = window.URL || window.webkitURL;
|
|
|
- let isSize = null;
|
|
|
+ // let isSize = null;
|
|
|
img.onload = () => {
|
|
|
- if (column.label == "图片") {
|
|
|
- isSize = img.width === img.height;
|
|
|
- if (!isSize) {
|
|
|
- this.$message.error("图片宽高限制比例为1:1");
|
|
|
- }
|
|
|
- } else {
|
|
|
- const width = 750;
|
|
|
- const height = 1000;
|
|
|
- isSize = img.width === width && img.height <= height;
|
|
|
- if (!isSize) {
|
|
|
- this.$message.error("商品详情轮播图宽为750,高不能超过1000");
|
|
|
- }
|
|
|
- }
|
|
|
- if (is2M && isType && isSize) {
|
|
|
+ // if (column.label == "图片") {
|
|
|
+ // isSize = img.width === img.height;
|
|
|
+ // if (!isSize) {
|
|
|
+ // this.$message.error("图片宽高限制比例为1:1");
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // const width = 750;
|
|
|
+ // const height = 1000;
|
|
|
+ // isSize = img.width === width && img.height <= height;
|
|
|
+ // if (!isSize) {
|
|
|
+ // this.$message.error("商品详情轮播图宽为750,高不能超过1000");
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ if (is2M && isType) {
|
|
|
done();
|
|
|
} else {
|
|
|
loading();
|
|
|
@@ -1155,14 +1198,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
rowDel(row) {
|
|
|
- console.log(row)
|
|
|
+ console.log(row);
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
if (row.id) {
|
|
|
- console.log('待开发')
|
|
|
+ console.log("待开发");
|
|
|
// priceDelete(row.id).then(res => {
|
|
|
// this.$message({
|
|
|
// type: "success",
|
|
|
@@ -1180,10 +1223,10 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
rowAdd() {
|
|
|
- if(this.partList.length>0){
|
|
|
- return this.$message.error('配置信息已存在数据,暂不能生成模板')
|
|
|
+ if (this.partList.length > 0) {
|
|
|
+ return this.$message.error("配置信息已存在数据,暂不能生成模板");
|
|
|
}
|
|
|
- getGoodstype("1", "10", { cname: '配件库' }).then(res => {
|
|
|
+ getGoodstype("1", "10", { cname: "配件库" }).then(res => {
|
|
|
res.data.data.records.forEach(e => {
|
|
|
getPartTree({ parentId: e.id }).then(res2 => {
|
|
|
res2.data.data.records.forEach(e => {
|
|
|
@@ -1191,20 +1234,15 @@ export default {
|
|
|
type: 1,
|
|
|
attributeName: e.cname,
|
|
|
attributeNo: e.id,
|
|
|
- status:1,
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
+ status: 1
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
priceChange(row) {
|
|
|
- row.amout = Number(
|
|
|
- _.multiply(
|
|
|
- Number(row.goodNumber ? row.goodNumber : 0),
|
|
|
- Number(row.price ? row.price : 0)
|
|
|
- )
|
|
|
- ).toFixed(2);
|
|
|
+ row.amout = Number(_.multiply(Number(row.goodNumber ? row.goodNumber : 0), Number(row.price ? row.price : 0))).toFixed(2);
|
|
|
},
|
|
|
librayToPart(rows) {
|
|
|
rows.forEach(e => {
|