|
@@ -2,15 +2,35 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div style="margin-bottom: 15px">
|
|
|
- <addProduct ref="addProduct" @uploadData="uploadData" @closeDrawer="listData"
|
|
|
- :tradefield="data.tradefield" v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled && data.status !== '已失败' && data.status !== '已结案'"
|
|
|
- class="inline-16" :params="paramsAdd" title="添 加"
|
|
|
- @addSuccess="addProducts" :discountrate="discountrate" @addProduct="addProduct" :tablecolsAdd="tablecolsAdd"
|
|
|
+ <addProduct
|
|
|
+ ref="addProduct"
|
|
|
+ @uploadData="uploadData"
|
|
|
+ @closeDrawer="listData"
|
|
|
+ :tradefield="data.tradefield"
|
|
|
+ v-if="
|
|
|
+ tool.checkAuth($route.name, 'productSetManage') &&
|
|
|
+ data.disabled &&
|
|
|
+ data.status !== '已失败' &&
|
|
|
+ data.status !== '已结案'
|
|
|
+ "
|
|
|
+ class="inline-16"
|
|
|
+ :params="paramsAdd"
|
|
|
+ :title="$t(`添 加`)"
|
|
|
+ @addSuccess="addProducts"
|
|
|
+ :discountrate="discountrate"
|
|
|
+ @addProduct="addProduct"
|
|
|
+ :tablecolsAdd="tablecolsAdd"
|
|
|
>
|
|
|
- <!--阀门选型-->
|
|
|
- <selectOption position="项目" slot="optionSystem" style="margin-left: 10px" @handleParam="handleOptionParam" v-if="tool.checkAuth($route.name,'optionSystem')"></selectOption>
|
|
|
- </addProduct>
|
|
|
-<!-- <uploadAllData
|
|
|
+ <!--阀门选型-->
|
|
|
+ <selectOption
|
|
|
+ position="项目"
|
|
|
+ slot="optionSystem"
|
|
|
+ style="margin-left: 10px"
|
|
|
+ @handleParam="handleOptionParam"
|
|
|
+ v-if="tool.checkAuth($route.name, 'optionSystem')"
|
|
|
+ ></selectOption>
|
|
|
+ </addProduct>
|
|
|
+ <!-- <uploadAllData
|
|
|
v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled "
|
|
|
class="inline-16"
|
|
|
:total="total"
|
|
@@ -20,323 +40,469 @@
|
|
|
idName="sa_project_itemsid"
|
|
|
type="del"
|
|
|
></uploadAllData>-->
|
|
|
- <el-button type="primary" size="small" v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled && data.status !== '已失败' && data.status !== '已结案'" @click="onDelAll">一键删除</el-button>
|
|
|
- <el-button v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled && data.status !== '已失败' && data.status !== '已结案'" class="inline-16" size="small" :type="delProductData.length === 0?'':'primary'" @click="onDelProduct" :disabled="delProductData.length === 0">{{$t(`删 除`)}}</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ v-if="
|
|
|
+ tool.checkAuth($route.name, 'productSetManage') &&
|
|
|
+ data.disabled &&
|
|
|
+ data.status !== '已失败' &&
|
|
|
+ data.status !== '已结案'
|
|
|
+ "
|
|
|
+ @click="onDelAll"
|
|
|
+ >{{$t('一键删除')}}</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="
|
|
|
+ tool.checkAuth($route.name, 'productSetManage') &&
|
|
|
+ data.disabled &&
|
|
|
+ data.status !== '已失败' &&
|
|
|
+ data.status !== '已结案'
|
|
|
+ "
|
|
|
+ class="inline-16"
|
|
|
+ size="small"
|
|
|
+ :type="delProductData.length === 0 ? '' : 'primary'"
|
|
|
+ @click="onDelProduct"
|
|
|
+ :disabled="delProductData.length === 0"
|
|
|
+ >{{ $t(`删 除`) }}</el-button
|
|
|
+ >
|
|
|
<el-input
|
|
|
- size="small"
|
|
|
- style="width: 200px;"
|
|
|
- :suffix-icon="params.content.where.condition?params.content.where.condition.length > 0?'':'':'el-icon-search'"
|
|
|
- v-model="params.content.where.condition"
|
|
|
- placeholder="产品名称,产品编号,品号"
|
|
|
- @keyup.enter.native="listData(params.content.pageNumber= 1)"
|
|
|
- @clear="listData(params.content.pageNumber= 1)"
|
|
|
- clearable class="inline-16"></el-input>
|
|
|
- <importFile class="inline-16" accept=".xlsx" v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled && data.status !== '已失败' && data.status !== '已结案' " :bindData="{ownertable:'projectSetTable',ownerid:'',usetype:'default'}" paramId="20231121132504" @onSuccess="importSuccess">
|
|
|
- <a class="error-link" v-if="errorurl" :href="errorurl" slot="errorFile">{{$t('下载错误数据')}}</a>
|
|
|
+ size="small"
|
|
|
+ style="width: 200px"
|
|
|
+ :suffix-icon="
|
|
|
+ params.content.where.condition
|
|
|
+ ? params.content.where.condition.length > 0
|
|
|
+ ? ''
|
|
|
+ : ''
|
|
|
+ : 'el-icon-search'
|
|
|
+ "
|
|
|
+ v-model="params.content.where.condition"
|
|
|
+ :placeholder="$t(`产品名称,产品编号,品号`)"
|
|
|
+ @keyup.enter.native="listData((params.content.pageNumber = 1))"
|
|
|
+ @clear="listData((params.content.pageNumber = 1))"
|
|
|
+ clearable
|
|
|
+ class="inline-16"
|
|
|
+ ></el-input
|
|
|
+ >
|
|
|
+ <importFile
|
|
|
+ class="inline-16"
|
|
|
+ accept=".xlsx"
|
|
|
+ v-if="
|
|
|
+ tool.checkAuth($route.name, 'productSetManage') &&
|
|
|
+ data.disabled &&
|
|
|
+ data.status !== '已失败' &&
|
|
|
+ data.status !== '已结案'
|
|
|
+ "
|
|
|
+ :bindData="{
|
|
|
+ ownertable: 'projectSetTable',
|
|
|
+ ownerid: '',
|
|
|
+ usetype: 'default',
|
|
|
+ }"
|
|
|
+ paramId="20231121132504"
|
|
|
+ @onSuccess="importSuccess"
|
|
|
+ >
|
|
|
+ <a
|
|
|
+ class="error-link"
|
|
|
+ v-if="errorurl"
|
|
|
+ :href="errorurl"
|
|
|
+ slot="errorFile"
|
|
|
+ >{{ $t("下载错误数据") }}</a
|
|
|
+ >
|
|
|
</importFile>
|
|
|
<div style="float: right">
|
|
|
- <label class="search__label">预计折扣(%):</label>
|
|
|
- <el-input style="width: 100px;" v-model="discountrate" size="small" label="默认折扣" :disabled="!tool.checkAuth($route.name,'productSetManage') || !data.disabled || data.status === '已失败' || data.status === '已结案'" @change="discountrateChange(discountrate)"></el-input>
|
|
|
+ <label class="search__label">{{$t('预计折扣')}}(%):</label>
|
|
|
+ <el-input
|
|
|
+ style="width: 100px"
|
|
|
+ v-model="discountrate"
|
|
|
+ size="small"
|
|
|
+ :label="$t(`默认折扣`)"
|
|
|
+ :disabled="
|
|
|
+ !tool.checkAuth($route.name, 'productSetManage') ||
|
|
|
+ !data.disabled ||
|
|
|
+ data.status === '已失败' ||
|
|
|
+ data.status === '已结案'
|
|
|
+ "
|
|
|
+ @change="discountrateChange(discountrate)"
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="produtMag-panel">
|
|
|
<SetOrder ref="setOrder"></SetOrder>
|
|
|
- <tableLayout :layout="tablecols" checkbox="true" :data="list" :opwidth="200" height="calc(100vh - 550px)" :width="true" :custom="true" fixedName="amount" @selectionChange="selectionChange">
|
|
|
+ <tableLayout
|
|
|
+ :layout="tablecols"
|
|
|
+ checkbox="true"
|
|
|
+ :data="list"
|
|
|
+ :opwidth="200"
|
|
|
+ height="calc(100vh - 550px)"
|
|
|
+ :width="true"
|
|
|
+ :custom="true"
|
|
|
+ fixedName="amount"
|
|
|
+ @selectionChange="selectionChange"
|
|
|
+ >
|
|
|
<template v-slot:customcol="scope">
|
|
|
<div v-if="scope.column.columnname == 'qty'">
|
|
|
- <el-input-number v-model="scope.column.data.qty" size="mini" :min="scope.column.data.orderminqty" :step="scope.column.data.orderaddqty" label="描述文字" @change="numChange(scope.column.data.qty,scope.$index,scope.column.data)" :disabled="!disabled || !tool.checkAuth($route.name,'productSetManage') || data.status === '已失败' || data.status === '已结案' "></el-input-number>
|
|
|
+ <el-input-number
|
|
|
+ v-model="scope.column.data.qty"
|
|
|
+ size="mini"
|
|
|
+ :min="scope.column.data.orderminqty"
|
|
|
+ :step="scope.column.data.orderaddqty"
|
|
|
+ :label="$t(`描述文字`)"
|
|
|
+ @change="
|
|
|
+ numChange(
|
|
|
+ scope.column.data.qty,
|
|
|
+ scope.$index,
|
|
|
+ scope.column.data
|
|
|
+ )
|
|
|
+ "
|
|
|
+ :disabled="
|
|
|
+ !disabled ||
|
|
|
+ !tool.checkAuth($route.name, 'productSetManage') ||
|
|
|
+ data.status === '已失败' ||
|
|
|
+ data.status === '已结案'
|
|
|
+ "
|
|
|
+ ></el-input-number>
|
|
|
</div>
|
|
|
<div v-else-if="scope.column.columnname == 'itemname'">
|
|
|
<div v-if="scope.column.data.sa_lectotypecfgid">
|
|
|
- <el-tooltip class="item" effect="dark" content="点击查看选型配置单" placement="top-start">
|
|
|
- <el-button size="small" type="text" @click="$refs.setOrder.onShow(scope.column.data.sa_lectotypecfgid)">{{ scope.column.data.itemname }}</el-button>
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="点击查看选型配置单"
|
|
|
+ placement="top-start"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="text"
|
|
|
+ @click="
|
|
|
+ $refs.setOrder.onShow(scope.column.data.sa_lectotypecfgid)
|
|
|
+ "
|
|
|
+ >{{ scope.column.data.itemname }}</el-button
|
|
|
+ >
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
<div v-else>{{ scope.column.data.itemname }}</div>
|
|
|
</div>
|
|
|
<div v-else-if="scope.column.columnname == 'price'">
|
|
|
- <el-input v-model="scope.column.data.price" size="mini" @change="priceChange(scope.column.data.price,scope.$index,scope.column.data)" :disabled="!disabled || !tool.checkAuth($route.name,'productSetManage') || data.status === '已失败' || data.status === '已结案' "></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="scope.column.data.price"
|
|
|
+ size="mini"
|
|
|
+ @change="
|
|
|
+ priceChange(
|
|
|
+ scope.column.data.price,
|
|
|
+ scope.$index,
|
|
|
+ scope.column.data
|
|
|
+ )
|
|
|
+ "
|
|
|
+ :disabled="
|
|
|
+ !disabled ||
|
|
|
+ !tool.checkAuth($route.name, 'productSetManage') ||
|
|
|
+ data.status === '已失败' ||
|
|
|
+ data.status === '已结案'
|
|
|
+ "
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
<div v-else-if="scope.column.columnname == 'itemno'">
|
|
|
- <span :style="scope.column.data.itemid?'':'color:red'">{{ scope.column.data.itemno }}</span>
|
|
|
+ <span :style="scope.column.data.itemid ? '' : 'color:red'">{{
|
|
|
+ scope.column.data.itemno
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div v-else-if="scope.column.columnname == 'marketprice'">
|
|
|
- <span>{{tool.formatAmount((scope.column.data.marketprice),2)}}</span>
|
|
|
+ <span>{{
|
|
|
+ tool.formatAmount(scope.column.data.marketprice, 2)
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<div v-else-if="scope.column.columnname == 'amount'">
|
|
|
- <span>{{tool.formatAmount((scope.column.data.amount),2)}}</span>
|
|
|
+ <span>{{ tool.formatAmount(scope.column.data.amount, 2) }}</span>
|
|
|
</div>
|
|
|
- <span v-else>{{$t(scope.column.data[scope.column.columnname])}}</span>
|
|
|
+ <span v-else>{{
|
|
|
+ $t(scope.column.data[scope.column.columnname])
|
|
|
+ }}</span>
|
|
|
</template>
|
|
|
</tableLayout>
|
|
|
- <div style="margin-top:16px;">
|
|
|
+ <div style="margin-top: 16px">
|
|
|
<div style="float: left">
|
|
|
- <span>金额(元):{{totalPrice?tool.formatAmount(totalPrice,2):'0.00'}}</span>
|
|
|
+ <span
|
|
|
+ >{{$t('金额(元)')}}:{{
|
|
|
+ totalPrice ? tool.formatAmount(totalPrice, 2) : "0.00"
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
</div>
|
|
|
<div style="float: right">
|
|
|
<el-pagination
|
|
|
- background
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page="params.content.pageNumber"
|
|
|
- :page-sizes="[20, 50, 100, 200]"
|
|
|
- :page-size="100"
|
|
|
- layout="total,sizes, prev, pager, next, jumper"
|
|
|
- :total="total">
|
|
|
+ background
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="params.content.pageNumber"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
+ :page-size="100"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ >
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import add from './add'
|
|
|
-import addProduct from '@/template/addProduct'
|
|
|
+import add from "./add";
|
|
|
+import addProduct from "@/template/addProduct";
|
|
|
import edit from "@/HDrpManagement/projectChange/modules/modules/andEnterprise/components/edit";
|
|
|
import to_del from "@/HDrpManagement/projectChange/modules/modules/andEnterprise/components/toDel";
|
|
|
import uploadFile from "@/components/upload/hw_obs_upload";
|
|
|
import previewImage from "@/components/previewImage";
|
|
|
-import delete_product from './deleteProduct'
|
|
|
-import uploadAllData from '@/components/uploadAllData/index'
|
|
|
-import importFile from '@/template/importFile/index'
|
|
|
-import SelectOption from '@/optionSystem/selectOption/add.vue'
|
|
|
-import SetOrder from '@/optionSystem/selectOption/components/setOrder.vue'
|
|
|
+import delete_product from "./deleteProduct";
|
|
|
+import uploadAllData from "@/components/uploadAllData/index";
|
|
|
+import importFile from "@/template/importFile/index";
|
|
|
+import SelectOption from "@/optionSystem/selectOption/add.vue";
|
|
|
+import SetOrder from "@/optionSystem/selectOption/components/setOrder.vue";
|
|
|
export default {
|
|
|
- props:["data","disabled","flagTag","isLeader"],
|
|
|
- components:{add,uploadAllData,addProduct,uploadFile, previewImage,delete_product,importFile,SelectOption,SetOrder},
|
|
|
- data () {
|
|
|
+ props: ["data", "disabled", "flagTag", "isLeader"],
|
|
|
+ components: {
|
|
|
+ add,
|
|
|
+ uploadAllData,
|
|
|
+ addProduct,
|
|
|
+ uploadFile,
|
|
|
+ previewImage,
|
|
|
+ delete_product,
|
|
|
+ importFile,
|
|
|
+ SelectOption,
|
|
|
+ SetOrder,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
return {
|
|
|
- errorurl:null,
|
|
|
- folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
|
|
|
- tableHieght:"860px",
|
|
|
- totalPrice:0,
|
|
|
- tablecols:[],
|
|
|
- tablecolsAdd:[],
|
|
|
- list:[],
|
|
|
- total:0,
|
|
|
- currentPage:0,
|
|
|
- search:'',
|
|
|
- options:[],
|
|
|
- productList:'',
|
|
|
- delProductData:[],
|
|
|
- discountrate:'',
|
|
|
- paramsAdd:{
|
|
|
- "id": 20221021171802,
|
|
|
- "content": {
|
|
|
- "sa_projectid": this.$route.query.id,
|
|
|
- "pageNumber": 1,
|
|
|
- "pageSize": 100,
|
|
|
- "where": {
|
|
|
- "condition": "",
|
|
|
- "tradefield": "",
|
|
|
- "standards": "",
|
|
|
- "itemclassid": "",
|
|
|
- "sa_brandid": "",
|
|
|
- "model":"",
|
|
|
- "spec":"",
|
|
|
- "material":''
|
|
|
- }
|
|
|
+ errorurl: null,
|
|
|
+ folderid: JSON.parse(sessionStorage.getItem("folderid")).appfolderid,
|
|
|
+ tableHieght: "860px",
|
|
|
+ totalPrice: 0,
|
|
|
+ tablecols: [],
|
|
|
+ tablecolsAdd: [],
|
|
|
+ list: [],
|
|
|
+ total: 0,
|
|
|
+ currentPage: 0,
|
|
|
+ search: "",
|
|
|
+ options: [],
|
|
|
+ productList: "",
|
|
|
+ delProductData: [],
|
|
|
+ discountrate: "",
|
|
|
+ paramsAdd: {
|
|
|
+ id: 20221021171802,
|
|
|
+ content: {
|
|
|
+ sa_projectid: this.$route.query.id,
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 100,
|
|
|
+ where: {
|
|
|
+ condition: "",
|
|
|
+ tradefield: "",
|
|
|
+ standards: "",
|
|
|
+ itemclassid: "",
|
|
|
+ sa_brandid: "",
|
|
|
+ model: "",
|
|
|
+ spec: "",
|
|
|
+ material: "",
|
|
|
+ },
|
|
|
},
|
|
|
},
|
|
|
- params:{
|
|
|
- "id": 20221021145702,
|
|
|
- "content": {
|
|
|
- "sa_projectid": this.$route.query.id,
|
|
|
- "pageNumber": 1,
|
|
|
- "pageSize": 100,
|
|
|
- "where": {
|
|
|
- "condition": ""
|
|
|
- }
|
|
|
+ params: {
|
|
|
+ id: 20221021145702,
|
|
|
+ content: {
|
|
|
+ sa_projectid: this.$route.query.id,
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 100,
|
|
|
+ where: {
|
|
|
+ condition: "",
|
|
|
+ },
|
|
|
},
|
|
|
},
|
|
|
- items:[]
|
|
|
- }
|
|
|
+ items: [],
|
|
|
+ };
|
|
|
},
|
|
|
- provide () {
|
|
|
+ provide() {
|
|
|
return {
|
|
|
- productList:() => this.productList
|
|
|
- }
|
|
|
+ productList: () => this.productList,
|
|
|
+ };
|
|
|
},
|
|
|
- methods:{
|
|
|
+ methods: {
|
|
|
/*list (vm) {
|
|
|
vm.content.sa_projectid = this.$route.query.id
|
|
|
},*/
|
|
|
//处理选型请求参数
|
|
|
- handleOptionParam (param) {
|
|
|
- param.content.enterprisename = this.data.enterprisename
|
|
|
- param.content.projectname = this.data.projectname
|
|
|
- param.content.sourcetable = 'sa_project'
|
|
|
- param.content.source = `项目配置:${this.data.projectname}`
|
|
|
+ handleOptionParam(param) {
|
|
|
+ param.content.enterprisename = this.data.enterprisename;
|
|
|
+ param.content.projectname = this.data.projectname;
|
|
|
+ param.content.sourcetable = "sa_project";
|
|
|
+ param.content.source = `项目配置:${this.data.projectname}`;
|
|
|
},
|
|
|
- async listData(){
|
|
|
- this.discountrate = Math.round((this.data.discountrate * 100) * 100) / 100
|
|
|
- this.totalPrice = 0
|
|
|
- this.params.content.sa_projectid = this.data.sa_projectid
|
|
|
- const res = await this.$api.requested(this.params)
|
|
|
- this.list = res.data
|
|
|
- res.data.forEach((e,index)=>{
|
|
|
- this.list[index].price = this.list[index].price.toFixed(2)
|
|
|
- })
|
|
|
- this.totalPrice = res.tips.amount
|
|
|
- this.total = res.total
|
|
|
- this.$emit("delSuccess")
|
|
|
+ async listData() {
|
|
|
+ this.discountrate = Math.round(this.data.discountrate * 100 * 100) / 100;
|
|
|
+ this.totalPrice = 0;
|
|
|
+ this.params.content.sa_projectid = this.data.sa_projectid;
|
|
|
+ const res = await this.$api.requested(this.params);
|
|
|
+ this.list = res.data;
|
|
|
+ res.data.forEach((e, index) => {
|
|
|
+ this.list[index].price = this.list[index].price.toFixed(2);
|
|
|
+ });
|
|
|
+ this.totalPrice = res.tips.amount;
|
|
|
+ this.total = res.total;
|
|
|
+ this.$emit("delSuccess");
|
|
|
},
|
|
|
- uploadData (uploadApi,data) {
|
|
|
- uploadApi.id = 20221021145502
|
|
|
+ uploadData(uploadApi, data) {
|
|
|
+ uploadApi.id = 20221021145502;
|
|
|
uploadApi.content = {
|
|
|
- "sa_projectid": this.$route.query.id, //订单ID
|
|
|
- "items": data.map(e=>{
|
|
|
+ sa_projectid: this.$route.query.id, //订单ID
|
|
|
+ items: data.map((e) => {
|
|
|
return {
|
|
|
- sa_project_itemsid:0,
|
|
|
- itemid:e.itemid,
|
|
|
- qty:e.orderminqty,
|
|
|
- remarks:e.remarks,
|
|
|
- marketprice:e.marketprice,
|
|
|
- price:(e.marketprice * (this.discountrate / 100)).toFixed(4)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ sa_project_itemsid: 0,
|
|
|
+ itemid: e.itemid,
|
|
|
+ qty: e.orderminqty,
|
|
|
+ remarks: e.remarks,
|
|
|
+ marketprice: e.marketprice,
|
|
|
+ price: (e.marketprice * (this.discountrate / 100)).toFixed(4),
|
|
|
+ };
|
|
|
+ }),
|
|
|
+ };
|
|
|
},
|
|
|
/*一键删除*/
|
|
|
- handlePullApi (pullApi) {
|
|
|
- pullApi.content = JSON.parse(JSON.stringify(this.params.content))
|
|
|
- pullApi.id = 20221021145702
|
|
|
- pullApi.content.sa_projectid = this.$route.query.id
|
|
|
+ handlePullApi(pullApi) {
|
|
|
+ pullApi.content = JSON.parse(JSON.stringify(this.params.content));
|
|
|
+ pullApi.id = 20221021145702;
|
|
|
+ pullApi.content.sa_projectid = this.$route.query.id;
|
|
|
},
|
|
|
- handleDelApi (delApi,data) {
|
|
|
- delApi.id = 20221021145602
|
|
|
+ handleDelApi(delApi, data) {
|
|
|
+ delApi.id = 20221021145602;
|
|
|
delApi.content = {
|
|
|
- "deletereason": "",
|
|
|
- "sa_projectid":this.$route.query.id,
|
|
|
- "sa_project_itemsids":data,
|
|
|
- "pageNumber":0,
|
|
|
- "pageSize":0
|
|
|
- }
|
|
|
- this.listData()
|
|
|
+ deletereason: "",
|
|
|
+ sa_projectid: this.$route.query.id,
|
|
|
+ sa_project_itemsids: data,
|
|
|
+ pageNumber: 0,
|
|
|
+ pageSize: 0,
|
|
|
+ };
|
|
|
+ this.listData();
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
// console.log(`每页 ${val} 条`);
|
|
|
- this.params.content.pageSize = val
|
|
|
- this.listData()
|
|
|
+ this.params.content.pageSize = val;
|
|
|
+ this.listData();
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
// console.log(`当前页: ${val}`);
|
|
|
- this.params.content.pageNumber = val
|
|
|
- this.listData()
|
|
|
+ this.params.content.pageNumber = val;
|
|
|
+ this.listData();
|
|
|
},
|
|
|
/*批量新增*/
|
|
|
- async addProducts(items){
|
|
|
- this.items = []
|
|
|
- this.items = items.map(e=>{
|
|
|
+ async addProducts(items) {
|
|
|
+ this.items = [];
|
|
|
+ this.items = items.map((e) => {
|
|
|
return {
|
|
|
- sa_project_itemsid:0,
|
|
|
- itemid:e.itemid,
|
|
|
- qty:e.orderminqty,
|
|
|
- remarks:e.remarks,
|
|
|
- marketprice:e.marketprice,
|
|
|
- price:(e.marketprice * (this.discountrate / 100)).toFixed(4)
|
|
|
- }
|
|
|
- })
|
|
|
+ sa_project_itemsid: 0,
|
|
|
+ itemid: e.itemid,
|
|
|
+ qty: e.orderminqty,
|
|
|
+ remarks: e.remarks,
|
|
|
+ marketprice: e.marketprice,
|
|
|
+ price: (e.marketprice * (this.discountrate / 100)).toFixed(4),
|
|
|
+ };
|
|
|
+ });
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": 20221021145502,
|
|
|
- "content": {
|
|
|
- "sa_projectid": this.$route.query.id,
|
|
|
- "items": this.items
|
|
|
+ id: 20221021145502,
|
|
|
+ content: {
|
|
|
+ sa_projectid: this.$route.query.id,
|
|
|
+ items: this.items,
|
|
|
},
|
|
|
- })
|
|
|
- this.$refs.addProduct.listData()
|
|
|
- this.listData()
|
|
|
+ });
|
|
|
+ this.$refs.addProduct.listData();
|
|
|
+ this.listData();
|
|
|
},
|
|
|
/*单个新增商品*/
|
|
|
- async addProduct(items){
|
|
|
+ async addProduct(items) {
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": 20221021145502,
|
|
|
- "content": {
|
|
|
- "sa_projectid": this.$route.query.id,
|
|
|
- "items": [
|
|
|
+ id: 20221021145502,
|
|
|
+ content: {
|
|
|
+ sa_projectid: this.$route.query.id,
|
|
|
+ items: [
|
|
|
{
|
|
|
- "sa_project_itemsid":0,
|
|
|
- "itemid": items.itemid,
|
|
|
- "qty": items.orderminqty,
|
|
|
- "remarks": "",
|
|
|
- "marketprice":items.marketprice,
|
|
|
- "price":(items.marketprice * (this.discountrate / 100)).toFixed(4)
|
|
|
- }
|
|
|
- ]
|
|
|
+ sa_project_itemsid: 0,
|
|
|
+ itemid: items.itemid,
|
|
|
+ qty: items.orderminqty,
|
|
|
+ remarks: "",
|
|
|
+ marketprice: items.marketprice,
|
|
|
+ price: (items.marketprice * (this.discountrate / 100)).toFixed(4),
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
- })
|
|
|
- this.$refs.addProduct.listData()
|
|
|
- this.listData()
|
|
|
+ });
|
|
|
+ this.$refs.addProduct.listData();
|
|
|
+ this.listData();
|
|
|
},
|
|
|
- onSuccess(){
|
|
|
- this.listData()
|
|
|
- this.$emit("productSetSuccess")
|
|
|
+ onSuccess() {
|
|
|
+ this.listData();
|
|
|
+ this.$emit("productSetSuccess");
|
|
|
},
|
|
|
- clearData(){
|
|
|
- this.search = ""
|
|
|
- this.params.content.where.condition = this.search
|
|
|
- this.listData()
|
|
|
+ clearData() {
|
|
|
+ this.search = "";
|
|
|
+ this.params.content.where.condition = this.search;
|
|
|
+ this.listData();
|
|
|
},
|
|
|
- queryClick(){
|
|
|
- this.params.content.where.condition = this.search
|
|
|
- this.listData()
|
|
|
+ queryClick() {
|
|
|
+ this.params.content.where.condition = this.search;
|
|
|
+ this.listData();
|
|
|
},
|
|
|
- selectionChange(val){
|
|
|
- this.delProductData = []
|
|
|
- val.forEach((item,index) => {
|
|
|
- this.delProductData[index] = item.sa_project_itemsid
|
|
|
- })
|
|
|
+ selectionChange(val) {
|
|
|
+ this.delProductData = [];
|
|
|
+ val.forEach((item, index) => {
|
|
|
+ this.delProductData[index] = item.sa_project_itemsid;
|
|
|
+ });
|
|
|
},
|
|
|
/*批量删除判断*/
|
|
|
onDelProduct() {
|
|
|
- this.$confirm('此操作将删除这些商品, 是否继续?', this.$t('提示'), {
|
|
|
- confirmButtonText: this.$t('确定'),
|
|
|
- cancelButtonText: this.$t('取消'),
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.delProduct()
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '取消删除'
|
|
|
+ this.$confirm(this.$t('此操作将删除这些商品, 是否继续')+"?", this.$t("提示"), {
|
|
|
+ confirmButtonText: this.$t("确定"),
|
|
|
+ cancelButtonText: this.$t("取消"),
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.delProduct();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: this.$t("取消删除"),
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
},
|
|
|
/*批量删除商品*/
|
|
|
- async delProduct(){
|
|
|
+ async delProduct() {
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": 20221021145602,
|
|
|
- "content": {
|
|
|
- "deletereason": "",
|
|
|
- "sa_projectid":this.data.sa_projectid,
|
|
|
- "sa_project_itemsids":this.delProductData
|
|
|
+ id: 20221021145602,
|
|
|
+ content: {
|
|
|
+ deletereason: "",
|
|
|
+ sa_projectid: this.data.sa_projectid,
|
|
|
+ sa_project_itemsids: this.delProductData,
|
|
|
},
|
|
|
- })
|
|
|
- this.tool.showMessage(res,()=>{
|
|
|
- this.listData()
|
|
|
- this.$emit("delSuccess")
|
|
|
- })
|
|
|
+ });
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ this.listData();
|
|
|
+ this.$emit("delSuccess");
|
|
|
+ });
|
|
|
},
|
|
|
/*修改商品数量*/
|
|
|
- numChange(val,index,data){
|
|
|
- if (val < data.orderminqty){
|
|
|
- data.qty = data.orderminqty.toFixed(2)
|
|
|
- }else {
|
|
|
- if ((val - data.orderminqty)/data.orderaddqty > 0){
|
|
|
- let k = ((val - data.orderminqty)/data.orderaddqty).toFixed(0)
|
|
|
- data.qty = k * data.orderaddqty + data.orderminqty
|
|
|
- }else {
|
|
|
- data.qty = val.toFixed(2)
|
|
|
+ numChange(val, index, data) {
|
|
|
+ if (val < data.orderminqty) {
|
|
|
+ data.qty = data.orderminqty.toFixed(2);
|
|
|
+ } else {
|
|
|
+ if ((val - data.orderminqty) / data.orderaddqty > 0) {
|
|
|
+ let k = ((val - data.orderminqty) / data.orderaddqty).toFixed(0);
|
|
|
+ data.qty = k * data.orderaddqty + data.orderminqty;
|
|
|
+ } else {
|
|
|
+ data.qty = val.toFixed(2);
|
|
|
}
|
|
|
}
|
|
|
- data.amount = (data.price * data.qty).toFixed(2)
|
|
|
- this.$set(this.list,index,data)
|
|
|
- this.onChangQty(data,data.qty)
|
|
|
+ data.amount = (data.price * data.qty).toFixed(2);
|
|
|
+ this.$set(this.list, index, data);
|
|
|
+ this.onChangQty(data, data.qty);
|
|
|
},
|
|
|
/*修改单价*/
|
|
|
- priceChange(val,index,data){
|
|
|
+ priceChange(val, index, data) {
|
|
|
// if (val > data.marketprice){
|
|
|
// data.price = this.tool.formatAmount(data.marketprice,2)
|
|
|
// }else if(val < 0) {
|
|
@@ -344,59 +510,59 @@ export default {
|
|
|
// }else {
|
|
|
// data.price = this.tool.formatAmount(val ,2)
|
|
|
// }
|
|
|
- if(val < 0) {
|
|
|
- data.price = 0
|
|
|
- }else {
|
|
|
- data.price = this.tool.formatAmount(val ,2)
|
|
|
+ if (val < 0) {
|
|
|
+ data.price = 0;
|
|
|
+ } else {
|
|
|
+ data.price = this.tool.formatAmount(val, 2);
|
|
|
}
|
|
|
- data.amount = this.tool.formatAmount(data.price * data.qty,2)
|
|
|
- this.$set(this.list,index,data)
|
|
|
- this.onChangePrice(data,data.price)
|
|
|
+ data.amount = this.tool.formatAmount(data.price * data.qty, 2);
|
|
|
+ this.$set(this.list, index, data);
|
|
|
+ this.onChangePrice(data, data.price);
|
|
|
},
|
|
|
/*执行修改数量*/
|
|
|
- async onChangQty(data,val){
|
|
|
+ async onChangQty(data, val) {
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": 20221021145502,
|
|
|
- "content": {
|
|
|
- "sa_projectid": this.data.sa_projectid,
|
|
|
- "items": [
|
|
|
+ id: 20221021145502,
|
|
|
+ content: {
|
|
|
+ sa_projectid: this.data.sa_projectid,
|
|
|
+ items: [
|
|
|
{
|
|
|
- "sa_project_itemsid":data.sa_project_itemsid,
|
|
|
- "itemid": data.itemid,
|
|
|
- "qty": val,
|
|
|
- "remarks": "",
|
|
|
- "marketprice": data.marketprice, //市场价
|
|
|
- "price": data.price //单价
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- })
|
|
|
- this.listData()
|
|
|
- this.$emit("productSetSuccess")
|
|
|
+ sa_project_itemsid: data.sa_project_itemsid,
|
|
|
+ itemid: data.itemid,
|
|
|
+ qty: val,
|
|
|
+ remarks: "",
|
|
|
+ marketprice: data.marketprice, //市场价
|
|
|
+ price: data.price, //单价
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.listData();
|
|
|
+ this.$emit("productSetSuccess");
|
|
|
},
|
|
|
/*执行修改单价*/
|
|
|
- async onChangePrice(data,val){
|
|
|
+ async onChangePrice(data, val) {
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": 20221021145502,
|
|
|
- "content": {
|
|
|
- "sa_projectid": this.data.sa_projectid,
|
|
|
- "items": [
|
|
|
+ id: 20221021145502,
|
|
|
+ content: {
|
|
|
+ sa_projectid: this.data.sa_projectid,
|
|
|
+ items: [
|
|
|
{
|
|
|
- "sa_project_itemsid":data.sa_project_itemsid,
|
|
|
- "itemid": data.itemid,
|
|
|
- "qty": data.qty,
|
|
|
- "remarks": "",
|
|
|
- "marketprice": data.marketprice, //市场价
|
|
|
- "price": val //单价
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- })
|
|
|
- this.listData()
|
|
|
- this.$emit("productSetSuccess")
|
|
|
+ sa_project_itemsid: data.sa_project_itemsid,
|
|
|
+ itemid: data.itemid,
|
|
|
+ qty: data.qty,
|
|
|
+ remarks: "",
|
|
|
+ marketprice: data.marketprice, //市场价
|
|
|
+ price: val, //单价
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.listData();
|
|
|
+ this.$emit("productSetSuccess");
|
|
|
},
|
|
|
/*修改预计折扣*/
|
|
|
- async discountrateChange(val){
|
|
|
+ async discountrateChange(val) {
|
|
|
// if (val > 100){
|
|
|
// this.discountrate = 100
|
|
|
// }else if(val < 0){
|
|
@@ -404,85 +570,89 @@ export default {
|
|
|
// }else {
|
|
|
// this.discountrate = Math.round(val * 100)/100
|
|
|
// }
|
|
|
- if(val < 0){
|
|
|
- this.discountrate = 0
|
|
|
- }else {
|
|
|
- this.discountrate = Math.round(val * 100)/100
|
|
|
+ if (val < 0) {
|
|
|
+ this.discountrate = 0;
|
|
|
+ } else {
|
|
|
+ this.discountrate = Math.round(val * 100) / 100;
|
|
|
}
|
|
|
- /* this.discountrate = (this.discountrate / 100).toFixed(4)*/
|
|
|
+ /* this.discountrate = (this.discountrate / 100).toFixed(4)*/
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": 20230207090702,
|
|
|
- "content": {
|
|
|
- "sa_projectid": this.$route.query.id,
|
|
|
- "discountrate": (this.discountrate / 100).toFixed(4)
|
|
|
+ id: 20230207090702,
|
|
|
+ content: {
|
|
|
+ sa_projectid: this.$route.query.id,
|
|
|
+ discountrate: (this.discountrate / 100).toFixed(4),
|
|
|
},
|
|
|
- })
|
|
|
- this.tool.showMessage(res,()=>{
|
|
|
- this.data.discountrate = this.discountrate / 100
|
|
|
- this.$emit("productSetSuccess")
|
|
|
- this.listData()
|
|
|
- })
|
|
|
+ });
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ this.data.discountrate = this.discountrate / 100;
|
|
|
+ this.$emit("productSetSuccess");
|
|
|
+ this.listData();
|
|
|
+ });
|
|
|
},
|
|
|
/*一键删除*/
|
|
|
- async onDelAll(){
|
|
|
+ async onDelAll() {
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": 20230629150902,
|
|
|
- "content": {
|
|
|
- "sa_projectid": this.$route.query.id
|
|
|
+ id: 20230629150902,
|
|
|
+ content: {
|
|
|
+ sa_projectid: this.$route.query.id,
|
|
|
},
|
|
|
- })
|
|
|
- this.tool.showMessage(res,()=>{
|
|
|
- this.$emit("productSetSuccess")
|
|
|
- this.listData()
|
|
|
- })
|
|
|
+ });
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ this.$emit("productSetSuccess");
|
|
|
+ this.listData();
|
|
|
+ });
|
|
|
},
|
|
|
- async importSuccess(val){
|
|
|
+ async importSuccess(val) {
|
|
|
const res = await this.$api.requested({
|
|
|
- "id": "20231121132604",
|
|
|
- "content": {
|
|
|
- "sa_projectid": this.$route.query.id,
|
|
|
- "attachmentid":val
|
|
|
- }
|
|
|
- })
|
|
|
- if (res.data !== '成功'){
|
|
|
- this.errorurl = res.data
|
|
|
+ id: "20231121132604",
|
|
|
+ content: {
|
|
|
+ sa_projectid: this.$route.query.id,
|
|
|
+ attachmentid: val,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ if (res.data !== "成功") {
|
|
|
+ this.errorurl = res.data;
|
|
|
}
|
|
|
- this.onSuccess()
|
|
|
-
|
|
|
- }
|
|
|
+ this.onSuccess();
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
/*this.getProductList()*/
|
|
|
/*this.tablecols = this.tool.tabelCol(this.$route.name).projectSetTable.tablecols*/
|
|
|
- this.tablecols = this.tool.tabelCol(this.$route.name).projectSetTable.tablecols
|
|
|
- this.tablecolsAdd = this.tool.tabelCol(this.$route.name).addProductTable.tablecols
|
|
|
- /* this.data.discountrate = Math.round((this.data.discountrate * 100) * 100) / 100*/
|
|
|
+ this.tablecols = this.tool.tabelCol(
|
|
|
+ this.$route.name
|
|
|
+ ).projectSetTable.tablecols;
|
|
|
+ this.tablecolsAdd = this.tool.tabelCol(
|
|
|
+ this.$route.name
|
|
|
+ ).addProductTable.tablecols;
|
|
|
+ /* this.data.discountrate = Math.round((this.data.discountrate * 100) * 100) / 100*/
|
|
|
},
|
|
|
- mounted () {
|
|
|
- this.listData()
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
+ mounted() {
|
|
|
+ this.listData();
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
/* /deep/.el-table__cell .cell {
|
|
|
display: flex;
|
|
|
justify-content: s;
|
|
|
} */
|
|
|
-.produtMag-panel{
|
|
|
+.produtMag-panel {
|
|
|
/* margin: 30px; */
|
|
|
- padding:0 10px 10px 10px;
|
|
|
+ padding: 0 10px 10px 10px;
|
|
|
background: #fff;
|
|
|
- border-radius:5px;
|
|
|
+ border-radius: 5px;
|
|
|
overflow: hidden;
|
|
|
- border:1px solid rgb(0 0 0 / 5%)
|
|
|
+ border: 1px solid rgb(0 0 0 / 5%);
|
|
|
/* box-shadow: 0 5px 5px rgb(0 0 0 / 10%);
|
|
|
transform: translate3d(0,-2px,0); */
|
|
|
}
|
|
|
-/deep/ .el-input.is-disabled .el-input__inner{
|
|
|
+/deep/ .el-input.is-disabled .el-input__inner {
|
|
|
color: #666666;
|
|
|
}
|
|
|
.image {
|
|
|
- width:38px;height:38px;margin:0px auto;
|
|
|
+ width: 38px;
|
|
|
+ height: 38px;
|
|
|
+ margin: 0px auto;
|
|
|
}
|
|
|
</style>
|