🌈 style: 删除console.log
This commit is contained in:
@@ -18,8 +18,8 @@ export default {
|
|||||||
this.$store.dispatch('category/getProductMap');
|
this.$store.dispatch('category/getProductMap');
|
||||||
this.$store.dispatch('category/getRawMaterialMap');
|
this.$store.dispatch('category/getRawMaterialMap');
|
||||||
this.$store.dispatch('category/getBomMap');
|
this.$store.dispatch('category/getBomMap');
|
||||||
|
this.$store.dispatch('finance/getFinancialAccounts');
|
||||||
}
|
}
|
||||||
console.log(this.$store)
|
|
||||||
},
|
},
|
||||||
metaInfo() {
|
metaInfo() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<template>
|
||||||
|
<el-select v-model="_value" placeholder="请选择">
|
||||||
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AmountSelect',
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['financialAccounts']),
|
||||||
|
_value: {
|
||||||
|
get() {
|
||||||
|
return this.value;
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
this.$emit('input', value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
options: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getFinancialAccounts();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getFinancialAccounts() {
|
||||||
|
this.options = this.financialAccounts.map(item => ({
|
||||||
|
label: item.accountName,
|
||||||
|
value: item.accountId
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -52,7 +52,6 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.options = this.rawMaterialList;
|
this.options = this.rawMaterialList;
|
||||||
console.log(this.options, this.rawMaterialList);
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['rawMaterialList'])
|
...mapGetters(['rawMaterialList'])
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ export default {
|
|||||||
productId: {
|
productId: {
|
||||||
handler(newVal) {
|
handler(newVal) {
|
||||||
const res = this.productMap[this.productId] ? this.productMap[this.productId] : {};
|
const res = this.productMap[this.productId] ? this.productMap[this.productId] : {};
|
||||||
console.log(res)
|
|
||||||
this.product = res;
|
this.product = res;
|
||||||
},
|
},
|
||||||
immediate: true
|
immediate: true
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ export default {
|
|||||||
materialId: {
|
materialId: {
|
||||||
handler: function (newVal) {
|
handler: function (newVal) {
|
||||||
const res = this.materialMap[this.materialId] ? this.materialMap[this.materialId] : {};
|
const res = this.materialMap[this.materialId] ? this.materialMap[this.materialId] : {};
|
||||||
console.log(res)
|
|
||||||
this.material = res;
|
this.material = res;
|
||||||
},
|
},
|
||||||
immediate: true
|
immediate: true
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ export default {
|
|||||||
}
|
}
|
||||||
this.vditor = new Vditor('vditor', config);
|
this.vditor = new Vditor('vditor', config);
|
||||||
if (this.readonly) {
|
if (this.readonly) {
|
||||||
console.log(this.vditor)
|
|
||||||
this.vditor.vditor.disabled()
|
this.vditor.vditor.disabled()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const getters = {
|
|||||||
sidebarRouters:state => state.permission.sidebarRouters,
|
sidebarRouters:state => state.permission.sidebarRouters,
|
||||||
productList: state => state.category.productList,
|
productList: state => state.category.productList,
|
||||||
rawMaterialList: state => state.category.rawMaterialList,
|
rawMaterialList: state => state.category.rawMaterialList,
|
||||||
bomMap: state => state.category.bomMap
|
bomMap: state => state.category.bomMap,
|
||||||
|
financialAccounts: state => state.finance.financialAccounts,
|
||||||
}
|
}
|
||||||
export default getters
|
export default getters
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import tagsView from './modules/tagsView'
|
|||||||
import permission from './modules/permission'
|
import permission from './modules/permission'
|
||||||
import settings from './modules/settings'
|
import settings from './modules/settings'
|
||||||
import category from './modules/category'
|
import category from './modules/category'
|
||||||
|
import finance from './modules/finance'
|
||||||
import getters from './getters'
|
import getters from './getters'
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
@@ -19,7 +20,8 @@ const store = new Vuex.Store({
|
|||||||
tagsView,
|
tagsView,
|
||||||
permission,
|
permission,
|
||||||
settings,
|
settings,
|
||||||
category
|
category,
|
||||||
|
finance
|
||||||
},
|
},
|
||||||
getters
|
getters
|
||||||
})
|
})
|
||||||
|
|||||||
26
klp-ui/src/store/modules/finance.js
Normal file
26
klp-ui/src/store/modules/finance.js
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { listAccount } from "@/api/finance/account";
|
||||||
|
|
||||||
|
const state = {
|
||||||
|
financialAccounts: [],
|
||||||
|
}
|
||||||
|
|
||||||
|
const mutations = {
|
||||||
|
SET_FINANCIAL_ACCOUNTS(state, financialAccounts) {
|
||||||
|
state.financialAccounts = financialAccounts;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const actions = {
|
||||||
|
getFinancialAccounts({ commit }) {
|
||||||
|
listAccount().then(response => {
|
||||||
|
commit('SET_FINANCIAL_ACCOUNTS', response.data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
namespaced: true,
|
||||||
|
state,
|
||||||
|
mutations,
|
||||||
|
actions
|
||||||
|
}
|
||||||
@@ -6,15 +6,12 @@
|
|||||||
<el-input v-model="form.docNo" placeholder="请输入凭证编号" />
|
<el-input v-model="form.docNo" placeholder="请输入凭证编号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="单据日期" prop="docDate">
|
<el-form-item label="单据日期" prop="docDate">
|
||||||
<el-date-picker clearable
|
<el-date-picker clearable v-model="form.docDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
v-model="form.docDate"
|
|
||||||
type="datetime"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
placeholder="请选择单据日期">
|
placeholder="请选择单据日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="关联订单ID" prop="relatedOrderId">
|
<el-form-item label="关联订单" prop="orderId">
|
||||||
<el-input v-model="form.relatedOrderId" placeholder="请输入关联订单ID" />
|
<el-input v-model="form.orderId" placeholder="请输入关联订单" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -29,29 +26,19 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="accountingId" label="会计科目">
|
<el-table-column prop="accountingId" label="会计科目">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="scope.row.accountingId" placeholder="请输入会计科目" @change="handleRowChange(scope.row)" />
|
<amount-select v-model="scope.row.accountId" placeholder="请输入会计科目" @change="handleRowChange(scope.row)" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="debitAmount" label="借方金额">
|
<el-table-column prop="debitAmount" label="借方金额">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input
|
<el-input v-model.number="scope.row.debitAmount" type="number" placeholder="0.00"
|
||||||
v-model.number="scope.row.debitAmount"
|
@input="handleDebitInput(scope.row)" @change="handleRowChange(scope.row)" />
|
||||||
type="number"
|
|
||||||
placeholder="0.00"
|
|
||||||
@input="handleDebitInput(scope.row)"
|
|
||||||
@change="handleRowChange(scope.row)"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="creditAmount" label="贷方金额">
|
<el-table-column prop="creditAmount" label="贷方金额">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input
|
<el-input v-model.number="scope.row.creditAmount" type="number" placeholder="0.00"
|
||||||
v-model.number="scope.row.creditAmount"
|
@input="handleCreditInput(scope.row)" @change="handleRowChange(scope.row)" />
|
||||||
type="number"
|
|
||||||
placeholder="0.00"
|
|
||||||
@input="handleCreditInput(scope.row)"
|
|
||||||
@change="handleRowChange(scope.row)"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="remark" label="备注">
|
<el-table-column prop="remark" label="备注">
|
||||||
@@ -61,12 +48,8 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="100">
|
<el-table-column label="操作" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.$index)"
|
||||||
type="text"
|
:disabled="tableData.length <= 1">
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.$index)"
|
|
||||||
:disabled="tableData.length <= 1"
|
|
||||||
>
|
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -96,13 +79,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import AmountSelect from '@/components/KLPService/AmountSelect/index.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
AmountSelect
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
docNo: undefined,
|
docNo: undefined,
|
||||||
docDate: undefined,
|
docDate: undefined,
|
||||||
relatedOrderId: undefined
|
orderId: undefined
|
||||||
},
|
},
|
||||||
tableData: [{
|
tableData: [{
|
||||||
summary: '',
|
summary: '',
|
||||||
@@ -269,6 +257,20 @@
|
|||||||
row.creditAmount > 0;
|
row.creditAmount > 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 凭证编号,单据日期和关联订单必填
|
||||||
|
if (!this.form.docNo) {
|
||||||
|
this.$message.error('凭证编号必填');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.form.docDate) {
|
||||||
|
this.$message.error('单据日期必填');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.form.orderId) {
|
||||||
|
this.$message.error('关联订单必填');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (invalidRows !== -1) {
|
if (invalidRows !== -1) {
|
||||||
this.$message.error('存在同时填写借方和贷方金额的行,请检查');
|
this.$message.error('存在同时填写借方和贷方金额的行,请检查');
|
||||||
return;
|
return;
|
||||||
@@ -282,7 +284,27 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('表单数据:', this.form);
|
// 所有的科目必须填写
|
||||||
|
const accountIds = validData.map(row => row.accountId);
|
||||||
|
if (accountIds.some(id => !id)) {
|
||||||
|
this.$message.error('请填写所有会计科目');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 每一行至少包含借方或贷方金额
|
||||||
|
const hasDebitOrCredit = validData.some(row => row.debitAmount > 0 || row.creditAmount > 0);
|
||||||
|
if (!hasDebitOrCredit) {
|
||||||
|
this.$message.error('请至少填写一行借方或贷方金额');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 借贷必须相同
|
||||||
|
if (this.debitAmount !== this.creditAmount) {
|
||||||
|
this.$message.error('借方和贷方金额必须相同');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('表单数据:', this.form, this.debitAmount, this.creditAmount);
|
||||||
console.log('表格数据:', validData);
|
console.log('表格数据:', validData);
|
||||||
|
|
||||||
// 这里可以添加提交逻辑
|
// 这里可以添加提交逻辑
|
||||||
|
|||||||
@@ -357,9 +357,14 @@ export default {
|
|||||||
payableId: this.payForm.payableId,
|
payableId: this.payForm.payableId,
|
||||||
paidAmount: this.payForm.amount
|
paidAmount: this.payForm.amount
|
||||||
}
|
}
|
||||||
|
this.buttonLoading = true;
|
||||||
updatePaidAmount(payload).then(response => {
|
updatePaidAmount(payload).then(response => {
|
||||||
this.$modal.msgSuccess("付款成功");
|
this.$modal.msgSuccess("付款成功");
|
||||||
})
|
this.payOpen = false;
|
||||||
|
this.getList();
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -357,6 +357,7 @@ export default {
|
|||||||
receivableId: this.receiveForm.receivableId,
|
receivableId: this.receiveForm.receivableId,
|
||||||
paidAmount: this.receiveForm.amount
|
paidAmount: this.receiveForm.amount
|
||||||
}
|
}
|
||||||
|
this.buttonLoading = true;
|
||||||
updatePaidAmount(payload).then(response => {
|
updatePaidAmount(payload).then(response => {
|
||||||
this.$modal.msgSuccess("收款成功");
|
this.$modal.msgSuccess("收款成功");
|
||||||
this.receiveOpen = false;
|
this.receiveOpen = false;
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ export default {
|
|||||||
this.$store.dispatch('category/getProductMap');
|
this.$store.dispatch('category/getProductMap');
|
||||||
this.$store.dispatch('category/getRawMaterialMap');
|
this.$store.dispatch('category/getRawMaterialMap');
|
||||||
this.$store.dispatch('category/getBomMap');
|
this.$store.dispatch('category/getBomMap');
|
||||||
|
this.$store.dispatch('finance/getFinancialAccounts');
|
||||||
this.$router.push({ path: this.redirect || "/" }).catch(() => { });
|
this.$router.push({ path: this.redirect || "/" }).catch(() => { });
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|||||||
@@ -355,7 +355,6 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleAddBom(bom) {
|
handleAddBom(bom) {
|
||||||
console.log('回调触发', bom)
|
|
||||||
this.bomId = bom.bomId;
|
this.bomId = bom.bomId;
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -355,7 +355,6 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleAddBom(bom) {
|
handleAddBom(bom) {
|
||||||
console.log('回调触发', bom)
|
|
||||||
this.bomId = bom.bomId;
|
this.bomId = bom.bomId;
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ export default {
|
|||||||
orderId: this.orderId,
|
orderId: this.orderId,
|
||||||
orderStatus: this.EOrderStatus.PRODUCTIONING,
|
orderStatus: this.EOrderStatus.PRODUCTIONING,
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
console.log("状态变更成功")
|
|
||||||
this.$emit('confirm', submitData)
|
this.$emit('confirm', submitData)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -489,7 +489,6 @@ export default {
|
|||||||
},
|
},
|
||||||
handleUploadQualityCertificate(row) {
|
handleUploadQualityCertificate(row) {
|
||||||
this.uploadQualityCertificateOpen = true;
|
this.uploadQualityCertificateOpen = true;
|
||||||
console.log(row, 'row');
|
|
||||||
this.uploadQualityCertificateInfo = row;
|
this.uploadQualityCertificateInfo = row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ export default {
|
|||||||
this.$store.dispatch('category/getBomMap');
|
this.$store.dispatch('category/getBomMap');
|
||||||
this.$store.dispatch('category/getRawMaterialMap');
|
this.$store.dispatch('category/getRawMaterialMap');
|
||||||
} else if (this.uploadQualityCertificateForm.qualityCertificateType === 3) {
|
} else if (this.uploadQualityCertificateForm.qualityCertificateType === 3) {
|
||||||
console.log('创建新物料');
|
|
||||||
// 创建一个新的BOM
|
// 创建一个新的BOM
|
||||||
const bom = await addBom({
|
const bom = await addBom({
|
||||||
bomName: 'N' + new Date().getTime(),
|
bomName: 'N' + new Date().getTime(),
|
||||||
|
|||||||
@@ -140,9 +140,8 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:title="title"
|
title="视频播放"
|
||||||
:visible.sync="openVideo"
|
:visible.sync="openVideo"
|
||||||
width="800px"
|
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
element-loading-text="正在加载视频流..."
|
element-loading-text="正在加载视频流..."
|
||||||
@close="handleCloseVideo"
|
@close="handleCloseVideo"
|
||||||
|
|||||||
@@ -253,7 +253,6 @@ export default {
|
|||||||
procInsId: row.procInsId
|
procInsId: row.procInsId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(row);
|
|
||||||
},
|
},
|
||||||
/** 取消流程申请 */
|
/** 取消流程申请 */
|
||||||
handleStop(row){
|
handleStop(row){
|
||||||
|
|||||||
Reference in New Issue
Block a user