From 404edeeb419242ac204b513456e14ccd3afb4e35 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期日, 07 四月 2024 11:21:00 +0800
Subject: [PATCH] 生丝定价标准页面调整

---
 src/views/systemSetting/silkStandardSetting/index.vue                  |   62 --
 src/views/systemSetting/workshopManage/components/silkTableList.vue    |  402 ++++++++++++++++++
 src/views/systemSetting/silkPriceStandard/index.vue                    |  182 ++++++++
 src/views/systemSetting/workshopManage/components/addWorkshop.vue      |   62 ++
 src/views/systemSetting/workshopManage/index.vue                       |  183 ++++++++
 src/views/systemSetting/silkPriceStandard/components/silkTableList.vue |  402 ++++++++++++++++++
 6 files changed, 1,237 insertions(+), 56 deletions(-)

diff --git a/src/views/systemSetting/silkPriceStandard/components/silkTableList.vue b/src/views/systemSetting/silkPriceStandard/components/silkTableList.vue
new file mode 100644
index 0000000..829f842
--- /dev/null
+++ b/src/views/systemSetting/silkPriceStandard/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="scope.row.isAdd">
+                  <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/silkPriceStandard/index.vue b/src/views/systemSetting/silkPriceStandard/index.vue
index da4f3d5..2645a3d 100644
--- a/src/views/systemSetting/silkPriceStandard/index.vue
+++ b/src/views/systemSetting/silkPriceStandard/index.vue
@@ -1,21 +1,191 @@
 <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="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"
+        >
+        </SilkTableList>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
+import SilkTableList from "@/views/systemSetting/silkPriceStandard/components/silkTableList"
 export default {
   name: "silkPriceStandard",
   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 },
+        { label: "鍗曚綅", prop: "price1", inputFloat: true },
+        { label: "澶囨敞", prop: "price2", 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/silkStandardSetting/index.vue b/src/views/systemSetting/silkStandardSetting/index.vue
index 43383a0..43fb89c 100644
--- a/src/views/systemSetting/silkStandardSetting/index.vue
+++ b/src/views/systemSetting/silkStandardSetting/index.vue
@@ -3,7 +3,7 @@
     <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" :disabled="!isEdit">鏂板</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>
@@ -24,8 +24,6 @@
           @addProjectClick="addBtnClick"
           @clearupProject="clearupProject"
           @deleteClick="clearupProject"
-          @addColumnClick="addColumnClick"
-          @clearupColumn="clearupColumn"
         >
         </SilkTableList>
       </div>
@@ -45,24 +43,7 @@
     return {
       isEdit: false,
       silkTableList: {},
-      tableData: [],
-      tableColumn: [
-        { label: "妫�鏌ラ」鐩悕绉�", prop: "projectName", projectName: true },
-        { label: "寮�濮嬬氦搴�", prop: "start", inputFloat: true },
-        { label: "缁撴潫绾ゅ害", prop: "end", inputFloat: true },
-        { label: "閲庣氦", prop: "price1", inputFloat: true },
-        { label: "澶ч噹", prop: "price2", inputFloat: true },
-        { label: "鐗归噹", prop: "price3", inputFloat: true }
-      ],
-      columnNum: 0,
-      dataObj: {
-        projectName: "",
-        start: 0,
-        end: 0,
-        price1: 0,
-        price2: 0,
-        price3: 0
-      }
+      tableData: []
     }
   },
   created() {
@@ -73,7 +54,14 @@
       this.silkTableList = {
         tableData: this.tableData,
         isReturn: false,
-        tableColumn: this.tableColumn
+        tableColumn: [
+          { label: "妫�鏌ラ」鐩悕绉�", prop: "projectName", projectName: true },
+          { label: "寮�濮嬬氦搴�", prop: "start", inputFloat: true },
+          { label: "缁撴潫绾ゅ害", prop: "end", inputFloat: true },
+          { label: "閲庣氦", prop: "price1", inputFloat: true },
+          { label: "澶ч噹", prop: "price2", inputFloat: true },
+          { label: "鐗归噹", prop: "price3", inputFloat: true }
+        ]
       }
     },
     // 鎼滅储
@@ -82,7 +70,14 @@
     },
     // 鏂板
     addBtnClick() {
-      this.tableData.push(this.dataObj)
+      this.tableData.push({
+        projectName: "",
+        start: 0,
+        end: 0,
+        price1: 0,
+        price2: 0,
+        price3: 0
+      })
     },
     // 鍒锋柊
     refreshClick() {},
@@ -100,27 +95,6 @@
     // 淇濆瓨缂栬緫鎸夐挳鍒囨崲
     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)
     }
   }
 }
diff --git a/src/views/systemSetting/workshopManage/components/addWorkshop.vue b/src/views/systemSetting/workshopManage/components/addWorkshop.vue
new file mode 100644
index 0000000..d6bea83
--- /dev/null
+++ b/src/views/systemSetting/workshopManage/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/workshopManage/components/silkTableList.vue b/src/views/systemSetting/workshopManage/components/silkTableList.vue
new file mode 100644
index 0000000..8875782
--- /dev/null
+++ b/src/views/systemSetting/workshopManage/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/workshopManage/index.vue b/src/views/systemSetting/workshopManage/index.vue
index 2cde4d9..e029789 100644
--- a/src/views/systemSetting/workshopManage/index.vue
+++ b/src/views/systemSetting/workshopManage/index.vue
@@ -1,21 +1,192 @@
 <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="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"
+        >
+        </SilkTableList>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
+import SilkTableList from "@/views/systemSetting/workshopManage/components/silkTableList"
 export default {
   name: "workshopManage",
   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 },
+        { label: "缁撴潫杞﹀彿", prop: "price1", inputFloat: true },
+        { label: "鍗婅溅鏍囧織", prop: "projectName", projectName: true },
+        { label: "澶囨敞", prop: "price2", 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>

--
Gitblit v1.8.0