报价单配件加上价格和同步

This commit is contained in:
xielue 2023-04-25 13:12:21 +08:00
parent cba9c9df13
commit c1a2a56c84
8 changed files with 60 additions and 19 deletions

View File

@ -2,4 +2,4 @@
VUE_APP_API_BASE_URL=http://zxx4.f3322.net:46000 VUE_APP_API_BASE_URL=http://zxx4.f3322.net:46000
VUE_APP_USER_MODEL2=AdminUser VUE_APP_USER_MODEL2=AdminUser
VUE_APP_USER_MODEL=BaseAdmin VUE_APP_USER_MODEL=BaseAdmin
VUE_APP_BEID=3 VUE_APP_BEID=1

View File

@ -9,6 +9,9 @@ export default {
if (rule.dataRule && rule.dataRule.type == "integer") { // 如果是整数 if (rule.dataRule && rule.dataRule.type == "integer") { // 如果是整数
data[rule.field] = parseInt(value); // 转换为整数 data[rule.field] = parseInt(value); // 转换为整数
} }
if (rule.dataRule && rule.dataRule.type == "number") { // 如果是整数
data[rule.field] = parseFloat(value); // 转换为整数
}
if (rule.dataRule && rule.dataRule.type == "timestamp") { // 如果是时间戳 if (rule.dataRule && rule.dataRule.type == "timestamp") { // 如果是时间戳
data[rule.field] = parseInt(new Date(data[rule.field]).getTime() / 1000); // 转换为时间戳 data[rule.field] = parseInt(new Date(data[rule.field]).getTime() / 1000); // 转换为时间戳
} }

View File

@ -1,5 +1,4 @@
<template> <template>
<page-layout :desc="desc">
<div class="page-body"> <div class="page-body">
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth" <vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
@ -18,20 +17,18 @@
<a-button @click="cancel">取消</a-button> <a-button @click="cancel">取消</a-button>
</div> </div>
</div> </div>
</page-layout>
</template> </template>
<script> <script>
import BASE_URL from '@/services/Middle/bathroom/BathroomParts/api.js'; import BASE_URL from '@/services/Middle/bathroom/BathroomParts/api.js';
import PageLayout from '@/layouts/PageLayout'
export default { export default {
name: 'BathroomPartsUpdate', name: 'BathroomPartsUpdate',
i18n: require('./i18n'), i18n: require('./i18n'),
components: { PageLayout }, components: { },
props: { props: {
pageMode: { pageMode: {
type: String, type: String,
@ -115,13 +112,14 @@ export default {
// =============================== Start =============================== // =============================== Start ===============================
{ field: 'name', title: '配件名称', span: 12, itemRender: { name: '$input' } }, { field: 'name', title: '配件名称', span: 12, itemRender: { name: '$input' } },
{ field: 'price', title: '价格', dataRule: { type: "number" }, span: 12, itemRender: { name: '$input',props:{type:"number"} } },
{ field: 'quoted_price', title: '采购价', dataRule: { type: "number" }, span: 12, itemRender: { name: '$input',props:{type:"number"} } },
{ field: 'code', title: '编码', span: 12, itemRender: { name: '$input' } }, { field: 'code', title: '编码', span: 12, itemRender: { name: '$input' } },
{ field: 'brand', title: '配件品牌', span: 12, itemRender: { name: '$input' } }, { field: 'brand', title: '配件品牌', span: 12, itemRender: { name: '$input' } },
{ field: 'model', title: '配件型号', span: 12, itemRender: { name: '$input' } }, { field: 'model', title: '配件型号', span: 12, itemRender: { name: '$input' } },
{ field: 'spec', title: '配件规格', span: 12, itemRender: { name: '$input' } }, { field: 'spec', title: '配件规格', span: 12, itemRender: { name: '$input' } },
{ field: 'unit', title: '单位', span: 12, itemRender: { name: '$input' } }, { field: 'unit', title: '单位', span: 12, itemRender: { name: '$input' } },
{ field: 'supplier', title: '供应商', span: 12, itemRender: { name: '$input' } }, { field: 'supplier', title: '供应商', span: 12, itemRender: { name: '$input' } },
{ field: 'image', title: '图片', span: 12, itemRender: { name: '$input' } },
{ field: 'remark', title: '备注', span: 12, itemRender: { name: '$input' } }, { field: 'remark', title: '备注', span: 12, itemRender: { name: '$input' } },
// =============================== End =============================== // =============================== End ===============================

View File

@ -16,7 +16,7 @@
</a-col> </a-col>
<a-col :flex="$mk.config.ui.toolbarFlex"> <a-col :flex="$mk.config.ui.toolbarFlex">
<!-- 工具条 --> <!-- 工具条 -->
<mk-toolbar @toolbarClick="toolbarClick"></mk-toolbar> <mk-toolbar @toolbarClick="toolbarClick" :buttons="toolbar_btns" :isShowLog="false" :isShowSetting="false"></mk-toolbar>
</a-col> </a-col>
</a-row> </a-row>
@ -69,7 +69,10 @@ export default {
var pageData = { // var pageData = { //
keyName: 'id', // keyName: 'id', //
toolbar_btns:[
{name :"数据同步",label:"数据同步"}
],
// //
actions: { // Api actions: { // Api
@ -86,6 +89,9 @@ export default {
BathroomPartsImportExcel: `${BASE_URL.BASE_URL}/BathroomParts/v1/bathroom/parts/import/excel`, // EXCEL BathroomPartsImportExcel: `${BASE_URL.BASE_URL}/BathroomParts/v1/bathroom/parts/import/excel`, // EXCEL
// =============================== End =============================== // =============================== End ===============================
sync:`${BASE_URL.BASE_URL}/BathroomParts/v1/bathroom/parts/sync`
}, },
start_time: 0, // start_time: 0, //
@ -164,6 +170,13 @@ export default {
// =============================== Start =============================== // =============================== Start ===============================
{ field: 'name', sortable: true, title: '配件名称', width: 250 }, // { field: 'name', sortable: true, title: '配件名称', width: 250 }, //
{ field: 'price', sortable: true, title: '价格', width: 150 },
{ field: 'quoted_price', sortable: true, title: '采购价', width: 150 },
{ field: 'code', sortable: true, title: '编码', width: 250 }, // { field: 'code', sortable: true, title: '编码', width: 250 }, //
{ field: 'brand', sortable: true, title: '配件品牌', width: 250 }, // { field: 'brand', sortable: true, title: '配件品牌', width: 250 }, //
{ field: 'model', sortable: true, title: '配件型号', width: 250 }, // { field: 'model', sortable: true, title: '配件型号', width: 250 }, //
@ -273,6 +286,25 @@ export default {
if (e.name == "add") { // if (e.name == "add") { //
this.$openPage("/BathroomParts/BathroomPartsAdd"); // this.$openPage("/BathroomParts/BathroomPartsAdd"); //
} }
if(e.name == '数据同步'){
this.$mk.post({
url: this.actions.sync, //
loading: "数据同步中...", //
data: {
}
}).then(() => { //
this.$mk.success("同步成功"); //
setTimeout(()=>{
this.onSearch();
},3000);
}).catch((a) => { //
this.$mk.error(a.data.msg); //
});
}
}, },
// //

View File

@ -1562,8 +1562,11 @@ export default {
parts_onPulldownSelected({ selectedData, row }) { parts_onPulldownSelected({ selectedData, row }) {
console.log(row, selectedData); console.log(row, selectedData);
if (selectedData.spec) { if (selectedData.spec) {
row.spec = selectedData.spec; row.spec = selectedData.spec;
//TODO }
if(selectedData.price){
row.price = selectedData.price;
} }
}, },

View File

@ -1123,8 +1123,11 @@ export default {
console.log(row, selectedData); console.log(row, selectedData);
if (selectedData.spec) { if (selectedData.spec) {
row.spec = selectedData.spec; row.spec = selectedData.spec;
//TODO }
if(selectedData.price){
row.price = selectedData.price;
} }
}, },

View File

@ -854,10 +854,12 @@ export default {
console.log(row, selectedData); console.log(row, selectedData);
if(selectedData.spec){ if(selectedData.spec){
row.spec = selectedData.spec; row.spec = selectedData.spec;
//TODO }
if(selectedData.price){
row.price = selectedData.price;
} }
}, },
parts_onPopupSelected({ rows, name, params }) { parts_onPopupSelected({ rows, name, params }) {
console.log(rows, name, params); console.log(rows, name, params);

View File

@ -17,7 +17,7 @@ const routerMap = {
routerMap[FunName]= { routerMap[FunName]= {
name: FunTitle, name: FunTitle,
icon: 'idcard', icon: 'idcard',
component: view.page, component: view.blank,
meta: { meta: {
}, },
authority: { authority: {