From 4bf10a1ba42ddaeab565c105b376c5732b0f3dab Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 09 四月 2024 11:47:11 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/silk/silk-web
---
src/views/systemSetting/dataDictionary/index.vue | 307 +++++++
vue.config.js | 2
src/views/systemSetting/workshopManage/components/silkTableList.vue | 97 ++
src/views/systemSetting/dataDictionary/components/addDataDictionaries.vue | 147 +++
src/components/makepager/TableCommonView.vue | 17
src/views/systemSetting/encodeManage/index.vue | 177 +++
src/views/systemSetting/dataDictionary/components/silkTableList.vue | 402 +++++++++
src/api/systemSetting/dataDictionary.js | 19
src/views/systemSetting/workshopManage/components/addDialog.vue | 213 ++++
src/api/systemSetting/workshopManage.js | 35
src/views/systemSetting/encodeManage/components/silkTableList.vue | 402 +++++++++
src/views/systemSetting/encodeManage/components/addWorkshop.vue | 62 +
src/views/systemSetting/silkPriceStandard/index.vue | 17
src/views/systemSetting/workshopManage/components/addWorkshop.vue | 382 +++++++
src/views/systemSetting/workshopManage/index.vue | 260 +++--
src/views/systemSetting/silkPriceStandard/components/silkTableList.vue | 4
16 files changed, 2,372 insertions(+), 171 deletions(-)
diff --git a/src/api/systemSetting/dataDictionary.js b/src/api/systemSetting/dataDictionary.js
new file mode 100644
index 0000000..1889e51
--- /dev/null
+++ b/src/api/systemSetting/dataDictionary.js
@@ -0,0 +1,19 @@
+import request from "@/common/untils/request.js"
+
+// 瀛楀吀鍒楄〃
+export function getDict(data) {
+ return request({
+ url: "/api-jl/v1/system/dict?dictType="+data.dictType,
+ method: "get",
+ data
+ })
+}
+
+// 娣诲姞瀛楀吀
+export function addDict(data) {
+ return request({
+ url: "/api-jl/v1/system/dict",
+ method: "post",
+ data
+ })
+}
diff --git a/src/api/systemSetting/workshopManage.js b/src/api/systemSetting/workshopManage.js
new file mode 100644
index 0000000..9a48a80
--- /dev/null
+++ b/src/api/systemSetting/workshopManage.js
@@ -0,0 +1,35 @@
+import request from "@/common/untils/request.js"
+
+// 杞﹂棿鍒楄〃
+export function getWorkshopManageList(data) {
+ return request({
+ url: "/api-jl/v1/system/getWorkshopManageList"+'?keyWord='+data.keyWord,
+ method: "get",
+ data
+ })
+}
+// 瀛楀吀鍒楄〃
+export function getDict(data) {
+ return request({
+ url: "/api-jl/v1/system/dict?dictType="+data.dictType,
+ method: "get",
+ data
+ })
+}
+// 淇濆瓨杞﹂棿鍒楄〃
+export function saveWorkshopManage(data) {
+ return request({
+ url: "/api-jl/v1/system/saveWorkshopManage",
+ method: "post",
+ data
+ })
+}
+// 鍒犻櫎杞﹂棿
+export function deleteWorkshopManage(data) {
+ return request({
+ url: "/api-jl/v1/system/deleteWorkshopManage/"+data.id,
+ method: "delete",
+ data
+ })
+}
+
diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue
index cf76fd4..350d107 100644
--- a/src/components/makepager/TableCommonView.vue
+++ b/src/components/makepager/TableCommonView.vue
@@ -39,6 +39,17 @@
:fixed="item.fixed"
v-if="item.isShowColumn"
>
+
+ <template slot="header">
+ {{ item.label }}
+ <span v-if="item.iconRight">
+ <i
+ :class="item.iconRight"
+ style="font-size: 16px; margin-left: 5px; cursor: pointer"
+ @click="handleShow(item)"
+ ></i>
+ </span>
+ </template>
<template slot-scope="scope">
<span v-if="item.price">{{ "锟�" + number_format(scope.row[item.prop], 2, ".", ",") }}</span>
<div v-else-if="item.status" :class="scope.row.status">{{ scope.row[item.prop] }}</div>
@@ -412,7 +423,11 @@
} else {
return false
}
- }
+ },
+ // 鑷畾涔夎〃澶寸偣鍑讳簨浠�
+ handleShow(item) {
+ this.$emit("handleShow", item);
+ },
}
}
</script>
diff --git a/src/views/systemSetting/dataDictionary/components/addDataDictionaries.vue b/src/views/systemSetting/dataDictionary/components/addDataDictionaries.vue
new file mode 100644
index 0000000..aac1404
--- /dev/null
+++ b/src/views/systemSetting/dataDictionary/components/addDataDictionaries.vue
@@ -0,0 +1,147 @@
+<template>
+ <div class="add_wordshop">
+ <el-dialog
+ :title="editConfig.dialogTitle+editConfig.dialogTitleType"
+ :visible.sync="editConfig.visible"
+ width="30%"
+ :before-close="handleClose">
+ <el-form :inline="true" label-width="20%" style="width: 100%;" :model="form" >
+ <template v-if="editConfig.infomitton.TabsIndex===0||editConfig.infomitton.TabsIndex===1">
+ <el-form-item label="缂栫爜" style="width: 100%;" >
+ <el-input v-model="form.number" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ <el-form-item label="鍚嶇О" style="width: 100%;" >
+ <el-input v-model="form.name" placeholder="璇疯緭鍏ュ瓧姣嶆垨鏁板瓧锛屼笉鍏佽鏈夌┖鏍笺�佷腑鏂�"></el-input>
+ </el-form-item>
+ </template>
+
+ <template v-if="editConfig.infomitton.TabsIndex===2">
+ <el-form-item label="甯﹀彿棰滆壊" style="width: 100%;" >
+ <el-input v-model="form.name" placeholder="璇疯緭鍏ュ瓧姣嶆垨鏁板瓧锛屼笉鍏佽鏈夌┖鏍笺�佷腑鏂�"></el-input>
+ </el-form-item>
+ </template>
+
+ <template v-if="editConfig.infomitton.TabsIndex===3">
+ <el-form-item label="瑙勬牸" style="width: 100%;" >
+ <el-input v-model="form.number" placeholder="璇疯緭鍏ュ瓧姣嶆垨鏁板瓧锛屼笉鍏佽鏈夌┖鏍笺�佷腑鏂�"></el-input>
+ </el-form-item>
+ </template>
+
+ <el-form-item label="鎻忚堪" style="width: 100%;" >
+ <el-input
+ v-model="form.remark"
+ type="textarea"
+ :rows="4"
+ style="resize: none !important;"
+ placeholder="璇疯緭鍏�"
+ >
+ </el-input>
+ </el-form-item>
+
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="editConfig.visible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="commitForm">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {addDict} from "@/api/systemSetting/dataDictionary"
+export default {
+ props: {
+ editDiaConfig:{
+ type: Object,
+ default: () => {
+ return {
+ visible: false,
+ dialogTitle:"娣诲姞",
+ infomitton: {
+
+ }
+ }
+ }
+ }
+ },
+ data() {
+ return {
+ editConfig:this.editDiaConfig,
+ form: {
+ name: '',
+ number: '',
+ remark:""
+ }
+ };
+ },
+ computed: {
+
+ },
+ created() {
+
+ },
+ mounted() {
+ },
+ watch: {
+
+ },
+ methods: {
+ handleClose(done) {
+ done();
+ },
+ saveParams(type){
+ let params={}
+ if(type===0||type===1){
+ params={
+ dictType:this.editConfig.infomitton.TabsIndex,
+ name: this.form.name,
+ number: this.form.number,
+ remark:this.form.remark,
+ }
+ }else if(type===2){
+ params={
+ dictType:this.editConfig.infomitton.TabsIndex,
+ name: this.form.name,
+ number: this.form.number,
+ remark:this.form.remark,
+ }
+ }else if(type===3){
+ params={
+ dictType:this.editConfig.infomitton.TabsIndex,
+ name: this.form.name,
+ number: this.form.number,
+ remark:this.form.remark,
+ }
+ }
+ return params
+ },
+ commitForm(){
+ let params=this.saveParams(this.editConfig.infomitton.TabsIndex)
+ if(this.editConfig.dialogTitle==="鏂板"){
+ addDict(params).then((res)=>{
+ if(res&&res.code===200){
+ this.editConfig.visible=false
+ this.$parent.getData()
+ this.$message({
+ message: `鏂板${this.editConfig.dialogTitleType}鎴愬姛!`,
+ type: 'success'
+ });
+ }
+ console.log(res,"res")
+ })
+ }else if(this.editConfig.dialogTitle==="淇敼"){
+ console.log("淇敼")
+ }
+ }
+ },
+ components: {
+
+ },
+};
+</script>
+
+<style scoped lang="scss">
+::v-deep .el-form-item__content{
+ width: 70% !important;
+}
+</style>
diff --git a/src/views/systemSetting/dataDictionary/components/silkTableList.vue b/src/views/systemSetting/dataDictionary/components/silkTableList.vue
new file mode 100644
index 0000000..b75b518
--- /dev/null
+++ b/src/views/systemSetting/dataDictionary/components/silkTableList.vue
@@ -0,0 +1,402 @@
+<template>
+ <div class="page-view">
+ <div class="top-box">
+ <div class="table-box" :style="{ width: detailEnter ? '95%' : '100%' }">
+ <el-form ref="form" :model="tableList" :show-message="false" label-position="right">
+ <el-table
+ ref="fromTable"
+ :data="tableList.tableData"
+ style="width: 100%"
+ @selection-change="handleSelectionChange"
+ :row-key="(row) => row.productId"
+ :header-cell-style="{ background: '#f1f3f8', color: '#000009', 'font-size': '14px' }"
+ border
+ >
+ <el-table-column v-if="selectBox" type="selection" :reserve-selection="true" width="40" align="center">
+ </el-table-column>
+ <el-table-column
+ v-if="tableList.isReturn"
+ type="index"
+ label="#"
+ width="50"
+ align="center"
+ ></el-table-column>
+ <el-table-column
+ v-for="(item, i) in tableList.tableColumn"
+ :key="i"
+ :prop="item.prop"
+ :label="item.label"
+ :width="item.width"
+ :min-width="item.min"
+ align="center"
+ >
+ <!-- 琛ㄥご鏍峰紡 -->
+ <template slot="header">
+ <span v-if="item.isRequird" style="color: #f56c6c">*</span>
+ <div v-else-if="item.addColumn" class="add-column-box">
+ <el-input
+ placeholder="璇疯緭鍏�"
+ v-model="item.label"
+ size="mini"
+ clearable
+ @change="
+ (val) => {
+ addColumnInputChange(val, item.prop)
+ }
+ "
+ ></el-input>
+ <div class="common-select-btn" @click="clearupColumn(item.prop)">
+ <i class="el-icon-remove" title="鍒犻櫎"></i>
+ </div>
+ </div>
+ <span v-else>{{ item.label }}</span>
+ </template>
+ <!-- column鏍峰紡 -->
+ <template slot-scope="scope">
+ <template v-if="detailEnter">
+ <el-form-item
+ v-if="item.input"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
+ <el-input
+ v-model.trim="scope.row[item.prop]"
+ maxlength="50"
+ size="mini"
+ :disabled="!isOperate"
+ @change="
+ (val) => {
+ commonInputChange(val, item.prop, scope.row, scope)
+ }
+ "
+ ></el-input>
+ </el-form-item>
+ <el-form-item
+ v-else-if="item.projectName"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ >
+ <div class="custom-name">
+ <el-select v-model="scope.row[item.prop]" clearable size="mini" placeholder="璇烽�夋嫨">
+ <el-option
+ v-for="(item, index) in projectOptions"
+ :key="index"
+ :label="item.value"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ <div class="common-select-btn" @click="clearupClient(scope)">
+ <i class="el-icon-remove" title="鍒犻櫎"></i>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item
+ v-else-if="item.inputNumber"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
+ <el-input-number
+ v-model="scope.row[item.prop]"
+ placeholder=""
+ :min="0"
+ :controls="false"
+ :disabled="!isOperate"
+ size="mini"
+ style="width: 100%; margin-right: 5px"
+ @change="
+ (val) => {
+ commonInputChange(val, item.prop, scope.row, scope)
+ }
+ "
+ ></el-input-number>
+ </el-form-item>
+ <el-form-item
+ v-else-if="item.inputFloat"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
+ <el-input-number
+ v-model="scope.row[item.prop]"
+ placeholder=""
+ :min="0"
+ :precision="4"
+ :disabled="!isOperate"
+ :controls="false"
+ size="mini"
+ style="width: 100%; margin-right: 5px"
+ @change="
+ (val) => {
+ commonInputChange(val, item.prop, scope.row, scope)
+ }
+ "
+ ></el-input-number>
+ </el-form-item>
+ <span v-else>
+ <template>
+ {{ scope.row[item.prop] }}
+ </template>
+ </span>
+ </template>
+ <el-form-item
+ v-else-if="item.inputNumber && selectBox"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
+ <el-input-number
+ v-model="scope.row[item.prop]"
+ placeholder=""
+ :min="0"
+ :controls="false"
+ :disabled="!isOperate"
+ size="mini"
+ style="width: 100%; margin-right: 5px"
+ @change="
+ (val) => {
+ commonInputChange(val, item.prop, scope.row, scope)
+ }
+ "
+ ></el-input-number>
+ </el-form-item>
+ <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="80" v-if="!detailEnter" align="center">
+ <template slot-scope="scope">
+ <el-button type="text" size="small" :disabled="!isOperate" @click="deleteClick(scope)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ <slot name="tableButton" />
+ <div slot="empty">
+ <el-empty description="鏆傛棤鏁版嵁"></el-empty>
+ </div>
+ </el-table>
+ </el-form>
+ </div>
+ <div
+ v-if="detailEnter"
+ class="add-column-box"
+ @click="addColumnClick"
+ :style="{ width: detailEnter ? '40px' : '0px' }"
+ >
+ <i class="el-icon-circle-plus"></i>
+ </div>
+ </div>
+ <div v-if="detailEnter" style="margin: 10px">
+ <div class="add-btn-box" @click="addRowClick">
+ <i class="el-icon-circle-plus"></i>
+ </div>
+ <!-- <el-button size="small" type="primary" :disabled="!isOperate" @click="add">鏂板</el-button> -->
+ <!-- <el-button size="small" type="primary" disabled>瀵煎叆鏄庣粏</el-button> -->
+ </div>
+ </div>
+</template>
+
+<script>
+// import { getProductList } from "@/api/common/other"
+export default {
+ name: "CommmonFormTableView",
+ components: {},
+ props: {
+ detailEnter: {
+ type: Boolean,
+ default: false
+ },
+ selectBox: {
+ type: Boolean,
+ default: false
+ },
+ // 閭d釜椤甸潰 鐢ㄦ潵鍒ゆ柇璁$畻鏂瑰紡
+ pageName: {
+ type: String,
+ default: ""
+ },
+ // 鍒楄〃鏂板鏄惁澶氶��
+ addTypeIdMultiple: {
+ type: Boolean,
+ default: false
+ },
+ // 鏍规嵁鎶ヤ环鍗曟煡璇骇鍝�
+ quotationNumber: {
+ type: [String, Number],
+ default: ""
+ },
+ // 鏄惁鍙互鎿嶄綔 娣诲姞绛�
+ isOperate: {
+ type: Boolean,
+ default: true
+ },
+ silkTableList: {
+ type: Object,
+ default: () => {
+ return {
+ tableData: [], // 鎺ュ彛杩斿洖鏁版嵁
+ isReturn: false,
+ tableColumn: [
+ // table琛ㄥ崟
+ { label: "", prop: "", min: 200, tooltip: true }
+ ]
+ }
+ }
+ }
+ },
+ data() {
+ return {
+ total: 0,
+ productList: [],
+ tableList: [],
+ projectIndex: 0,
+ projectOptions: [
+ { id: 1, value: "绾ゅ害鍋忓樊" },
+ { id: 2, value: "浜屾鍙樺寲" },
+ { id: 3, value: "娓呮磥鍒�" },
+ { id: 4, value: "娲佸噣鍒�" },
+ { id: 5, value: "鏈�澶у亸宸�" }
+ ]
+ }
+ },
+ created() {
+ // if (!this.selectBox) {
+ // this.getProductList()
+ // }
+ this.getTableInfo()
+ },
+ watch: {
+ silkTableList: {
+ handler() {
+ this.getTableInfo()
+ },
+ immediate: true
+ }
+ },
+ computed: {},
+ methods: {
+ getTableInfo() {
+ this.tableList = this.silkTableList
+ if (this.tableList.tableData.length === 1 && this.tableList.tableData[0].name === "") {
+ this.isRecalculate = false
+ } else {
+ this.isRecalculate = true
+ }
+ },
+ // 澶氶��
+ handleSelectionChange(val) {
+ this.$emit("getSelectArray", val)
+ },
+
+ // 鏂板
+ addRowClick() {
+ if (this.addTypeIdMultiple) {
+ this.projectIndex = this.tableList.tableData.length
+ this.editSelCommonConfig.title = "浜у搧鍚嶇О"
+ this.editSelCommonConfig.isSelectBox = true
+ this.editSelCommonConfig.editVisible = true
+ } else {
+ this.$emit("addProjectClick")
+ }
+ },
+ commonInputChange(val, prop, row, scope) {
+ this.$emit("inputContent", val, prop, row, scope)
+ },
+ // 鍒犻櫎
+ deleteClick(scope) {
+ this.$emit("clearupProject", this.tableList.tableData, scope.$index)
+ },
+ // 鍒犻櫎
+ clearupClient(scope) {
+ this.$emit("clearupProject", this.tableList.tableData, scope.$index)
+ },
+ // 娣诲姞鍒楁寜閽�
+ addColumnClick() {
+ this.$emit("addColumnClick")
+ },
+ // 娣诲姞鍒楀ご閮ㄦ爣棰樿緭鍏�
+ addColumnInputChange(val, prop) {
+ console.log(val, prop, "娣诲姞鍒楀ご閮ㄦ爣棰樿緭鍏�")
+ },
+ // 鍒犻櫎鍒�
+ clearupColumn(prop) {
+ console.log(prop)
+ this.$emit("clearupColumn", prop)
+ }
+ },
+ //瑙e喅琛ㄦ牸鎶栧姩闂
+ beforeUpdate() {
+ this.$nextTick(() => {
+ this.$refs["fromTable"].doLayout()
+ })
+ },
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style lang="scss" scoped>
+.page-view {
+ .top-box {
+ display: flex;
+ .table-box {
+ flex: 1;
+ .el-form-item {
+ margin-bottom: 0;
+ .custom-name {
+ display: flex;
+ .common-select-btn {
+ margin-left: 5px;
+ font-size: 18px;
+ cursor: pointer;
+ color: #ff0000;
+ }
+ }
+ }
+ }
+ .add-column-box {
+ // width: 40px;
+ margin-top: 10px;
+ font-size: 26px;
+ color: #5582f3;
+ margin-left: 20px;
+ cursor: pointer;
+ }
+ }
+ .add-btn-box {
+ font-size: 26px;
+ color: #5582f3;
+ margin-left: 50px;
+ cursor: pointer;
+ }
+ .add-column-box {
+ display: flex;
+ .common-select-btn {
+ margin-left: 5px;
+ font-size: 18px;
+ cursor: pointer;
+ color: #ff0000;
+ }
+ }
+}
+::v-deep {
+ .el-form-item__label {
+ display: none;
+ }
+ .el-table__footer-wrapper tbody td.el-table__cell {
+ background-color: #fff;
+ // text-align: right;
+ font-weight: bold;
+ }
+ .el-input--suffix .el-input__inner {
+ padding-right: 0px;
+ }
+ .el-table .cell,
+ .el-table th.el-table__cell > .cell {
+ padding: 0 5px;
+ }
+ .el-input__inner {
+ // text-align: left;
+ text-align: center !important;
+ }
+}
+</style>
diff --git a/src/views/systemSetting/dataDictionary/index.vue b/src/views/systemSetting/dataDictionary/index.vue
index 43c4ab0..4c7b83e 100644
--- a/src/views/systemSetting/dataDictionary/index.vue
+++ b/src/views/systemSetting/dataDictionary/index.vue
@@ -1,21 +1,316 @@
<template>
- <div class="container"></div>
+ <div class="silkStandardSetting-container">
+ <div class="filter-card">
+ <CommonSearch :show-add="false" :amount-view="false" placeholder="璇疯緭鍏ュ叧閿瘝" @searchClick="onFilterSearch">
+ <template slot="leftButton">
+ <el-button size="small" type="primary" @click="addBtnClick">鏂板</el-button>
+ <el-button size="small" type="primary" @click="refreshClick">鍒锋柊</el-button>
+ </template>
+ </CommonSearch>
+ </div>
+ <div class="body-card">
+ <div>
+ <div class="bottom-tabs" >
+ <div class="tab-pane" @click="getTab(0)" :style="{
+ background: TabsIndex == 0 ? '#2a78fb' : '#F1F3F8',
+ color: TabsIndex == 0 ? '#fff' : '#666'
+ }">
+ 搴勫彛绠$悊
+ </div>
+ <div class="tab-pane" @click="getTab(1)" :style="{
+ background: TabsIndex == 1 ? '#2a78fb' : '#F1F3F8',
+ color: TabsIndex == 1 ? '#fff' : '#666'
+ }">
+ 杞﹂棿绠$悊
+ </div>
+ <div class="tab-pane" @click="getTab(2)" :style="{
+ background: TabsIndex == 2 ? '#2a78fb' : '#F1F3F8',
+ color: TabsIndex == 2 ? '#fff' : '#666'
+ }">
+ 甯﹀彿棰滆壊
+ </div>
+ <div class="tab-pane" @click="getTab(3)" :style="{
+ background: TabsIndex == 3 ? '#2a78fb' : '#F1F3F8',
+ color: TabsIndex == 3 ? '#fff' : '#666'
+ }">
+ 瑙勬牸
+ </div>
+ </div>
+ <div class="list-view">
+ <TableCommonView :loading="loading" :table-list="productTableList" @selTableCol="selBottomTableCol">
+ <template slot="tableButton">
+ <el-table-column label="鎿嶄綔" width="160" fixed="right">
+ <template slot-scope="scope">
+ <!-- <el-button>{{ scope.row }}</el-button> -->
+ <el-button @click="rowClick(scope.row,'鏌ョ湅')" type="text" size="small">鏌ョ湅</el-button>
+ <el-button @click="rowClick(scope.row,'淇敼')" type="text" size="small">淇敼</el-button>
+ <el-button @click="rowClick(scope.row,'鍒犻櫎')" type="text" size="small">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </template>
+ </TableCommonView>
+ </div>
+ </div>
+ </div>
+ <AddDataDictionaries
+ :editDiaConfig="editConfig"
+ />
+ </div>
</template>
<script>
+import AddDataDictionaries from "@/views/systemSetting/dataDictionary/components/addDataDictionaries.vue"
+import {getDict} from "@/api/systemSetting/dataDictionary"
export default {
name: "dataDictionary",
props: {},
- components: {},
+ components: {AddDataDictionaries},
mixins: [],
computed: {},
data() {
- return {}
+ return {
+ TabsIndex:0,
+ loading: false,
+ productTableList: {},
+ editConfig:{
+ visible:false,
+ dialogTitleType:"搴勫彛",
+ infomitton:{
+ TabsIndex:0,
+ }
+ },
+ tableColumn: [
+ { label: "搴忓彿", prop: "number",},
+ { label: "搴勫彛鍚嶇О", prop: "name",},
+ { label: "鎻忚堪", prop: "remark" },
+ ],
+ showCol: ["搴忓彿","搴勫彛鍚嶇О", "鎻忚堪",],
+ workshopTableColumn:[
+ { label: "缂栫爜", prop: "number" },
+ { label: "杞﹂棿鍚嶇О", prop: "name" },
+ { label: "鎻忚堪", prop: "remark" },
+ ],
+ showWorkshopCol: ["缂栫爜","杞﹂棿鍚嶇О", "鎻忚堪",],
+ colorTableColumn:[
+ { label: "甯﹀彿棰滆壊", prop: "member_name" },
+ { label: "鎻忚堪", prop: "remark" },
+ ],
+ showColorCol: ["甯﹀彿棰滆壊", "鎻忚堪",],
+ specsTableColumn:[
+ { label: "瑙勬牸", prop: "member_name" },
+ { label: "鎻忚堪", prop: "remark" },
+ ],
+ showSpecsCol: ["瑙勬牸", "鎻忚堪",],
+ getDataParams:{
+ page: 1,
+ pageSize:10,
+ dictType:0,
+ },
+ }
},
- created() {},
- methods: {}
+ created() {
+ this.getProductOrderInfo()
+ // this.setTable()
+ this.getData()
+ },
+ methods: {
+ // 鎼滅储
+ onFilterSearch(searchText) {
+ console.log(searchText)
+ },
+ // 鏂板
+ addBtnClick() {
+ this.editConfig.dialogTitle="鏂板"
+ this.editConfig.visible=true
+ },
+ // 鍒锋柊
+ refreshClick() {
+ console.log("a")
+ },
+ // 鎵撳嵃
+ printClick() {
+ console.log("a")},
+ //tabs鍒囨崲
+ getTab(tab) {
+ this.TabsIndex = tab
+ this.editConfig.infomitton.TabsIndex=tab
+ // if (this.TabsIndex == 1) {
+ // this.isRequest = true;
+ // } else {
+ // this.isRequest = false;
+ // }
+ this.getProductOrderInfo()
+ },
+ // setTable() {
+ // this.tableBottomColumn = this.tableColumn
+ // this.showBottomCol = this.showCol
+ // this.setBottomList()
+ // },
+ selTableCol(val) {
+ this.showcol = val
+ this.tableList.tableColumn = this.setColumnVisible(val, this.tableColumn)
+ },
+ async getProductOrderInfo() {
+ this.getData()
+ if (this.TabsIndex == 0) {
+ // 搴勫彛绠$悊
+ this.editConfig.dialogTitleType="搴勫彛"
+ this.tableBottomColumn = this.tableColumn // 琛ㄥご
+ this.showBottomCol = this.showCol // 鍔ㄦ�佽〃澶�
+ this.setBottomList()
+ }else if (this.TabsIndex == 1) {
+ // 杞﹂棿绠$悊
+ this.editConfig.dialogTitleType="杞﹂棿"
+ this.tableBottomColumn = this.workshopTableColumn
+ this.showBottomCol = this.showWorkshopCol
+ this.setBottomList()
+ } else if (this.TabsIndex == 2) {
+ // 甯﹀彿棰滆壊
+ this.editConfig.dialogTitleType="甯﹀彿棰滆壊"
+ this.tableBottomColumn = this.colorTableColumn
+ this.showBottomCol = this.showColorCol
+ this.setBottomList()
+
+ } else if (this.TabsIndex == 3) {
+ // 瑙勬牸
+ this.editConfig.dialogTitleType="瑙勬牸"
+ this.tableBottomColumn = this.specsTableColumn
+ this.showBottomCol = this.showSpecsCol
+ this.setBottomList()
+ }
+
+ this.loading = true
+ // this.getProductInventoryInfo(number)
+ // await getProductOrderInfo(number)
+ // .then((res) => {
+ // this.productDataBottom = res;
+ // this.getListValue(this.productDataBottom)
+ // })
+ // .catch(() => {
+ // this.productTableList.tableInfomation = []
+ // })
+ this.loading = false
+ },
+ setBottomList() {
+ this.productTableList = {
+ selectIndex: true,
+ tableInfomation: [],
+ allcol: [],
+ showcol: this.showBottomCol,
+ tableColumn: this.setColumnVisible(this.showBottomCol, this.tableBottomColumn)
+ }
+ this.setTableList(this.productTableList)
+ },
+ selBottomTableCol(val) {
+ this.showcol = val
+ this.productTableList.tableColumn = this.setColumnVisible(val, this.tableBottomColumn)
+ },
+ setTableList(tableList) {
+ tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
+ this.searchOptions = []
+ for (let i = 0; i < tableList.tableColumn.length; i++) {
+ const label = tableList.tableColumn[i].label
+ const value = tableList.tableColumn[i].prop
+ this.searchOptions.push({ value: value, label: label })
+ }
+ },
+ setColumnVisible(showCol, tableColumn) {
+ return tableColumn.map((ele) => {
+ return {
+ ...ele,
+ isShowColumn: showCol.includes(ele.label)
+ }
+ })
+ },
+ getData(){
+ getDict({
+ dictType:this.TabsIndex,
+ page:this.getDataParams.page,
+ pageSize:this.getDataParams.pageSize,
+ }).then((res)=>{
+ console.log(res,"res")
+ this.productTableList.tableInfomation=res.data
+ })
+ },
+ rowClick(row,type){
+ if(type==="鏌ョ湅"){
+ this.editConfig.dialogTitle="鏌ョ湅"
+ this.editConfig.visible=true
+ }else if(type==="淇敼"){
+ this.editConfig.dialogTitle="淇敼"
+ this.editConfig.visible=true
+ }else if(type==="鍒犻櫎"){
+ console.log("鍒犻櫎")
+ }
+ }
+ }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.silkStandardSetting-container {
+ height: 100%;
+
+ .filter-card {
+ margin: 20px 30px;
+ height: 80px;
+ display: flex;
+ align-items: center;
+ padding: 0 20px 0 20px;
+ border-radius: 4px;
+ background-color: #fff;
+ }
+
+ .body-card {
+ margin: 0 30px;
+ background-color: #fff;
+ padding: 10px 15px;
+ height: calc(100% - 180px);
+ border-radius: 4px;
+
+ .edit-save {
+ display: flex;
+ align-items: center;
+ margin-bottom: 10px;
+
+ .edit-save-icon {
+ font-size: 24px;
+ color: #5582f3;
+ cursor: pointer;
+ }
+
+ .edit-sace-label {
+ margin-left: 10px;
+ font-size: 14px;
+ color: #000000d8;
+ }
+ }
+ }
+}
+
+.bottom-tabs {
+ height: 40px;
+ line-height: 40px;
+ // background: #e6ecf2;
+ display: flex;
+
+ .tab-pane {
+ width: 100px;
+ margin-right: 20px;
+ font-size: 14px !important;
+ text-align: center;
+ cursor: pointer;
+ background: #2a78fb;
+ border-top-left-radius: 20px;
+ border-top-right-radius: 20px;
+ }
+}
+
+.bgcGrey {
+ background: #fff;
+}
+
+.bgcWhite {
+ background: #fff !important;
+}</style>
diff --git a/src/views/systemSetting/encodeManage/components/addWorkshop.vue b/src/views/systemSetting/encodeManage/components/addWorkshop.vue
new file mode 100644
index 0000000..d6bea83
--- /dev/null
+++ b/src/views/systemSetting/encodeManage/components/addWorkshop.vue
@@ -0,0 +1,62 @@
+<template>
+ <div class="add_wordshop">
+ <el-dialog
+ title="鎻愮ず"
+ :visible.sync="editConfig.visible"
+ width="30%"
+ :before-close="handleClose">
+ <span>杩欐槸涓�娈典俊鎭�</span>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="editConfig.visible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="editConfig.visible = false">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+export default {
+ props: {
+ editDiaConfig:{
+ type: Object,
+ default: () => {
+ return {
+ visible: false,
+ infomitton: {
+
+ }
+ }
+ }
+ }
+ },
+ data() {
+ return {
+ editConfig:this.editDiaConfig
+ };
+ },
+ computed: {
+
+ },
+ created() {
+
+ },
+ mounted() {
+
+ },
+ watch: {
+
+ },
+ methods: {
+ handleClose(done) {
+ done();
+ }
+ },
+ components: {
+
+ },
+};
+</script>
+
+<style scoped lang="scss">
+
+</style>
diff --git a/src/views/systemSetting/encodeManage/components/silkTableList.vue b/src/views/systemSetting/encodeManage/components/silkTableList.vue
new file mode 100644
index 0000000..8875782
--- /dev/null
+++ b/src/views/systemSetting/encodeManage/components/silkTableList.vue
@@ -0,0 +1,402 @@
+<template>
+ <div class="page-view">
+ <div class="top-box">
+ <div class="table-box" :style="{ width: detailEnter ? '95%' : '100%' }">
+ <el-form ref="form" :model="tableList" :show-message="false" label-position="right">
+ <el-table
+ ref="fromTable"
+ :data="tableList.tableData"
+ style="width: 100%"
+ @selection-change="handleSelectionChange"
+ :row-key="(row) => row.productId"
+ :header-cell-style="{ background: '#f1f3f8', color: '#000009', 'font-size': '14px' }"
+ border
+ >
+ <el-table-column v-if="selectBox" type="selection" :reserve-selection="true" width="40" align="center">
+ </el-table-column>
+ <el-table-column
+ v-if="tableList.isReturn"
+ type="index"
+ label="#"
+ width="50"
+ align="center"
+ ></el-table-column>
+ <el-table-column
+ v-for="(item, i) in tableList.tableColumn"
+ :key="i"
+ :prop="item.prop"
+ :label="item.label"
+ :width="item.width"
+ :min-width="item.min"
+ align="center"
+ >
+ <!-- 琛ㄥご鏍峰紡 -->
+ <template slot="header">
+ <span v-if="item.isRequird" style="color: #f56c6c">*</span>
+ <div v-else-if="item.addColumn" class="add-column-box">
+ <el-input
+ placeholder="璇疯緭鍏�"
+ v-model="item.label"
+ size="mini"
+ clearable
+ @change="
+ (val) => {
+ addColumnInputChange(val, item.prop)
+ }
+ "
+ ></el-input>
+ <div class="common-select-btn" @click="clearupColumn(item.prop)">
+ <i class="el-icon-remove" title="鍒犻櫎"></i>
+ </div>
+ </div>
+ <span v-else>{{ item.label }}</span>
+ </template>
+ <!-- column鏍峰紡 -->
+ <template slot-scope="scope">
+ <template v-if="detailEnter">
+ <el-form-item
+ v-if="item.input"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
+ <el-input
+ v-model.trim="scope.row[item.prop]"
+ maxlength="50"
+ size="mini"
+ :disabled="!isOperate"
+ @change="
+ (val) => {
+ commonInputChange(val, item.prop, scope.row, scope)
+ }
+ "
+ ></el-input>
+ </el-form-item>
+ <el-form-item
+ v-else-if="item.projectName"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ >
+ <div class="custom-name">
+ <el-select v-model="scope.row[item.prop]" clearable size="mini" placeholder="璇烽�夋嫨">
+ <el-option
+ v-for="(item, index) in projectOptions"
+ :key="index"
+ :label="item.value"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ <div class="common-select-btn" @click="clearupClient(scope)">
+ <i class="el-icon-remove" title="鍒犻櫎"></i>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item
+ v-else-if="item.inputNumber"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
+ <el-input-number
+ v-model="scope.row[item.prop]"
+ placeholder=""
+ :min="0"
+ :controls="false"
+ :disabled="!isOperate"
+ size="mini"
+ style="width: 100%; margin-right: 5px"
+ @change="
+ (val) => {
+ commonInputChange(val, item.prop, scope.row, scope)
+ }
+ "
+ ></el-input-number>
+ </el-form-item>
+ <el-form-item
+ v-else-if="item.inputFloat"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
+ <el-input-number
+ v-model="scope.row[item.prop]"
+ placeholder=""
+ :min="0"
+ :precision="4"
+ :disabled="!isOperate"
+ :controls="false"
+ size="mini"
+ style="width: 100%; margin-right: 5px"
+ @change="
+ (val) => {
+ commonInputChange(val, item.prop, scope.row, scope)
+ }
+ "
+ ></el-input-number>
+ </el-form-item>
+ <span v-else>
+ <template>
+ {{ scope.row[item.prop] }}
+ </template>
+ </span>
+ </template>
+ <el-form-item
+ v-else-if="item.inputNumber && selectBox"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
+ <el-input-number
+ v-model="scope.row[item.prop]"
+ placeholder=""
+ :min="0"
+ :controls="false"
+ :disabled="!isOperate"
+ size="mini"
+ style="width: 100%; margin-right: 5px"
+ @change="
+ (val) => {
+ commonInputChange(val, item.prop, scope.row, scope)
+ }
+ "
+ ></el-input-number>
+ </el-form-item>
+ <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="80" v-if="!detailEnter" align="center">
+ <template slot-scope="scope">
+ <el-button type="text" size="small" :disabled="!isOperate" @click="deleteClick(scope)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ <slot name="tableButton" />
+ <div slot="empty">
+ <el-empty description="鏆傛棤鏁版嵁"></el-empty>
+ </div>
+ </el-table>
+ </el-form>
+ </div>
+ <div
+ v-if="detailEnter"
+ class="add-column-box"
+ @click="addColumnClick"
+ :style="{ width: detailEnter ? '40px' : '0px' }"
+ >
+ <i class="el-icon-circle-plus"></i>
+ </div>
+ </div>
+ <div v-if="detailEnter" style="margin: 10px">
+ <div class="add-btn-box" @click="addRowClick">
+ <i class="el-icon-circle-plus"></i>
+ </div>
+ <!-- <el-button size="small" type="primary" :disabled="!isOperate" @click="add">鏂板</el-button> -->
+ <!-- <el-button size="small" type="primary" disabled>瀵煎叆鏄庣粏</el-button> -->
+ </div>
+ </div>
+</template>
+
+<script>
+// import { getProductList } from "@/api/common/other"
+export default {
+ name: "CommmonFormTableView",
+ components: {},
+ props: {
+ detailEnter: {
+ type: Boolean,
+ default: false
+ },
+ selectBox: {
+ type: Boolean,
+ default: false
+ },
+ // 閭d釜椤甸潰 鐢ㄦ潵鍒ゆ柇璁$畻鏂瑰紡
+ pageName: {
+ type: String,
+ default: ""
+ },
+ // 鍒楄〃鏂板鏄惁澶氶��
+ addTypeIdMultiple: {
+ type: Boolean,
+ default: false
+ },
+ // 鏍规嵁鎶ヤ环鍗曟煡璇骇鍝�
+ quotationNumber: {
+ type: [String, Number],
+ default: ""
+ },
+ // 鏄惁鍙互鎿嶄綔 娣诲姞绛�
+ isOperate: {
+ type: Boolean,
+ default: true
+ },
+ silkTableList: {
+ type: Object,
+ default: () => {
+ return {
+ tableData: [], // 鎺ュ彛杩斿洖鏁版嵁
+ isReturn: false,
+ tableColumn: [
+ // table琛ㄥ崟
+ { label: "", prop: "", min: 200, tooltip: true }
+ ]
+ }
+ }
+ }
+ },
+ data() {
+ return {
+ total: 0,
+ productList: [],
+ tableList: [],
+ projectIndex: 0,
+ projectOptions: [
+ { id: 1, value: "绾ゅ害鍋忓樊" },
+ { id: 2, value: "浜屾鍙樺寲" },
+ { id: 3, value: "娓呮磥鍒�" },
+ { id: 4, value: "娲佸噣鍒�" },
+ { id: 5, value: "鏈�澶у亸宸�" }
+ ]
+ }
+ },
+ created() {
+ // if (!this.selectBox) {
+ // this.getProductList()
+ // }
+ this.getTableInfo()
+ },
+ watch: {
+ silkTableList: {
+ handler() {
+ this.getTableInfo()
+ },
+ immediate: true
+ }
+ },
+ computed: {},
+ methods: {
+ getTableInfo() {
+ this.tableList = this.silkTableList
+ if (this.tableList.tableData.length === 1 && this.tableList.tableData[0].name === "") {
+ this.isRecalculate = false
+ } else {
+ this.isRecalculate = true
+ }
+ },
+ // 澶氶��
+ handleSelectionChange(val) {
+ this.$emit("getSelectArray", val)
+ },
+
+ // 鏂板
+ addRowClick() {
+ if (this.addTypeIdMultiple) {
+ this.projectIndex = this.tableList.tableData.length
+ this.editSelCommonConfig.title = "浜у搧鍚嶇О"
+ this.editSelCommonConfig.isSelectBox = true
+ this.editSelCommonConfig.editVisible = true
+ } else {
+ this.$emit("addProjectClick")
+ }
+ },
+ commonInputChange(val, prop, row, scope) {
+ this.$emit("inputContent", val, prop, row, scope)
+ },
+ // 鍒犻櫎
+ deleteClick(scope) {
+ this.$emit("clearupProject", this.tableList.tableData, scope.$index)
+ },
+ // 鍒犻櫎
+ clearupClient(scope) {
+ this.$emit("clearupProject", this.tableList.tableData, scope.$index)
+ },
+ // 娣诲姞鍒楁寜閽�
+ addColumnClick() {
+ this.$emit("addColumnClick")
+ },
+ // 娣诲姞鍒楀ご閮ㄦ爣棰樿緭鍏�
+ addColumnInputChange(val, prop) {
+ console.log(val, prop, "娣诲姞鍒楀ご閮ㄦ爣棰樿緭鍏�")
+ },
+ // 鍒犻櫎鍒�
+ clearupColumn(prop) {
+ console.log(prop)
+ this.$emit("clearupColumn", prop)
+ }
+ },
+ //瑙e喅琛ㄦ牸鎶栧姩闂
+ beforeUpdate() {
+ this.$nextTick(() => {
+ this.$refs["fromTable"].doLayout()
+ })
+ }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style lang="scss" scoped>
+.page-view {
+ .top-box {
+ display: flex;
+ .table-box {
+ flex: 1;
+ .el-form-item {
+ margin-bottom: 0;
+ .custom-name {
+ display: flex;
+ .common-select-btn {
+ margin-left: 5px;
+ font-size: 18px;
+ cursor: pointer;
+ color: #ff0000;
+ }
+ }
+ }
+ }
+ .add-column-box {
+ // width: 40px;
+ margin-top: 10px;
+ font-size: 26px;
+ color: #5582f3;
+ margin-left: 20px;
+ cursor: pointer;
+ }
+ }
+ .add-btn-box {
+ font-size: 26px;
+ color: #5582f3;
+ margin-left: 50px;
+ cursor: pointer;
+ }
+ .add-column-box {
+ display: flex;
+ .common-select-btn {
+ margin-left: 5px;
+ font-size: 18px;
+ cursor: pointer;
+ color: #ff0000;
+ }
+ }
+}
+::v-deep {
+ .el-form-item__label {
+ display: none;
+ }
+ .el-table__footer-wrapper tbody td.el-table__cell {
+ background-color: #fff;
+ // text-align: right;
+ font-weight: bold;
+ }
+ .el-input--suffix .el-input__inner {
+ padding-right: 0px;
+ }
+ .el-table .cell,
+ .el-table th.el-table__cell > .cell {
+ padding: 0 5px;
+ }
+ .el-input__inner {
+ // text-align: left;
+ text-align: center !important;
+ }
+}
+</style>
diff --git a/src/views/systemSetting/encodeManage/index.vue b/src/views/systemSetting/encodeManage/index.vue
index 62b78c9..b069a09 100644
--- a/src/views/systemSetting/encodeManage/index.vue
+++ b/src/views/systemSetting/encodeManage/index.vue
@@ -1,21 +1,186 @@
<template>
- <div class="container"></div>
+ <div class="silkStandardSetting-container">
+ <div class="filter-card">
+ <CommonSearch :show-add="false" :amount-view="false" placeholder="璇疯緭鍏ュ叧閿瘝" @searchClick="onFilterSearch">
+ <template slot="leftButton">
+ <el-button size="small" type="primary" @click="addBtnClick" >鏂板</el-button>
+ <el-button size="small" type="primary" @click="delBtnClick" >鍒犻櫎</el-button>
+ <el-button size="small" type="primary" @click="addBtnClick" >淇敼</el-button>
+ <el-button size="small" type="primary" @click="refreshClick">鍒锋柊</el-button>
+ </template>
+ </CommonSearch>
+ </div>
+ <div class="body-card">
+ <!-- <div class="edit-save">
+ <div class="edit-save-icon" @click="editSaveClick">
+ <i :class="isEdit ? 'el-icon-unlock' : 'el-icon-lock'"></i>
+ </div>
+ <div class="edit-sace-label">{{ isEdit ? "閿佸畾淇濆瓨" : "鐣岄潰璁捐" }}</div>
+ </div> -->
+ <div>
+ <SilkTableList
+ :detail-enter="isEdit"
+ :silk-table-list="silkTableList"
+ @inputContent="inputContent"
+ @addProjectClick="addBtnClick"
+ @clearupProject="clearupProject"
+ @deleteClick="clearupProject"
+ @addColumnClick="addColumnClick"
+ @clearupColumn="clearupColumn"
+ >
+ </SilkTableList>
+ </div>
+ </div>
+ </div>
</template>
<script>
+import SilkTableList from "@/views/systemSetting/workshopManage/components/silkTableList"
export default {
name: "encodeManage",
props: {},
- components: {},
+ components: { SilkTableList },
mixins: [],
computed: {},
data() {
- return {}
+ return {
+ isEdit: false,
+ silkTableList: {},
+ tableData: [],
+ tableColumn: [
+ { label: "缂栫爜鍚嶇О", prop: "projectName", projectName: true },
+ { label: "缂栫爜绫诲瀷", prop: "start", inputFloat: true },
+ { label: "鎻忚堪", prop: "end", inputFloat: true },
+ ],
+ columnNum: 0,
+ dataObj: {
+ projectName: "",
+ start: 0,
+ end: 0,
+ price1: 0,
+ price2: 0,
+ price3: 0
+ }
+ }
},
- created() {},
- methods: {}
+ created() {
+ this.setTableForm()
+ },
+ methods: {
+ setTableForm() {
+ this.silkTableList = {
+ tableData: this.tableData,
+ isReturn: false,
+ tableColumn: this.tableColumn
+ }
+ },
+ // 鎼滅储
+ onFilterSearch(searchText) {
+ console.log(searchText)
+ },
+ // 鏂板
+ addBtnClick() {
+ if(this.isEdit){
+ this.$message.warning("璇峰厛淇濆瓨褰撳墠缂栬緫")
+ }else{
+ this.isEdit = true
+ // array.splice(index, 0, item)
+ this.tableData.splice(0,0,{
+ projectName: "",
+ start: 0,
+ end: 0,
+ price1: 0,
+ price2: 0,
+ price3: 0,
+ isAdd:true,
+ })
+ }
+
+
+ },
+ // 淇濆瓨
+ saveBtnClick(){
+ this.tableData.forEach((item)=>{
+ item.isAdd=false
+ })
+ this.isEdit = false
+ },
+ // 鍒锋柊
+ refreshClick() {},
+ // 鎵撳嵃
+ printClick() {},
+ // 鍒楄〃杈撳叆鍥炶皟
+ inputContent(val, prop, row) {
+ console.log(val, prop, row,"鍒楄〃鎵撳嵃鍥炶皟")
+ },
+ // 鍒犻櫎
+ clearupProject(data, index) {
+ console.log(data)
+ this.tableData.splice(index, 1)
+ },
+ // 淇濆瓨缂栬緫鎸夐挳鍒囨崲
+ editSaveClick() {
+ this.isEdit = !this.isEdit
+ },
+ // 娣诲姞鍒�
+ addColumnClick() {
+ let propStr = "trends" + this.columnNum
+ this.tableColumn.splice(2, 0, { label: "", prop: propStr, inputFloat: true, addColumn: true })
+ this.$set(this.dataObj, propStr, 0)
+ console.log(this.tableColumn)
+ this.silkTableList.tableColumn = this.tableColumn
+ this.columnNum += 1
+ },
+ // 鍒犻櫎鍒�
+ clearupColumn(prop) {
+ let currentIndex = 0
+ this.tableColumn.map((item, index) => {
+ if (item.prop == prop) {
+ currentIndex = index
+ }
+ })
+ this.tableColumn.splice(currentIndex, 1)
+ this.silkTableList.tableColumn = this.tableColumn
+ this.$delete(this.dataObj, prop)
+ }
+ }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.silkStandardSetting-container {
+ height: 100%;
+ .filter-card {
+ margin: 20px 30px;
+ height: 80px;
+ display: flex;
+ align-items: center;
+ padding: 0 20px 0 20px;
+ border-radius: 4px;
+ background-color: #fff;
+ }
+ .body-card {
+ margin: 0 30px;
+ background-color: #fff;
+ padding: 10px 15px;
+ height: calc(100% - 180px);
+ border-radius: 4px;
+ .edit-save {
+ display: flex;
+ align-items: center;
+ margin-bottom: 10px;
+ .edit-save-icon {
+ font-size: 24px;
+ color: #5582f3;
+ cursor: pointer;
+ }
+ .edit-sace-label {
+ margin-left: 10px;
+ font-size: 14px;
+ color: #000000d8;
+ }
+ }
+ }
+}
+</style>
diff --git a/src/views/systemSetting/silkPriceStandard/components/silkTableList.vue b/src/views/systemSetting/silkPriceStandard/components/silkTableList.vue
index 829f842..baa5c52 100644
--- a/src/views/systemSetting/silkPriceStandard/components/silkTableList.vue
+++ b/src/views/systemSetting/silkPriceStandard/components/silkTableList.vue
@@ -177,14 +177,14 @@
</el-table>
</el-form>
</div>
- <div
+ <!-- <div
v-if="detailEnter"
class="add-column-box"
@click="addColumnClick"
:style="{ width: detailEnter ? '40px' : '0px' }"
>
<i class="el-icon-circle-plus"></i>
- </div>
+ </div> -->
</div>
<div v-if="detailEnter" style="margin: 10px">
<div class="add-btn-box" @click="addRowClick">
diff --git a/src/views/systemSetting/silkPriceStandard/index.vue b/src/views/systemSetting/silkPriceStandard/index.vue
index 2645a3d..17559ac 100644
--- a/src/views/systemSetting/silkPriceStandard/index.vue
+++ b/src/views/systemSetting/silkPriceStandard/index.vue
@@ -4,22 +4,15 @@
<CommonSearch :show-add="false" :amount-view="false" placeholder="璇疯緭鍏ュ叧閿瘝" @searchClick="onFilterSearch">
<template slot="leftButton">
<el-button size="small" type="primary" @click="addBtnClick" >鏂板</el-button>
- <!-- <el-button size="small" type="primary" @click="delBtnClick" >鍒犻櫎</el-button> -->
+ <el-button size="small" type="primary" @click="delBtnClick" >鍒犻櫎</el-button>
<el-button size="small" type="primary" @click="saveBtnClick" >淇濆瓨</el-button>
- |
- <!-- <el-button size="small" type="primary" @click="addBtnClick" >淇敼</el-button> -->
+ <el-button size="small" type="primary" @click="addBtnClick" >淇敼</el-button>
<el-button size="small" type="primary" @click="refreshClick">鍒锋柊</el-button>
<el-button size="small" type="primary" @click="printClick">鎵撳嵃</el-button>
</template>
</CommonSearch>
</div>
<div class="body-card">
- <!-- <div class="edit-save">
- <div class="edit-save-icon" @click="editSaveClick">
- <i :class="isEdit ? 'el-icon-unlock' : 'el-icon-lock'"></i>
- </div>
- <div class="edit-sace-label">{{ isEdit ? "閿佸畾淇濆瓨" : "鐣岄潰璁捐" }}</div>
- </div> -->
<div>
<SilkTableList
:detail-enter="isEdit"
@@ -147,7 +140,11 @@
this.tableColumn.splice(currentIndex, 1)
this.silkTableList.tableColumn = this.tableColumn
this.$delete(this.dataObj, prop)
- }
+ },
+ // 鍒犻櫎
+ delBtnClick(){
+
+ },
}
}
</script>
diff --git a/src/views/systemSetting/workshopManage/components/addDialog.vue b/src/views/systemSetting/workshopManage/components/addDialog.vue
new file mode 100644
index 0000000..c88406a
--- /dev/null
+++ b/src/views/systemSetting/workshopManage/components/addDialog.vue
@@ -0,0 +1,213 @@
+<template>
+ <div class="add_wordshop">
+ <el-dialog
+ :title="editConfig.dialogTitle+'杞﹂棿绠$悊'"
+ :visible.sync="editConfig.visible"
+ width="30%"
+ :before-close="handleClose">
+ <el-form :inline="true" label-width="20%" style="width: 100%;" :model="form" >
+ <el-form-item label="杞﹂棿" style="width: 100%;" >
+ <el-select
+ :disabled="this.editConfig.dialogTitle==='鏌ョ湅'" v-model="editConfig.infomitton.workshopNumber" placeholder="璇烽�夋嫨杞﹂棿">
+ <el-option
+ v-for="item in workshopList"
+ :key="item.ID"
+ :label="item.name"
+ :value="item.ID">
+ </el-option>
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="缁勫埆" style="width: 100%;" >
+ <!-- <el-input-number
+ v-model="form.workshopNumber"
+ placeholder="璇疯緭鍏ョ粍鍒�"
+ :controls="false"
+ style="width: 100%; margin-right: 5px;text-align:left;"
+ ></el-input-number> -->
+ <el-input
+ :disabled="this.editConfig.dialogTitle==='鏌ョ湅'"
+ v-model="editConfig.infomitton.groupNumber"
+ :rows="4"
+ style="resize: none !important;"
+ placeholder="璇疯緭鍏ョ粍鍒�"
+ >
+ </el-input>
+ </el-form-item>
+
+ <el-form-item label="寮�濮嬭溅鍙�" style="width: 100%;" >
+ <el-input
+ :disabled="this.editConfig.dialogTitle==='鏌ョ湅'"
+ v-model="editConfig.infomitton.startCarNumber"
+ :rows="4"
+ style="resize: none !important;"
+ placeholder="璇疯緭鍏ュ紑濮嬭溅鍙�"
+ >
+ </el-input>
+ </el-form-item>
+ <el-form-item label="缁撴潫杞﹀彿" style="width: 100%;" >
+ <el-input
+ :disabled="this.editConfig.dialogTitle==='鏌ョ湅'"
+ v-model="editConfig.infomitton.endCarNumber"
+ :rows="4"
+ style="resize: none !important;"
+ placeholder="璇疯緭鍏ョ粨鏉熻溅鍙�"
+ >
+ </el-input>
+ </el-form-item>
+ <el-form-item label="鍗婅溅鏍囧織" style="width: 100%;" >
+ <el-select
+ :disabled="this.editConfig.dialogTitle==='鏌ョ湅'" v-model="editConfig.infomitton.carFlag" placeholder="璇烽�夋嫨鍗婅溅鏍囧織">
+ <el-option
+ v-for="item in carFlagList"
+ :key="item.id"
+ :label="item.name"
+ :value="item.id">
+ </el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="澶囨敞" style="width: 100%;" >
+ <el-input
+ :disabled="this.editConfig.dialogTitle==='鏌ョ湅'"
+ v-model="editConfig.infomitton.notes"
+ type="textarea"
+ :rows="4"
+ style="resize: none !important;"
+ placeholder=""
+ >
+ </el-input>
+ </el-form-item>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="editConfig.visible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="commitForm">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {getDict,saveWorkshopManage} from "@/api/systemSetting/workshopManage"
+export default {
+ props: {
+ editDiaConfig:{
+ type: Object,
+ default: () => {
+ return {
+ visible: false,
+ dialogTitle:"娣诲姞",
+ isReadonly:true,
+ infomitton: {
+ workshopNumber:null,
+ groupNumber:null,
+ startCarNumber:null,
+ endCarNumber:null,
+ carFlag:null,
+ notes:null
+ },
+ }
+ }
+ }
+ },
+ data() {
+ return {
+ editConfig:this.editDiaConfig,
+ form: {
+ workshopNumber:null,
+ groupNumber:null,
+ startCarNumber:null,
+ endCarNumber:null,
+ carFlag:null,
+ notes:null
+ },
+ workshopList:[],
+ carFlagList:[
+ {id:1,name:"宸﹀崐杞�"},
+ {id:2,name:"鍙冲崐杞�"},
+ {id:3,name:"鍏ㄨ溅缁撴潫"},
+ ]
+ };
+ },
+ computed: {
+ },
+ created() {
+ this.getDictData()
+ },
+ mounted() {
+
+ },
+ watch: {
+
+ },
+ methods: {
+ handleClose(done) {
+ done();
+ },
+ async getDictData(){
+ await getDict({dictType:1}).then((res)=>{
+ if(res&&res.code===200){
+ this.workshopList=res.data
+ }
+ })
+ },
+ setParams(){
+ let params={
+ workshopNumber:this.editConfig.infomitton.workshopNumber+'',
+ groupNumber:Number(this.editConfig.infomitton.groupNumber),
+ startCarNumber:Number(this.editConfig.infomitton.startCarNumber),
+ endCarNumber:Number(this.editConfig.infomitton.endCarNumber),
+ carFlag:Number(this.editConfig.infomitton.carFlag),
+ notes:this.editConfig.infomitton.notes,
+ // id:Number(this.editConfig.infomitton.workshopId),
+ }
+ return params
+ },
+ async commitForm(){
+ let params=this.setParams()
+ if(this.editConfig.dialogTitle==="鏂板"){
+ await saveWorkshopManage(params).then((res)=>{
+ if(res&&res.code===200){
+ this.editConfig.visible=false
+ this.$message({
+ message: "淇濆瓨鎴愬姛!",
+ type: "success",
+ });
+ this.$parent.getData()
+ }
+ })
+ }else if(this.editConfig.dialogTitle==="淇敼"){
+ this.editConfig.infomitton.workshopNumber=this.editConfig.infomitton.workshopNumber+""
+ await saveWorkshopManage(this.editConfig.infomitton).then((res)=>{
+ if(res&&res.code===200){
+ this.editConfig.visible=false
+ this.$message({
+ message: "淇濆瓨鎴愬姛!",
+ type: "success",
+ });
+ this.$parent.getData()
+ }
+ })
+ }
+ }
+ },
+ components: {
+
+ },
+};
+</script>
+
+<style scoped lang="scss">
+::v-deep .el-form-item__content{
+ width: 70% !important;
+}
+::v-deep{
+ .el-form{
+ .el-input__inner {
+ text-align: left;
+ }
+ }
+ .el-select{
+ width: 100%;
+ }
+}
+</style>
diff --git a/src/views/systemSetting/workshopManage/components/addWorkshop.vue b/src/views/systemSetting/workshopManage/components/addWorkshop.vue
index d6bea83..87497ec 100644
--- a/src/views/systemSetting/workshopManage/components/addWorkshop.vue
+++ b/src/views/systemSetting/workshopManage/components/addWorkshop.vue
@@ -1,62 +1,364 @@
<template>
- <div class="add_wordshop">
- <el-dialog
- title="鎻愮ず"
- :visible.sync="editConfig.visible"
- width="30%"
- :before-close="handleClose">
- <span>杩欐槸涓�娈典俊鎭�</span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editConfig.visible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="editConfig.visible = false">纭� 瀹�</el-button>
- </span>
- </el-dialog>
- </div>
+ <el-dialog
+ :close-on-click-modal="false"
+ :visible.sync="editDialogVisible"
+ width="33rem"
+ class="add-event-dialog"
+ @close="shutdown"
+ append-to-body
+ >
+ <div slot="title" class="tac drawerHeader">娣诲姞杞﹂棿</div>
+ <div class="drawerContent">
+ <el-table
+ v-if="isTableShow"
+ :header-cell-style="{ background: '#f1f3f8', color: '#000009' }"
+ ref="multipleTable"
+ :data="BomTableData"
+ tooltip-effect="dark"
+ height="440"
+ >
+ <el-table-column prop="unit">
+ <template slot="header" slot-scope="scope">
+ <span style="color: #f56c6c">*</span>
+ <span>{{ scope.row }}</span>
+ 鍚嶇О
+ </template>
+ <template slot-scope="scope">
+ <el-input v-model="scope.row.name"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column prop="createdAt" label="璁句负榛樿">
+ <template slot-scope="scope">
+ <el-switch
+ @change="switchChange(scope, scope.row.isDefault)"
+ v-model="scope.row.isDefault"
+ ></el-switch>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="100">
+ <template slot-scope="scope">
+ <i
+ class="el-icon-delete"
+ id="iconStyle"
+ @click="handleDelete(scope.row.id)"
+ ></i>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-button
+ @click="handleAdd()"
+ type="text"
+ class="margin_top_15px margin_left_20px"
+ >鏂板涓嬫媺妗�</el-button
+ >
+ </div>
+ <div slot="footer" class="dialog-footer tac">
+ <!-- <el-button
+ @click="handleAdd()"
+ style="margin-left: 16px; color: #fff; background-color: #ee790c"
+ >鏂板</el-button
+ > -->
+ <el-button @click="shutdown">鍙栨秷</el-button
+ ><el-button
+ type="primary"
+ @click="handleConfirmSave()"
+ style="margin-left: 16px; color: #fff; background-color: #2a78fb"
+ >纭畾</el-button
+ >
+ </div>
+ </el-dialog>
</template>
<script>
+// import { addMaterial, updateMaterial } from "@/api/ProductiveTask/inventory";
+// import { getCodeStandardList } from "@/api/basic/standard";
+// import { postSaveBomKindDict } from "@/api/ProductiveTask/productBom";
+
export default {
+ name: "addWorkshop",
props: {
- editDiaConfig:{
+ title: {
+ type: String,
+ },
+ editRow: {
type: Object,
default: () => {
- return {
- visible: false,
- infomitton: {
-
- }
- }
- }
- }
+ return {};
+ },
+ },
+ workList: {
+ type: Array,
+ },
},
data() {
return {
- editConfig:this.editDiaConfig
+ editDialogVisible: false,
+ isTableShow: true,
+ form: {},
+ BomTableData: [1],
+ work: 1,
+ flag: "add",
+ obj: { name: "", page: 0, pageSize: 0, type: "鐗╂枡缂栫爜" },
+ inputValue: [],
+ codenumer: 0, //姣忔杈撳叆鐨勭紪鐮�
+ codenumberList: [], //鏁存潯缂栫爜
+ sum: 0,
+ explain: "",
+ Tabs: "msg",
+ tableData: [
+ {
+ date: "PEBU",
+ name: "PE甯�",
+ number: "21",
+ unit: "鍚�",
+ },
+ ],
+ rules: {
+ id: [{ required: true, message: "璇疯緭鍏ョ墿鏂欑紪鐮�", trigger: "blur" }],
+ name: [{ required: true, message: "璇疯緭鍏ョ墿鏂欏悕绉�", trigger: "blur" }],
+ specs: [{ required: true, message: "璇疯緭鍏ョ墿鏂欒鏍�", trigger: "blur" }],
+ type: [{ required: true, message: "璇疯緭鍏ョ墿鏂欏瀷鍙�", trigger: "blur" }],
+ amount: [
+ {
+ required: true,
+ message: "璇疯緭鍏ユ暟閲�",
+ trigger: "blur",
+ },
+ ],
+ unit: [
+ {
+ required: true,
+ message: "璇疯緭鍏ュ崟浣�",
+ trigger: "blur",
+ },
+ ],
+ model: [
+ { required: true, message: "璇烽�夋嫨鐗╂枡绫诲瀷", trigger: "change" },
+ ],
+ },
};
},
- computed: {
-
- },
- created() {
-
- },
- mounted() {
-
- },
watch: {
-
+ editDialogVisible(newVal) {
+ if (newVal) {
+ this.BomTableData = this.workList;
+ }
+ },
+ workList(newVal) {
+ console.log(newVal)
+ this.BomTableData = this.workList;
+ },
},
+ mounted() {},
methods: {
- handleClose(done) {
- done();
- }
- },
- components: {
-
+ handleAdd() {
+ this.BomTableData.push({ name: "", isDefault: false });
+ },
+ handleDelete(id) {
+ this.BomTableData = this.BomTableData.filter((i) => {
+ return i.id != id;
+ });
+ },
+ // async getCodeStandardList() {
+ // const res = await getCodeStandardList(this.obj);
+ // this.codenumer = [];
+ // this.sum = 0;
+ // this.explain = "";
+ // const { rules = [] } = res.data[0];
+ // rules.forEach((item, index) => {
+ // this.codenumer.push(item.length);
+ // this.sum++;
+ // // index - 1
+ // // ? (this.explain += item.name + "/")
+ // // : (this.explain += item.name);
+ // this.explain += item.name + (index === rules.length - 1 ? "" : "/");
+ // });
+ // this.$forceUpdate();
+ // },
+ codeList(val) {
+ console.log(val, "codeList");
+ this.inputValue = val;
+ this.codenumberList = val.toString();
+ console.log(this.codenumberList.replace(/,/g, ""));
+ },
+ switchChange(scope, val) {
+ let arr = [];
+ for (let i in this.BomTableData) {
+ if (this.BomTableData[i].isDefault) {
+ arr.push(i);
+ }
+ }
+ if (arr.length > 1) {
+ this.$message({
+ message: "鍙兘璁句竴涓负榛樿",
+ type: "warning",
+ });
+ scope.row.isDefault = !val;
+ }
+ },
+ handleConfirmSave() {
+ let arr = [];
+ for (let i in this.BomTableData) {
+ if (this.BomTableData[i].isDefault) {
+ arr.push(i);
+ }
+ }
+ if (arr.length > 1) {
+ this.$message({
+ message: "鍙兘璁句竴涓负榛樿",
+ type: "warning",
+ });
+ } else {
+ this.$emit("handleConfirmSave", this.BomTableData);
+ }
+ },
+ // async validate() {
+ // try {
+ // if (this.flag == "add")
+ // this.form.id = this.codenumberList.replace(/,/g, "");
+ // this.form.explain = this.explain;
+ // let fn = this.flag == "set" ? updateMaterial : addMaterial;
+ // const res = await fn(this.form);
+ // this.shutdown();
+ // this.$sucessSet("sucessSet");
+ // if (res.code == 200) {
+ // this.$message({
+ // message: this.flag == "set" ? "淇敼鎴愬姛锛�" : "娣诲姞鎴愬姛锛�",
+ // type: "success",
+ // });
+ // }
+ // } catch (err) {
+ // console.log(err);
+ // this.$message({
+ // message: err.message.data.data,
+ // type: "warning",
+ // });
+ // }
+ // },
+ shutdown() {
+ this.editDialogVisible = false;
+ },
},
};
</script>
-<style scoped lang="scss">
+<style lang="scss" scoped>
+.drawer {
+ z-index: 99;
+ border: 2px solid #ccc;
+ border-radius: 20px;
+ background: #fff;
+ width: 25vw !important;
+ height: 600px;
+ #iconStyle {
+ font-size: 20px !important;
+ }
+ .drawerContent {
+ position: relative;
+ overflow-y: auto;
+ padding: 12px 10px 0 10px;
+ padding-top: 12px;
+ margin: auto;
+ width: 25vw;
+ overflow-x: hidden;
+ height: 480px;
+ scrollbar-width: none; /* firefox */
+ -ms-overflow-style: none; /* IE 10+ */
+ ::v-deep .el-tabs__nav-scroll {
+ padding-left: 25px;
+ }
+ .baseTitle {
+ margin: 50px 0 20px;
+ font-weight: bold;
+ }
+ .baseInfo {
+ display: flex;
+ }
+ }
+ .drawerContent::-webkit-scrollbar {
+ display: none; /* Chrome Safari */
+ }
+}
+.drawerFooter {
+ margin-top: 16px;
+ margin-right: 20px;
+ text-align: right;
+ .el-button {
+ width: 80px;
+ height: 38px;
+ border-color: rgba(0, 0, 0, 0.1);
+ font-family: PingFangSC-Medium, sans-serif;
+ color: #000;
+ }
+}
+::v-deep .el-form {
+ width: 389px;
+ .input-box .input-content input {
+ margin: 0;
+ margin-right: 3px;
+ }
+ .el-input__inner,
+ .el-textarea__inner {
+ line-height: 18px;
+ font-family: PingFangSC;
+ }
+}
+::v-deep .el-tabs__header {
+ border: none;
+ .el-tabs__nav {
+ border: none;
+ }
+}
+::v-deep .el-form-item__content {
+ width: 263px;
+ .input-box {
+ width: 263px;
+ }
+}
+::v-deep .el-form-item__label {
+ font-size: 13px !important;
+ color: #000;
+ font-family: PingFangSC;
+ text-align: center !important;
+ width: 60px;
+}
+::v-deep .input-box .input-content input {
+ width: 23px;
+ height: 26px;
+ border-color: rgba(0, 0, 0, 0.1);
+ font-family: PingFangSC;
+}
+::v-deep .el-icon-minus {
+ width: 13px !important;
+ height: 26px !important;
+ line-height: 38px !important;
+ color: #e5e5e5;
+ font-size: 13px;
+}
+::v-deep .el-input__inner {
+ font-size: 13px !important;
+ color: rgba(0, 0, 0, 0.9);
+}
+::v-deep .el-input__inner::placeholder {
+ color: rgba(0, 0, 0, 0.4);
+}
+::v-deep .el-form-item__error {
+ font-family: PingFangSC;
+}
+.self {
+ ::v-deep .el-input__inner {
+ }
+}
+::v-deep .el-select-dropdown {
+ position: absolute !important;
+ top: 36px !important;
+ left: 0px !important;
+}
+::v-deep .el-select-dropdown__wrap {
+ overflow: auto !important;
+}
+::v-deep .el-dialog__body{
+ padding-bottom:10px!important;
+}
</style>
diff --git a/src/views/systemSetting/workshopManage/components/silkTableList.vue b/src/views/systemSetting/workshopManage/components/silkTableList.vue
index 8875782..144358d 100644
--- a/src/views/systemSetting/workshopManage/components/silkTableList.vue
+++ b/src/views/systemSetting/workshopManage/components/silkTableList.vue
@@ -50,6 +50,13 @@
</div>
</div>
<span v-else>{{ item.label }}</span>
+ <span v-if="item.iconRight">
+ <i
+ @click="settingClick(item)"
+ :class="item.iconRight"
+ style="font-size: 16px ;color:#5582F3; margin-left: 5px; cursor: pointer"
+ ></i>
+ </span>
</template>
<!-- column鏍峰紡 -->
<template slot-scope="scope">
@@ -73,17 +80,37 @@
></el-input>
</el-form-item>
<el-form-item
- v-else-if="item.projectName"
+ v-else-if="item.workshop"
label=" "
:prop="'tableData.' + scope.$index + '.' + item.prop"
>
<div class="custom-name">
<el-select v-model="scope.row[item.prop]" clearable size="mini" placeholder="璇烽�夋嫨">
<el-option
- v-for="(item, index) in projectOptions"
+ v-for="(item, index) in workshopList"
:key="index"
- :label="item.value"
- :value="item.value"
+ :label="item.name"
+ :value="item.ID"
+ >
+ </el-option>
+ </el-select>
+ <div class="common-select-btn" @click="clearupClient(scope)">
+ <i class="el-icon-remove" title="鍒犻櫎"></i>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item
+ v-else-if="item.carFlag"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ >
+ <div class="custom-name">
+ <el-select v-model="scope.row[item.prop]" clearable size="mini" placeholder="璇烽�夋嫨">
+ <el-option
+ v-for="(item, index) in carFlagList"
+ :key="index"
+ :label="item.name"
+ :value="item.id"
>
</el-option>
</el-select>
@@ -123,7 +150,6 @@
v-model="scope.row[item.prop]"
placeholder=""
:min="0"
- :precision="4"
:disabled="!isOperate"
:controls="false"
size="mini"
@@ -135,6 +161,25 @@
"
></el-input-number>
</el-form-item>
+ <el-form-item
+ v-else-if="item.showInput"
+ label=" "
+ :prop="'tableData.' + scope.$index + '.' + item.prop"
+ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]"
+ >
+ <el-input
+ v-model="scope.row[item.prop]"
+ placeholder=""
+ size="mini"
+ style="width: 100%; margin-right: 5px"
+ ></el-input>
+ </el-form-item>
+ <!-- 璋冪敤鏂规硶鏄剧ず鏂囧瓧 -->
+ <div v-else-if="item.isCallMethod">
+ <span :class="item.isClass ? item.getClassName(scope.row[item.prop], scope.row) : ''">{{
+ item.getCallMethod(scope.row[item.prop], scope.row)
+ }}</span>
+ </div>
<span v-else>
<template>
{{ scope.row[item.prop] }}
@@ -161,7 +206,14 @@
}
"
></el-input-number>
+
</el-form-item>
+ <!-- 璋冪敤鏂规硶鏄剧ず鏂囧瓧 -->
+ <div v-else-if="item.isCallMethod">
+ <span :class="item.isClass ? item.getClassName(scope.row[item.prop], scope.row) : ''">{{
+ item.getCallMethod(scope.row[item.prop], scope.row)
+ }}</span>
+ </div>
<span v-else style="text-align: right">{{ scope.row[item.prop] }}</span>
</template>
</el-table-column>
@@ -177,14 +229,14 @@
</el-table>
</el-form>
</div>
- <div
+ <!-- <div
v-if="detailEnter"
class="add-column-box"
@click="addColumnClick"
:style="{ width: detailEnter ? '40px' : '0px' }"
>
<i class="el-icon-circle-plus"></i>
- </div>
+ </div> -->
</div>
<div v-if="detailEnter" style="margin: 10px">
<div class="add-btn-box" @click="addRowClick">
@@ -198,6 +250,7 @@
<script>
// import { getProductList } from "@/api/common/other"
+import {getDict } from "@/api/systemSetting/dataDictionary"
export default {
name: "CommmonFormTableView",
components: {},
@@ -256,7 +309,18 @@
{ id: 3, value: "娓呮磥鍒�" },
{ id: 4, value: "娲佸噣鍒�" },
{ id: 5, value: "鏈�澶у亸宸�" }
- ]
+ ],
+ workshopList:[],// 杞﹂棿鍒楄〃
+ carFlagList:[
+ {name:"宸﹀崐杞�",id:1},
+ {name:"鍙冲崐杞�",id:2},
+ {name:"鍏ㄨ溅缁撴潫",id:3},
+ ],//鍗婅溅鏍囧織
+ getDataParams:{
+ page: 1,
+ pageSize:10,
+ dictType:1,
+ },
}
},
created() {
@@ -264,6 +328,7 @@
// this.getProductList()
// }
this.getTableInfo()
+ this.getWorkshopList()
},
watch: {
silkTableList: {
@@ -275,6 +340,10 @@
},
computed: {},
methods: {
+ // 鑷畾涔夎〃澶寸偣鍑讳簨浠�
+ settingClick(item) {
+ this.$emit("settingClick", item);
+ },
getTableInfo() {
this.tableList = this.silkTableList
if (this.tableList.tableData.length === 1 && this.tableList.tableData[0].name === "") {
@@ -322,6 +391,16 @@
clearupColumn(prop) {
console.log(prop)
this.$emit("clearupColumn", prop)
+ },
+ async getWorkshopList(){
+ await getDict({
+ dictType:this.getDataParams.dictType,
+ page:this.getDataParams.page,
+ pageSize:this.getDataParams.pageSize,
+ }).then((res)=>{
+ console.log(res,"res")
+ this.workshopList=res.data
+ })
}
},
//瑙e喅琛ㄦ牸鎶栧姩闂
@@ -329,7 +408,7 @@
this.$nextTick(() => {
this.$refs["fromTable"].doLayout()
})
- }
+ },
}
</script>
diff --git a/src/views/systemSetting/workshopManage/index.vue b/src/views/systemSetting/workshopManage/index.vue
index e029789..2864e5a 100644
--- a/src/views/systemSetting/workshopManage/index.vue
+++ b/src/views/systemSetting/workshopManage/index.vue
@@ -4,150 +4,217 @@
<CommonSearch :show-add="false" :amount-view="false" placeholder="璇疯緭鍏ュ叧閿瘝" @searchClick="onFilterSearch">
<template slot="leftButton">
<el-button size="small" type="primary" @click="addBtnClick" >鏂板</el-button>
- <!-- <el-button size="small" type="primary" @click="delBtnClick" >鍒犻櫎</el-button> -->
- <el-button size="small" type="primary" @click="saveBtnClick" >淇濆瓨</el-button>
- |
- <!-- <el-button size="small" type="primary" @click="addBtnClick" >淇敼</el-button> -->
<el-button size="small" type="primary" @click="refreshClick">鍒锋柊</el-button>
<el-button size="small" type="primary" @click="printClick">鎵撳嵃</el-button>
</template>
</CommonSearch>
</div>
<div class="body-card">
- <!-- <div class="edit-save">
- <div class="edit-save-icon" @click="editSaveClick">
- <i :class="isEdit ? 'el-icon-unlock' : 'el-icon-lock'"></i>
- </div>
- <div class="edit-sace-label">{{ isEdit ? "閿佸畾淇濆瓨" : "鐣岄潰璁捐" }}</div>
- </div> -->
<div>
- <SilkTableList
- :detail-enter="isEdit"
- :silk-table-list="silkTableList"
- @inputContent="inputContent"
- @addProjectClick="addBtnClick"
- @clearupProject="clearupProject"
- @deleteClick="clearupProject"
- @addColumnClick="addColumnClick"
- @clearupColumn="clearupColumn"
+ <TableCommonView
+ :table-list="tableList"
+ @selTableCol="selTableCol"
+ @handleShow="handleShow"
+ @tableRowClick="tableRowClick"
>
- </SilkTableList>
+ <template slot="tableButton">
+ <el-table-column label="鎿嶄綔" width="180">
+ <template slot-scope="scope">
+ <el-button @click.stop="handleClick(scope.row, '鏌ョ湅')" type="text" size="small">鏌ョ湅</el-button>
+ <el-button @click.stop="handleClick(scope.row, '淇敼')" type="text" size="small">淇敼</el-button>
+ <el-button @click.stop="handleClick(scope.row, '鍒犻櫎')" type="text" size="small">鍒犻櫎</el-button>
+
+ </template>
+ </el-table-column>
+ </template>
+ </TableCommonView>
</div>
</div>
+ <AddWorkshop
+ ref="bomTypeDialog"
+ @handleConfirmSave="handleConfirmSave"
+ :workList="workList"
+ title="娣诲姞鑺傜偣绫诲瀷"
+ />
+ <AddDataDictionaries
+ :editDiaConfig="editConfig"
+ />
</div>
</template>
<script>
-import SilkTableList from "@/views/systemSetting/workshopManage/components/silkTableList"
+import AddDataDictionaries from "@/views/systemSetting/workshopManage/components/addDialog.vue"
+import { getWorkshopManageList,deleteWorkshopManage } from "@/api/systemSetting/workshopManage"
+import TableCommonView from '@/components/makepager/TableCommonView.vue'
+import AddWorkshop from '@/views/systemSetting/workshopManage/components/addWorkshop.vue'
export default {
name: "workshopManage",
props: {},
- components: { SilkTableList },
+ components: { TableCommonView,AddWorkshop,AddDataDictionaries },
mixins: [],
computed: {},
data() {
return {
- isEdit: false,
- silkTableList: {},
- tableData: [],
+ tableList: {},
+ showCol: ["杞﹂棿", "缁勫埆", "寮�濮嬭溅鍙�", "缁撴潫杞﹀彿", "鍗婅溅鏍囧織", "澶囨敞"],
tableColumn: [
- { label: "杞﹂棿", prop: "projectName", projectName: true },
- { label: "缁勫埆", prop: "start", inputFloat: true },
- { label: "寮�濮嬭溅鍙�", prop: "end", inputFloat: true },
- { label: "缁撴潫杞﹀彿", prop: "price1", inputFloat: true },
- { label: "鍗婅溅鏍囧織", prop: "projectName", projectName: true },
- { label: "澶囨敞", prop: "price2", inputFloat: true },
+ // { label: "杞﹂棿", prop: "workshopNumber",iconRight:"el-icon-setting"},
+ { label: "杞﹂棿", prop: "workshopNumber",},
+ { label: "缁勫埆", prop: "groupNumber", },
+ { label: "寮�濮嬭溅鍙�", prop: "startCarNumber" },
+ { label: "缁撴潫杞﹀彿", prop: "endCarNumber" },
+ { label: "鍗婅溅鏍囧織", prop: "carFlag",isCallMethod: true, getCallMethod: this.getStatusCarFlag },
+ { label: "澶囨敞", prop: "notes", },
],
- columnNum: 0,
- dataObj: {
- projectName: "",
- start: 0,
- end: 0,
- price1: 0,
- price2: 0,
- price3: 0
- }
+ // 绫诲瀷
+ workList: [],
+ getDataParams: {
+ page: 1,
+ pageSize: 10,
+ keyWord: '',
+ },
+ editConfig:{
+ visible:false,
+ infomitton:{
+ TabsIndex:0,
+ workshopId:null,
+ }
+ },
}
},
created() {
- this.setTableForm()
+ this.setTable()
+ this.getData()
},
methods: {
- setTableForm() {
- this.silkTableList = {
- tableData: this.tableData,
- isReturn: false,
- tableColumn: this.tableColumn
+ setTable() {
+ console.log(this.tableColumn,"鐪嬬湅")
+ // top 鏄庣粏鍗曞垪琛�
+ this.tableList = {
+ selectIndex: true,
+ tableInfomation: [],
+ allcol: [],
+ showcol: this.showCol,
+ tableColumn: this.setColumnVisible(this.showCol, this.tableColumn)
}
+ this.setTableList(this.tableList)
+ },
+ setColumnVisible(showCol, tableColumn) {
+ return tableColumn.map((ele) => {
+ return {
+ ...ele,
+ isShowColumn: showCol.includes(ele.label)
+ }
+ })
+ },
+ setTableList(tableList) {
+ tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
+ this.searchOptions = []
+ for (let i = 0; i < tableList.tableColumn.length; i++) {
+ const label = tableList.tableColumn[i].label
+ const value = tableList.tableColumn[i].prop
+ this.searchOptions.push({ value: value, label: label })
+ }
+ },
+ selTableCol(val) {
+ this.showcol = val
+ this.tableList.tableColumn = this.setColumnVisible(val, this.tableColumn)
+ },
+ // 琛ㄦ牸琛岀偣鍑�
+ tableRowClick(row){
+ console.log(row,"row")
},
// 鎼滅储
onFilterSearch(searchText) {
- console.log(searchText)
+ console.log(searchText,"鏄暐")
+ this.getDataParams.keyWord=searchText,
+ this.getData()
},
// 鏂板
addBtnClick() {
- if(this.isEdit){
- this.$message.warning("璇峰厛淇濆瓨褰撳墠缂栬緫")
- }else{
- this.isEdit = true
- // array.splice(index, 0, item)
- this.tableData.splice(0,0,{
- projectName: "",
- start: 0,
- end: 0,
- price1: 0,
- price2: 0,
- price3: 0,
- isAdd:true,
- })
- }
-
-
+ this.editConfig.infomitton=[]
+ this.editConfig.dialogTitle="鏂板"
+ this.editConfig.visible=true
},
// 淇濆瓨
saveBtnClick(){
- this.tableData.forEach((item)=>{
- item.isAdd=false
- })
- this.isEdit = false
+
},
// 鍒锋柊
refreshClick() {},
// 鎵撳嵃
printClick() {},
- // 鍒楄〃杈撳叆鍥炶皟
- inputContent(val, prop, row) {
- console.log(val, prop, row,"鍒楄〃鎵撳嵃鍥炶皟")
- },
// 鍒犻櫎
- clearupProject(data, index) {
- console.log(data)
- this.tableData.splice(index, 1)
+ delBtnClick(){},
+ // 缁勫埆
+ handleShow(item){
+ console.log(item,"item")
+ this.$refs.bomTypeDialog.editDialogVisible = true;
},
- // 淇濆瓨缂栬緫鎸夐挳鍒囨崲
- editSaveClick() {
- this.isEdit = !this.isEdit
+ handleGetBomKindDictList() {
+ // postGetBomKindDictList().then((res) => {
+ // this.workList = res.data;
+ // });
},
- // 娣诲姞鍒�
- addColumnClick() {
- let propStr = "trends" + this.columnNum
- this.tableColumn.splice(2, 0, { label: "", prop: propStr, inputFloat: true, addColumn: true })
- this.$set(this.dataObj, propStr, 0)
- console.log(this.tableColumn)
- this.silkTableList.tableColumn = this.tableColumn
- this.columnNum += 1
+ handleConfirmSave(data) {
+ console.log(data,"data")
+ // postSaveBomKindDict({ data: data }).then((res) => {
+ // if (res.code == 200) {
+ // this.$message({
+ // message: "鎿嶄綔鎴愬姛锛�",
+ // type: "success",
+ // });
+ // this.$refs.bomTypeDialog.editDialogVisible = false;
+ // this.handleGetBomKindDictList();
+ // }
+ // });
},
- // 鍒犻櫎鍒�
- clearupColumn(prop) {
- let currentIndex = 0
- this.tableColumn.map((item, index) => {
- if (item.prop == prop) {
- currentIndex = index
- }
+ // 杞﹂棿鍒楄〃
+ async getData() {
+ await getWorkshopManageList({
+ keyWord: this.getDataParams.keyWord,
+ page: this.getDataParams.page,
+ pageSize: this.getDataParams.pageSize,
+ }).then((res) => {
+ this.tableList.tableInfomation = res.data
})
- this.tableColumn.splice(currentIndex, 1)
- this.silkTableList.tableColumn = this.tableColumn
- this.$delete(this.dataObj, prop)
+ },
+ getStatusCarFlag(val) {
+ if (val) {
+ return val == 1 ? '宸﹀崐杞�' : val == 2 ? '鍙冲崐杞�' : val == 3 ? '鍏ㄨ溅缁撴潫' : '--'
+ } else {
+ return "--";
+ }
+ },
+ handleClick(row,type){
+ console.log(row,"row")
+ if(type==="鏌ョ湅"){
+ this.editConfig.infomitton=row
+ this.editConfig.infomitton.workshopId=row.ID
+ this.editConfig.dialogTitle=type
+ this.editConfig.visible=true
+ }else if(type==="淇敼"){
+ this.editConfig.infomitton=row
+ this.editConfig.infomitton.workshopId=row.ID
+ this.editConfig.dialogTitle=type
+ this.editConfig.visible=true
+ }else if(type==="鍒犻櫎"){
+ this.$confirm(`纭鍒犻櫎${row.name}鍚�?`, '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ deleteWorkshopManage({id:row.ID}).then((res)=>{
+ if(res&&res.code===200){
+ this.getData()
+ this.$message({
+ type: 'success',
+ message: '鍒犻櫎鎴愬姛!'
+ });
+ }
+ })
+ })
+ }
}
}
}
@@ -190,3 +257,4 @@
}
}
</style>
+
diff --git a/vue.config.js b/vue.config.js
index f0c0319..86a75c3 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -13,7 +13,7 @@
productionSourceMap: false, // 濡傛灉浣犱笉闇�瑕佺敓浜х幆澧冪殑source map, 鍙互灏嗗叾璁剧疆涓篺alse 浠ュ姞閫熺敓浜х幆澧冩瀯寤�
devServer: {
proxy: {
- "/api": {
+ "/api-jl": {
// target: "http://192.168.20.118:8889", // http://192.168.20.119:8002 http://fai365.com:30150/
// target: "http://192.168.20.120:8008",
// target: "http://192.168.20.120:8004",
--
Gitblit v1.8.0