|
@@ -8,6 +8,7 @@
|
|
|
:placeholder="$t('OnlineExcelPage.please_table_name_ipt')"
|
|
|
style="width: 200px"
|
|
|
clearable
|
|
|
+ :disabled="isView"
|
|
|
>
|
|
|
</el-input>
|
|
|
</li>
|
|
@@ -25,6 +26,7 @@
|
|
|
}"
|
|
|
clearable
|
|
|
:placeholder="$t('OnlineExcelPage.select_table_category')"
|
|
|
+ :disabled="isView"
|
|
|
/>
|
|
|
</li>
|
|
|
<li>
|
|
@@ -44,6 +46,7 @@
|
|
|
}"
|
|
|
clearable
|
|
|
:placeholder="$t('OnlineExcelPage.Co_editor')"
|
|
|
+ :disabled="isView"
|
|
|
/>
|
|
|
</li>
|
|
|
</ul>
|
|
@@ -60,7 +63,7 @@
|
|
|
:value="item.key"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
- <el-button type="primary" @click="handleShowSaveStaticTable">{{
|
|
|
+ <el-button type="primary" @click="handleShowSaveStaticTable" v-if="!isView">{{
|
|
|
$t("BalanceSheet.save_static_table")
|
|
|
}}</el-button>
|
|
|
<div>
|
|
@@ -80,6 +83,46 @@
|
|
|
>{{ $t("OnlineExcelPage.recent_save_time_info")
|
|
|
}}{{ updateTime }}</span
|
|
|
>
|
|
|
+ <!-- 预览页面操作按钮 -->
|
|
|
+ <template v-if="isView">
|
|
|
+ <!-- <div> -->
|
|
|
+ <span
|
|
|
+ class="editsty"
|
|
|
+ @click="itemHandle(excelInfo, 'edit')"
|
|
|
+ style="margin-right: 10px"
|
|
|
+ v-if="isSheetBtnShow('edit')&&excelInfo.Button.OpButton"
|
|
|
+ >{{excelInfo.CanEdit?$t("ETable.Btn.edit_btn"):excelInfo.Editor+$t('OnlineExcelPage.editing_msg')}}</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="editsty"
|
|
|
+ @click="itemHandle(excelInfo, 'refresh')"
|
|
|
+ style="margin-right: 10px"
|
|
|
+ v-if="isSheetBtnShow('refresh')&&excelInfo.Button.RefreshButton"
|
|
|
+ >{{ $t("ETable.Btn.refresh_btn") }}</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="editsty"
|
|
|
+ @click="itemHandle(excelInfo, 'save')"
|
|
|
+ style="margin-right: 10px"
|
|
|
+ v-if="isSheetBtnShow('otherSave')&&excelInfo.Button.CopyButton"
|
|
|
+ >{{ $t("ETable.Btn.save_as") }}</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="editsty"
|
|
|
+ @click="itemHandle(excelInfo, 'download')"
|
|
|
+ style="margin-right: 10px"
|
|
|
+ v-if="isSheetBtnShow('download')"
|
|
|
+ >{{ $t("ETable.Btn.download_btn") }}</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="deletesty"
|
|
|
+ @click="itemHandle(excelInfo, 'del')"
|
|
|
+ style="margin-right: 10px"
|
|
|
+ v-if="isSheetBtnShow('del')&&excelInfo.Button.DeleteButton"
|
|
|
+ >{{ $t("Table.delete_btn") }}</span
|
|
|
+ >
|
|
|
+ <!-- </div> -->
|
|
|
+ </template>
|
|
|
<!-- icon="el-icon-refresh-right" -->
|
|
|
<el-button
|
|
|
type="primary"
|
|
@@ -87,6 +130,7 @@
|
|
|
:loading="updating"
|
|
|
@click="updateHandle"
|
|
|
style="margin-left: 10px"
|
|
|
+ v-if="!isView"
|
|
|
>{{
|
|
|
updating
|
|
|
? $t("ETable.Btn.renewing_btn")
|
|
@@ -98,6 +142,7 @@
|
|
|
size="medium"
|
|
|
@click="saveSheetHandle"
|
|
|
style="margin-left: 10px"
|
|
|
+ v-if="!isView"
|
|
|
>{{ $t("ETable.Btn.save_btn") }}</el-button
|
|
|
>
|
|
|
<el-button type="primary" size="medium" plain @click="backHandle">{{
|
|
@@ -108,6 +153,7 @@
|
|
|
|
|
|
<BalanceTable
|
|
|
ref="balanceTableRef"
|
|
|
+ :disabled="isView"
|
|
|
/>
|
|
|
|
|
|
<!-- 存为静态表弹窗 -->
|
|
@@ -131,6 +177,60 @@
|
|
|
<el-button type="primary" plain @click="showSaveStaticTable=false">{{$t('ETable.Btn.cancel_btn')}}</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 表格另存 -->
|
|
|
+ <m-dialog
|
|
|
+ :show.sync="isSaveOther"
|
|
|
+ width="650px"
|
|
|
+ :title="$t('ETable.Btn.save_as')"
|
|
|
+ @close="cancelSaveOther"
|
|
|
+ >
|
|
|
+ <div style="padding-left: 80px">
|
|
|
+ <el-form
|
|
|
+ ref="formRef"
|
|
|
+ label-position="left"
|
|
|
+ hide-required-asterisk
|
|
|
+ label-width="80px"
|
|
|
+ :model="saveOtherForm"
|
|
|
+ :rules="saveOtherFormRule"
|
|
|
+ >
|
|
|
+ <el-form-item :label="$t('OnlineExcelPage.excel_name_ipt')" prop="name">
|
|
|
+ <el-input
|
|
|
+ v-model="saveOtherForm.name"
|
|
|
+ style="width: 80%"
|
|
|
+ :placeholder="$t('OnlineExcelPage.please_table_name_ipt')"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('OnlineExcelPage.table_classification_label')" prop="classify">
|
|
|
+ <el-cascader
|
|
|
+ v-model="saveOtherForm.classify"
|
|
|
+ :options="classifyOptions"
|
|
|
+ :props="{
|
|
|
+ label: 'ExcelClassifyName',
|
|
|
+ value: 'ExcelClassifyId',
|
|
|
+ children: 'Children',
|
|
|
+ emitPath: false,
|
|
|
+ }"
|
|
|
+ style="width: 80%"
|
|
|
+ :placeholder="$t('OnlineExcelPage.select_appropriate_category_lable')"
|
|
|
+ class="sheet-classify-cascader"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex; justify-content: center; margin-top: 30px">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ style="margin-right: 60px"
|
|
|
+ @click="saveCopyOther"
|
|
|
+ >{{$t('Dialog.confirm_save_btn')}}</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" plain @click="cancelSaveOther"
|
|
|
+ >{{$t('Dialog.cancel_btn')}}</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </m-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -138,19 +238,50 @@
|
|
|
import * as sheetInterface from '@/api/modules/sheetApi.js';
|
|
|
import { departInterence } from "@/api/api.js";
|
|
|
import moment from 'moment';
|
|
|
+import mDialog from "@/components/mDialog.vue";
|
|
|
import BalanceTable from './components/BalanceTable.vue';
|
|
|
+import BalanceTableMixin from './mixins/balanceTableMixin'
|
|
|
export default {
|
|
|
+ mixins:[BalanceTableMixin],
|
|
|
components: {
|
|
|
- BalanceTable
|
|
|
+ BalanceTable,
|
|
|
+ mDialog
|
|
|
},
|
|
|
computed: {
|
|
|
+ downExcelFileUrl() {
|
|
|
+ let url = `${
|
|
|
+ process.env.VUE_APP_API_ROOT
|
|
|
+ }/datamanage/excel_info/table/download?${localStorage.getItem("auth")}`;
|
|
|
+ return url;
|
|
|
+ },
|
|
|
rules() {
|
|
|
return this.$t('OnlineExcelPage.TableInstructionsText') || ''
|
|
|
},
|
|
|
+ isView(){
|
|
|
+ return this.$route.path==='/viewBalanceSheet'
|
|
|
+ },
|
|
|
+ classifyOptions() {
|
|
|
+ let options = this.classifyArr.map((_) => ({
|
|
|
+ ExcelClassifyId: _.ExcelClassifyId,
|
|
|
+ ExcelClassifyName: _.ExcelClassifyName,
|
|
|
+ }));
|
|
|
+ return options;
|
|
|
+ },
|
|
|
+ saveOtherFormRule(){
|
|
|
+ return {
|
|
|
+ name: [
|
|
|
+ { required: true, message: this.$t('OnlineExcelPage.table_name_empty_msg') , trigger: "blur" },
|
|
|
+ ],
|
|
|
+ classify: [
|
|
|
+ { required: true, message: this.$t('OnlineExcelPage.cannot_be_empty_table') , trigger: "blur" },
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
sheetId: this.$route.query.id || '',
|
|
|
+ excelInfo:{},
|
|
|
|
|
|
updating:false,
|
|
|
|
|
@@ -171,7 +302,14 @@ export default {
|
|
|
],
|
|
|
|
|
|
showSaveStaticTable:false,//存为静态表弹窗
|
|
|
- staticTableName:''
|
|
|
+ staticTableName:'',
|
|
|
+
|
|
|
+ /* 另存为 */
|
|
|
+ isSaveOther: false,
|
|
|
+ saveOtherForm: {
|
|
|
+ name: '',
|
|
|
+ classify: ''
|
|
|
+ },
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -192,6 +330,32 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ cancelSaveOther() {
|
|
|
+ this.$refs.formRef.resetFields();
|
|
|
+ this.saveOtherForm = {
|
|
|
+ name: '',
|
|
|
+ classify: ''
|
|
|
+ };
|
|
|
+ this.isSaveOther = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 另存为 */
|
|
|
+ async saveCopyOther() {
|
|
|
+ await this.$refs.formRef.validate();
|
|
|
+ let { classify, name } = this.saveOtherForm;
|
|
|
+
|
|
|
+ const res = await sheetInterface.copyExcel({
|
|
|
+ ExcelInfoId: this.excelInfo.ExcelInfoId,
|
|
|
+ ExcelName: name,
|
|
|
+ ExcelClassifyId: classify,
|
|
|
+ });
|
|
|
+
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+
|
|
|
+ this.$message.success(this.$t('MsgPrompt.saved_msg') );
|
|
|
+ this.cancelSaveOther();
|
|
|
+ },
|
|
|
+
|
|
|
handleShowSaveStaticTable(){
|
|
|
this.staticTableName=''
|
|
|
this.showSaveStaticTable=true
|
|
@@ -222,6 +386,7 @@ export default {
|
|
|
ExcelInfoId: Number(this.sheetId)
|
|
|
})
|
|
|
if(res.Ret !== 200) return
|
|
|
+ this.excelInfo=res.Data
|
|
|
const { ExcelName,ExcelClassifyId,TableData,ModifyTime,Button } = res.Data;
|
|
|
this.sheetForm.name=ExcelName
|
|
|
this.sheetForm.classify=ExcelClassifyId
|
|
@@ -321,11 +486,20 @@ export default {
|
|
|
sheetInterface.markSheetEditStatus({ExcelInfoId:Number(this.sheetId),Status:2}).then(res=>{
|
|
|
if(res.Ret != 200) return
|
|
|
})
|
|
|
+ },
|
|
|
+
|
|
|
+ isSheetBtnShow(type){
|
|
|
+ return this.permissionBtn.isShowBtn('etaTablePermission',`etaTable_customize_balance_${type}`)
|
|
|
}
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
+<style lang="scss">
|
|
|
+.sheet-classify-cascader .el-input {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+</style>
|
|
|
<style scoped lang="scss">
|
|
|
* {
|
|
|
box-sizing: border-box;
|