baishaojie 1 месяц назад
Родитель
Сommit
0e91c6aeea

+ 141 - 33
src/views/basicData/productClass/index.vue

@@ -14,25 +14,51 @@
     </div>
 
     <div class="search">
-      <el-input v-model="table.getdataListParm.parammaps.cname" placeholder="产品类别" style="width: 180px;" class="filter-item" clearable />
-
-      <el-button class="successBorder" @click="form_search">查询</el-button>
+      <!-- <el-input v-model="table.getdataListParm.parammaps.cname" placeholder="产品类别" style="width: 180px;" class="filter-item" clearable /> -->
+      <tree-select
+            v-model="table.getdataListParm.parammaps.cname"
+            class="typeSelect"
+            :height="300"
+            :width="250"
+            clearable
+            :data="parentDept"
+            :placeholder="placeholder"
+            style="display: inline-block;"
+            :default-props="defaultProps"
+            :node-key="nodeKey"
+            :checked-keys="defaultCheckedKeys"
+            @popoverHide="popoverHideSelect"
+            :disabled="false"
+          />
+
+      <el-button class="successBorder" style="margin-left: 20px;" @click="form_search">查询</el-button>
       <el-button class="successBorder" @click="form_clear">重置</el-button>
     </div>
 
     <div class="table">
-      <el-table :key="table.tableKey" v-loading="table.listLoading" element-loading-text="给我一点时间" :data="table.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed">
+      <el-table v-loading="table.listLoading" element-loading-text="给我一点时间" 
+        row-key="id"
+      :data="table.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" 
+      :cell-style="cellStyle" class="elTable table-fixed"
+      :tree-props="{ children: 'children'}" >
         <!-- <el-table-column type="selection" align="center" width="50" /> -->
-        <el-table-column label="序号" align="center" type="index" width="50px">
+        <!-- <el-table-column label="序号" align="center" type="index" width="50px">
           <template slot-scope="scope">
-            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
+            <span>{{ scope.$index + 1 }}</span>
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column label="产品类别" min-width="150px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.cname }}</span>
           </template>
         </el-table-column>
+
+        <el-table-column label="产品编码" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.code }}</span>
+          </template>
+        </el-table-column>
+
         <el-table-column label="备注" min-width="150px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.remark }}</span>
@@ -58,7 +84,7 @@
           </template>
         </el-table-column>
       </el-table>
-      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="get_table_data" />
+      <!-- <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="get_table_data" /> -->
     </div>
 
     <!-- 新增/编辑 -->
@@ -66,24 +92,47 @@
       <div class="app-add">
         <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">
 
-          <el-form-item label="产品类别:" prop="cname">
-            <el-input ref="cname" v-model="create.temp.cname" class="filter-item" style="width: 100%;" />
+          <el-form-item label="产品类别:" prop="cname" class="filter-item">
+            <el-input ref="cname" v-model="create.temp.cname"  />
           </el-form-item>
 
-          <el-form-item label="备注" prop="remark">
+          <el-form-item label="上级分类"  class="filter-item" style="width: 430px;" prop="pid">
+              <tree-select
+                class="typeSelect"
+                :height="300"
+                :width="400"
+                size="small"
+                clearable
+                :data="parentDept"
+                :placeholder="placeholder"
+                style="display:inline-block;"
+                :default-props="defaultProps"
+                :node-key="nodeKey"
+                :checked-keys="defaultCheckedKeys"
+                @popoverHide="popoverHide"
+                :disabled="disabled"
+              />
+            </el-form-item>
+
+            <el-form-item label="产品编码" class="filter-item"  prop="code">
+              <el-input v-model="create.temp.code" placeholder="请输入编码">
+                <template slot="prepend">{{ create.temp.ccode }}</template>
+              </el-input>
+            </el-form-item>
+          <el-form-item label="备注:" class="filter-item"  prop="remark">
             <el-input ref="remark" v-model="create.temp.remark" />
           </el-form-item>
 
-          <el-form-item label="顺序" prop="sort">
+          <el-form-item label="顺序:" class="filter-item"  prop="sort">
             <el-input ref="sort" v-model="create.temp.sort" />
           </el-form-item>
-          <el-form-item label="启用" prop="enable">
+          <el-form-item label="启用" class="filter-item"  prop="enable">
             <el-switch ref="enable" v-model="create.temp.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
           </el-form-item>
 
         </el-form>
         <div slot="footer" class="dialog-footer">
-          <el-button class="cancelClose" @click="create.dialogFormVisible = false;get_table_data()">关闭</el-button>
+          <el-button class="cancelClose" @click="create.dialogFormVisible = false;defaultCheckedKeys = [];get_table_data()">关闭</el-button>
           <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="success" @click="create.dialogStatus==='create'?add_dialog_save():form_edit_save()">确认</el-button>
         </div>
       </div>
@@ -92,27 +141,36 @@
 </template>
 
 <script>
-import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons, calculativeWidth } from '@/api/common'
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons, calculativeWidth ,transData} from '@/api/common'
 import { isIntegerZero } from '@/utils/validate'
+import TreeSelect from '@/components/TreeSelect'; // 确保路径正确
 import Cookies from 'js-cookie'
 import { parseTime } from '@/utils/index.js'
 import Pagination from '@/components/Pagination'
 import { MessageBox } from 'element-ui'
 export default {
   name: 'ProductClass',
-  components: { Pagination },
+  components: { Pagination,TreeSelect },
+
+  
   data() {
     return {
 
       isRoleEdit: [],
-
+      nodeKey: 'id', // 节点的唯一标识字段
+      disabled: false, // 是否禁用
+      placeholder: '请选择上级分类',
+      defaultProps: {
+        children: 'children',
+        label: 'cname', // 根据实际字段名调整
+      },
+      defaultCheckedKeys: [], // 默认选中的节点
+      defaultCheckedSelect:[],
+      parentDept: [], // 树形数据
       //表格请求参数~
       table: {
         getdataListParm: {
           name: 'getCategory',
-          page: 1,
-          offset: 1,
-          pagecount: parseInt(Cookies.get('pagecount')),
           returntype: 'Map',
           parammaps: {
             cname: '',
@@ -124,21 +182,30 @@ export default {
         listLoading: true,
         temp: {}
       },
-
+      getdataListAllParm: {
+          name: 'getCategory',
+          returntype: 'Map',
+          parammaps: {
+            cname: '',
+          }
+        },
       // 新增/编辑
       create: {
         dialogFormVisible: false,
         dialogStatus: '',
         temp: {
           cname: '',
+          ccode:'',
+          code:'',
           remark: '',
           sort: '',
           enable: 1
         },
         rules: {
           cname: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          sort: [{ validator: isIntegerZero, trigger: 'blur' }]
-
+          sort: [{ validator: isIntegerZero, trigger: 'blur' }],
+          code :[{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
+          pid :[{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
         },
       },
       textMap: {
@@ -155,11 +222,29 @@ export default {
 
   created() {
     this.get_table_data()
-
+    this.get_table_data_all()
     // this.get_auto_buttons()
   },
 
   methods: {
+
+    popoverHide(checkedIds, checkedData) {
+      console.log(checkedIds, checkedData);
+      // this.create.temp.ccode = checkedData.code;
+      this.$set(this.create.temp, 'ccode', checkedData.code); 
+      this.create.temp.pid = checkedData.id;
+    },
+
+    popoverHideSelect(checkedIds, checkedData) {
+      if (checkedData == null) {
+        this.table.getdataListParm.parammaps.pid = '';
+      }else{
+        this.table.getdataListParm.parammaps.pid = checkedData.id;
+      }
+      
+      // this.table.getdataListParm.cname = cname
+      console.log(checkedIds, checkedData);
+    },
     //获取按钮权限
     get_auto_buttons() {
       const Edit = 'DungScores'
@@ -169,27 +254,40 @@ export default {
 
     //加载表格
     get_table_data() {
-      this.table.listLoading = true
-      console.log("this.table.getdataListParm======>", this.table.getdataListParm)
+      // this.defaultCheckedKeys = [];
+      this.table.listLoading = true;
       GetDataByName(this.table.getdataListParm).then(response => {
-        console.log('table数据======>', response.data.list)
         if (response.data.list !== null) {
           for (var i = 0; i < response.data.list.length; i++) {
             response.data.list[i].enable = parseInt(response.data.list[i].enable)
           }
-
-          this.table.list = response.data.list
-          this.table.pageNum = response.data.pageNum
-          this.table.pageSize = response.data.pageSize
-          this.table.total = response.data.total
+          // this.table.list = re sponse.data.list
+          this.table.list = transData(response.data.list, 'id', 'pid', 'children');
+          // this.table.pageNum = response.data.pageNum
+          // this.table.pageSize = response.data.pageSize
+          // this.table.total = response.data.total
         } else {
-          this.table.list = []
+          this.table.list = [];
+    
         }
         setTimeout(() => {
           this.table.listLoading = false
         }, 100)
       })
     },
+    get_table_data_all() {
+      GetDataByName(this.getdataListAllParm).then(response => {
+        if (response.data.list !== null) {
+          for (var i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].enable = parseInt(response.data.list[i].enable)
+          }
+          this.parentDept  = transData(response.data.list, 'id', 'pid', 'children');
+        } else {
+
+          this.parentDept = [];
+        }
+      })
+    },
     form_search() {
       console.log('点击了查询')
 
@@ -220,6 +318,7 @@ export default {
     //添加保存
     add_dialog_save() {
       console.log('点击了新增保存')
+      this.create.temp.code = this.create.temp.ccode + '.'+ this.create.temp.code
       this.$refs['temp'].validate(valid => {
         if (valid) {
           //验证名字是否存在
@@ -355,4 +454,13 @@ export default {
 .table {
   margin-top: 10px;
 }
+
+.filter-item .el-input__inner {
+    width: 422px;
+}
+
+
+
 </style>
+
+

+ 304 - 28
src/views/basicData/productList/index.vue

@@ -1,5 +1,21 @@
 <template>
   <div class="app-container">
+    <el-row :gutter="24">
+      <el-col :span="4">
+        <el-card style="height: 100%; min-height: 100vh;">
+        <div style="marginTop:20px;margin-left: 10px;">
+         <el-tree
+           :data="productNameList"
+           v-model="table.getdataListParm.parammaps.categoryId"
+           :props="defaultProps"
+           @node-click="handleNodeClick"
+           style="font-size: 26px;" 
+            :disabled="false"
+         ></el-tree>
+       </div>
+      </el-card>
+      </el-col>
+      <el-col :span="20">
     <div class="operation">
       <el-button v-if="isRoleEdit" class="success" style="float: left;margin-right:10px;" @click="form_add">添加</el-button>
 
@@ -14,10 +30,28 @@
     </div>
 
     <div class="search">
-      <el-select v-model="table.getdataListParm.parammaps.categoryId" placeholder="客户名称" class="filter-item" style="width: 120px;" clearable>
+      <!-- <el-select v-model="table.getdataListParm.parammaps.categoryId" placeholder="产品类别" class="filter-item" style="width: 120px;" clearable>
         <el-option v-for="(item,index) in productNameList" :key="index" :label="item.name" :value="item.id" />
-      </el-select>
+      </el-select> -->
+      <tree-select
+            v-model="table.getdataListParm.parammaps.categoryId"
+            class="typeSelect"
+            :height="300"
+            :width="250"
+            clearable
+            :data="productNameList"
+            :placeholder="placeholder"
+            style="display: inline-block"
+            :default-props="defaultProps"
+            :node-key="nodeKey"
+            :checked-keys="defaultCheckedKeysSelect"
+            @popoverHide="popoverHideSelect"
+            :disabled="false"
+          />
+
+
       <el-input v-model="table.getdataListParm.parammaps.pname" placeholder="产品名称" style="width: 180px;" class="filter-item" clearable />
+      <el-input v-model="table.getdataListParm.parammaps.pcode" placeholder="产品编码" style="width: 180px;" class="filter-item" clearable />
       <el-input v-model="table.getdataListParm.parammaps.model" placeholder="产品型号" style="width: 180px;" class="filter-item" clearable />
       <el-input v-model="table.getdataListParm.parammaps.Specifications" placeholder="产品规格" style="width: 180px;" class="filter-item" clearable />
 
@@ -38,6 +72,11 @@
             <span>{{ scope.row.cname }}</span>
           </template>
         </el-table-column>
+        <el-table-column label="产品编码" min-width="150px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.pcode }}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="产品名称" min-width="150px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.pname }}</span>
@@ -53,6 +92,24 @@
             <span>{{ scope.row.Specifications }}</span>
           </template>
         </el-table-column>
+
+        <el-table-column label="产品图片" min-width="150px" align="center">
+            <template slot-scope="scope">
+              <el-popover placement="right" title="" trigger="hover">
+                <img
+                       slot="reference"
+                       :src="scope.row.imagePath"
+                       style="height: 100px; width: 100px"
+                     />
+                     <!-- 悬停时显示的内容 -->
+                     <img
+                       :src="scope.row.imagePath"
+                       style="height: 200px; width: 200px"
+                     />
+              </el-popover>
+            </template>
+          </el-table-column>
+
         <el-table-column label="备注" min-width="150px" align="center">
           <template slot-scope="scope">
             <span>{{ scope.row.remark }}</span>
@@ -86,10 +143,27 @@
       <div class="app-add">
         <el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">
 
-          <el-form-item label="产品类别:" prop="categoryId">
-            <el-select ref="categoryId" v-model="create.temp.categoryId" filterable placeholder="请选择类别" class="filter-item" style="width: 100%;" @change="change_bar" :disabled="create.dialogStatus=='see'">
-              <el-option v-for="(item,index) in productNameList" :key="index" :label="item.name" :value="item.id" />
-            </el-select>
+          <el-form-item label="产品类别:" style="width: 400px;" class="filter-item" prop="categoryId">
+            <tree-select
+                class="typeSelect"
+                :height="300"
+                :width="250"
+                size="small"
+                clearable
+                :data="productNameList"
+                :placeholder="placeholder"
+                style="display:inline-block;"
+                :default-props="defaultProps"
+                :node-key="nodeKey"
+                :checked-keys="defaultCheckedKeys"
+                @popoverHide="popoverHide"
+                :disabled="disabled"
+              />
+          </el-form-item>
+
+
+          <el-form-item label="产品编码:" prop="pcode">
+            <el-input ref="pname" v-model="create.temp.pcode" class="filter-item" style="width: 100%;" />
           </el-form-item>
 
           <el-form-item label="产品名称:" prop="pname">
@@ -103,41 +177,86 @@
           </el-form-item>
 
           <el-form-item label="备注:" prop="remark">
-            <el-input ref="remark" v-model="create.temp.remark" />
+            <el-input ref="remark"  class="filter-item" v-model="create.temp.remark" />
           </el-form-item>
 
           <el-form-item label="顺序:" prop="sort">
-            <el-input ref="sort" v-model="create.temp.sort" />
+            <el-input ref="sort"  class="filter-item" v-model="create.temp.sort" />
           </el-form-item>
           <el-form-item label="启用:" prop="enable">
-            <el-switch ref="enable" v-model="create.temp.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
+            <el-switch ref="enable"   class="filter-item" v-model="create.temp.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
           </el-form-item>
 
+
+          <el-form-item label="产品图片:">
+            <el-upload  id="uploadPic"
+          :action="uploadImageUrl"
+         :limit='1'
+         :file-list="fileList"
+          list-type="picture-card"
+          :on-preview="handlePictureCardPreview"
+          :on-change="(file, fileList) => handlePicChange(file, fileList)"
+          :on-success="(response, file, fileList) => handlePicSuccess(response, file, fileList)"
+          :headers="headers"
+               :disabled="isView"
+          :on-remove="(file, fileList) => handlePicRemove(file, fileList)"
+        >
+          <i slot="default" class="el-icon-plus"></i>
+        </el-upload>
+              <el-dialog :visible.sync="dialogVisible">
+                <img width="100%" :src="dialogImageUrl" alt="">
+              </el-dialog>
+        </el-form-item>
+
         </el-form>
         <div slot="footer" class="dialog-footer">
-          <el-button class="cancelClose" @click="create.dialogFormVisible = false;get_table_data()">关闭</el-button>
-          <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="success" @click="create.dialogStatus==='create'?add_dialog_save():form_edit_save()">确认</el-button>
+          <el-button class="cancelClose" @click="create.dialogFormVisible = false;defaultCheckedKeys = [];this.dialogImageUrl  = '';get_table_data()">关闭</el-button>
+          <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="success" @click="create.dialogStatus==='create'?add_dialog_save():form_edit_save();this.dialogImageUrl  = '';">确认</el-button>
         </div>
       </div>
     </el-dialog>
+  </el-col>
+  </el-row>
   </div>
 </template>
 
 <script>
-import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons, calculativeWidth } from '@/api/common'
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons, calculativeWidth,transData } from '@/api/common'
 import { isIntegerZero } from '@/utils/validate'
-import Cookies from 'js-cookie'
+import Cookies from 'js-cookie' 
+import TreeSelect from '@/components/TreeSelect'; 
 import { parseTime } from '@/utils/index.js'
 import Pagination from '@/components/Pagination'
 import { MessageBox } from 'element-ui'
+import { getToken } from '@/utils/auth'
+
 export default {
   name: 'ProductList',
-  components: { Pagination },
+  components: { Pagination,TreeSelect },
   data() {
     return {
+      handlePictureCardPreview(file) {
+              this.dialogImageUrl = file.url;
+              this.dialogVisible = true;
+      },
 
+      dialogImageUrl: '',
+                 dialogVisible: false,
+                 uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
+                 //图片请求头
+ headers: { optname: 'insertcustompic', id: 1,token: getToken()},
       isRoleEdit: [],
       productNameList: [], // 产品类别下拉框
+      placeholder: '请选择上级分类',
+      defaultProps: {
+        children: 'children',
+        label: 'name', // 根据实际字段名调整
+      },
+      disabled: false, // 是否禁用
+      nodeKey: 'id', // 节点的唯一标识字段
+      defaultCheckedKeys: [],
+      defaultCheckedKeysSelect :[],
+      fileList: [],
       //表格请求参数~
       table: {
         getdataListParm: {
@@ -151,6 +270,7 @@ export default {
             pname: '',
             model: '',
             Specifications: '',
+            pcode:'',
           }
         },
         tableKey: 0,
@@ -171,14 +291,16 @@ export default {
           Specifications: '',
           remark: '',
           sort: '',
-          enable: 1
+          enable: 1,
+          pcode:'',
+          pImage:'',
         },
         rules: {
           pname: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
           model: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
           Specifications: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
-          sort: [{ validator: isIntegerZero, trigger: 'blur' }]
-
+          sort: [{ validator: isIntegerZero, trigger: 'blur' }],
+          pcode: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
         },
       },
       textMap: {
@@ -192,7 +314,15 @@ export default {
       cellStyle: { padding: 0 + 'px' }
     }
   },
-
+  computed: {
+      // 设置请求头
+      headers() {
+        return {
+          // 设置token
+          token: getToken()
+        }
+      }
+    },
   created() {
     this.get_table_data()
 
@@ -202,6 +332,56 @@ export default {
   },
 
   methods: {
+    handlePicChange(file, fileList) {
+
+},
+    handlePicRemove(file, fileList) {
+              console.log(file, fileList);
+                console.log(fileList.length);
+              if (fileList.length == 1) {
+                document.getElementById('uploadPic').lastChild.style.display = "none"
+              } else {
+                document.getElementById('uploadPic').lastChild.style.display = "inline-block"
+      }
+    },
+    handlePicSuccess(response, file, fileList) {
+                  
+      if (fileList.length == 1) {
+        document.getElementById('uploadPic').lastChild.style.display = "none"
+      } else {
+        document.getElementById('uploadPic').lastChild.style.display = "inline-block"
+      }
+      this.$set(this.create.temp, 'pImage', response.execresult.LastInsertId);
+    },
+    andlePictureCardPreview(file) {
+      this.dialogImageUrl = file.url;
+      this.dialogVisible = true;
+    },
+    
+    popoverHideSelect(checkedIds, checkedData) {
+      if (checkedIds !== null) {
+        this.table.getdataListParm.parammaps.categoryId = checkedData.id;
+      } else {
+        this.table.getdataListParm.parammaps.categoryId ='';
+      }
+    },
+
+    handleNodeClick(data, node) {
+       this.table.getdataListParm.parammaps.categoryId = data.id;
+       this.get_table_data_left();
+      },
+
+    popoverHide(checkedIds, checkedData) {
+      console.log(checkedIds, checkedData);
+      if (checkedData == null) {
+        this.$set(this.create.temp, 'pcode', ''); 
+        this.create.temp.categoryId = '';
+      }else{
+        this.$set(this.create.temp, 'pcode', checkedData.code); 
+      this.create.temp.categoryId = checkedData.id;
+      }
+    },
+
     //获取按钮权限
     get_auto_buttons() {
       const Edit = 'DungScores'
@@ -213,7 +393,8 @@ export default {
     get_select_list() {
       GetDataByName({ name: 'getCategorySelect', offset: 0, pagecount: 0, parammaps: {} }, ).then(response => {
         this.productNameList = response.data.list
-        console.log("产品类别下拉框", response)
+        this.productNameList= transData(response.data.list, 'id', 'pid', 'children');
+        console.log("产品类别下拉框", response);
       })
     },
 
@@ -227,6 +408,11 @@ export default {
         if (response.data.list !== null) {
           for (var i = 0; i < response.data.list.length; i++) {
             response.data.list[i].enable = parseInt(response.data.list[i].enable)
+            if ( response.data.list[i].pImage !== '') {
+              response.data.list[i].imagePath = process.env.VUE_APP_BASE_API + response.data.list[i].imagePath;
+              } else {
+                response.data.list[i].imagePath = ''
+              }
           }
 
           this.table.list = response.data.list
@@ -241,6 +427,29 @@ export default {
         }, 100)
       })
     },
+    get_table_data_left() {
+      this.table.listLoading = true
+      console.log("this.table.getdataListParm======>", this.table.getdataListParm)
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据======>', response.data.list)
+        if (response.data.list !== null) {
+          for (var i = 0; i < response.data.list.length; i++) {
+            response.data.list[i].enable = parseInt(response.data.list[i].enable)
+          }
+
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+          this.table.total = response.data.total
+        } else {
+          this.table.list = []
+        }
+        this.table.getdataListParm.parammaps.categoryId  = '';
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
     form_search() {
       console.log('点击了查询')
 
@@ -272,8 +481,19 @@ export default {
     form_add() {
       console.log('点击了新增')
       this.form_reset()
+      // this.dialogImageUrl = row.imagePath;
       this.create.dialogStatus = 'create'
       this.create.dialogFormVisible = true
+      this.fileList = [];
+      // if (row.imagePath !== ''){
+      //   const fileList = [];
+      //   var urlObj = { "url": "", "response": { "execresult": { "LastInsertId": "" } } };
+      //   urlObj.url = row.imagePath;
+      //   urlObj.response.execresult.LastInsertId = row.pImage;
+      //   fileList.push(urlObj);
+      //   this.fileList = fileList;
+      // }
+      
     },
     //添加保存
     add_dialog_save() {
@@ -284,19 +504,36 @@ export default {
           //新增保存
           this.requestParam.name = 'insertProducts'
           this.requestParam.parammaps = this.create.temp
-          PostDataByName(this.requestParam).then(response => {
+
+          this.requestParam = {
+            data: [
+              {
+                name: "CheckProductPCode",
+                type: "v",
+                parammaps :{
+                  pcode :this.create.temp.pcode,
+                  id :''
+                }
+              },
+              {
+                name: "insertProducts",
+                type: "e",
+                parammaps: this.create.temp,
+              },
+            ]
+          }
+          
+          ExecDataByConfig(this.requestParam).then(response => {
             console.log('新增保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
+              this.defaultCheckedKeys = [];
               this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
               this.create.dialogFormVisible = false
               this.get_table_data()
             } else {
-              this.$notify({ title: '失败', message: '保存失败', type: 'error', duration: 2000 })
+              this.$notify({ title: '失败', message: response.data, type: 'error', duration: 2000 })
             }
           })
-
-
-
         }
       })
     },
@@ -306,24 +543,57 @@ export default {
     form_edit(row) {
       console.log('点击了编辑', row)
       row.categoryId = String(row.categoryId)
-
+      // this.dialogImageUrl = row.imagePath;
       this.create.temp = Object.assign({}, row)
       this.create.temp.id = row.id
       this.create.dialogStatus = 'update'
       this.create.dialogFormVisible = true
+      // this.create.pcode = row.pcode;
+      this.defaultCheckedKeys =[row.categoryId] ;
+      console.log(row.imagePath);
+      if (row.pImage !== ''){
+        const fileList = [];
+        var urlObj = { "url": "", "response": { "execresult": { "LastInsertId": "" } } };
+        urlObj.url = row.imagePath;
+        urlObj.response.execresult.LastInsertId = row.pImage;
+        fileList.push(urlObj);
+        this.fileList = fileList;
+      }else{
+        this.fileList  = [];
+        this.dialogImageUrl = '';
+      }
     },
 
     // 编辑保存
     form_edit_save() {
       this.$refs['temp'].validate(valid => {
         if (valid) {
-          this.requestParam.name = 'updateProducts'
-          this.requestParam.parammaps = this.create.temp
-          PostDataByName(this.requestParam).then(response => {
+          // this.requestParam.name = 'updateProducts'
+          // this.requestParam.parammaps = this.create.temp
+
+          this.requestParam = {
+            data: [
+              {
+                name: "CheckProductPCode",
+                type: "v",
+                parammaps :{
+                  pcode :this.create.temp.pcode,
+                  id : this.create.temp.id
+                }
+              },
+              {
+                name: "updateProducts",
+                type: "e",
+                parammaps: this.create.temp,
+              },
+            ]
+          }
+          ExecDataByConfig(this.requestParam).then(response => {
             console.log('编辑保存发送参数', this.requestParam)
             if (response.msg !== 'fail') {
               this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
               this.create.dialogFormVisible = false
+              this.defaultCheckedKeys = [];
               this.get_table_data()
             } else {
               this.$notify({ title: '失败', message: '保存失败', type: 'error', duration: 2000 })
@@ -411,3 +681,9 @@ export default {
   margin-top: 10px;
 }
 </style>
+
+<style lang="scss" scoped>
+.custom-tree {
+  font-size: 26px; /* 设置字体大小 */
+}
+</style> 

+ 2 - 3
src/views/productManagement/assetBasicInfo/index.vue

@@ -10,7 +10,7 @@
            v-model="getGoodsListParm.parammaps.goodsTypeId"
            :props="defaultProps"
            @node-click="handleNodeClick"
-             :disabled="false"
+            :disabled="false"
          ></el-tree>
        </div>
       </el-col>
@@ -362,7 +362,7 @@
 <!-- <div> -->
       <el-row :gutter="24">
           <el-form-item label="货品图片:">
-        <el-upload  id="uploadPic"
+            <el-upload  id="uploadPic"
           :action="uploadImageUrl"
          :limit='1'
          :file-list="fileList"
@@ -474,7 +474,6 @@ import { getToken } from '@/utils/auth'
            dialogImageUrl: '',
                  dialogVisible: false,
                  uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
-
               uploadExcelUrl:  process.env.VUE_APP_BASE_API + 'authdata/GoodsExcel',
                  //图片请求头
  headers: { optname: 'insertcustompic', id: 1,token: getToken()},

+ 672 - 1
src/views/productManagement/processConfiguration/index.vue

@@ -1,11 +1,682 @@
 <template>
+<div>
+    <div style="margin-top: 10px;">
+        <el-row :gutter="20">
 
+            <el-col :span="4">
+                <el-card style="height: 100%; min-height: 100vh;">
+                    <span style="margin-left: 10px;margin-top: 10px;font-size: 20px;">生产工序配置</span>
+                <el-button v-waves class="search-button"  type="primary" icon="el-icon-thumb"  @click="handleControls">操作</el-button>
+                <br>
+                <div style="marginTop:20px;margin-left: 10px;">
+                    <el-tree
+                    :data="processList"
+                    v-model="getProcessDetailsParm.parammaps.processId"
+                    :props="defaultProps"
+                    @node-click="handleNodeClick"
+                    :disabled="false"
+                    ></el-tree>
+                </div>
+            </el-card>
+            </el-col>
+
+            <el-col :span="18">
+                <el-button v-if="this.pid != 0"  v-waves class="search-button"  type="primary" icon="el-icon-circle-plus-outline"  @click="handleProcessRecordsAdd">新增</el-button>
+
+                <el-table
+          :key="tableKey"
+          v-loading="listLoading"
+          element-loading-text="给我一点时间"
+          :data="list"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;margin-top: 20px;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+          :max-height="myHeight">
+          <el-table-column label="序号" align="center" type="index" width="50px" prop="sort" />
+          <el-table-column label="工序" align="center" prop="process" />
+          <el-table-column label="备注" align="center" prop="remark" />
+          <el-table-column label="操作" min-width="80px" header-align="center" align="center">
+            <template slot-scope="scope">
+            <el-button type="primary"   size="mini" @click="handleProcessRecordsEdit(scope.row)">修改</el-button>
+            <el-button type="primary"   size="mini" @click="delProcessRecordsData(scope.row)">删除</el-button>
+            </template>
+        </el-table-column>
+        </el-table>
+        </el-col>
+       
+    </el-row>
+
+
+        </el-row>
+    </div>
+
+
+    <el-dialog
+    :title="dialogTitle"
+    :visible.sync="dialogControls"
+    :close-on-click-modal="false"
+    @close="handleCancel"
+    :width="800 + 'px'"
+    :style="{ maxHeight: '100vh', overflowY: 'auto' }"
+    >
+    <el-row :gutter="20">
+        <el-button  style="margin-left: 10px;" v-waves class="search-button"  type="primary" icon="el-icon-circle-plus-outline"  @click="handleControlsAdd">新增</el-button>
+    </el-row>
+
+    <el-row :gutter="20">
+            <el-table
+        :data="processList"
+        row-key="id"
+        border
+        style="width: 100%;margin-left: 10px;margin-top: 10px;"
+        class="elTable"
+        fit
+        highlight-current-row
+        :tree-props="{ children: 'children'}"
+        >
+        <el-table-column label="序号" align="center" type="index" width="50px">
+            <template slot-scope="scope">
+                {{ scope.row.number }}
+            </template>
+          </el-table-column>
+
+        <el-table-column label="生产名称" min-width="80px" header-align="center" align="center">
+            <template slot-scope="scope">
+            {{ scope.row.process }}
+            </template>
+        </el-table-column>
+      
+      
+        <el-table-column label="操作" min-width="80px" header-align="center" align="center">
+            <template slot-scope="scope">
+            <el-button type="primary"  v-if="scope.row.pid != -1" size="mini" @click="handleEdit(scope.row)">修改</el-button>
+            <el-button type="primary" v-if="scope.row.pid != -1" size="mini" @click="handleDel(scope.row)">删除</el-button>
+            </template>
+        </el-table-column>
+        </el-table>
+    </el-row>
+
+  
+    </el-dialog>
+
+
+    <el-dialog
+    :title="dialogTitle"
+    :visible.sync="dialogControlsAdd"
+    :close-on-click-modal="false"
+    @close="handleCancelAdd"
+    :width="600 + 'px'"
+    :style="{ maxHeight: '100vh', overflowY: 'auto' }"
+    >
+    <el-form
+          :rules="rulesAddManufacture"
+          :inline="true"
+          :model="addControlsParm"
+          label-position="left"
+          label-width="auto"
+          style="width: 90%; margin: 0 auto 30px"
+        >
+          <el-row :gutter="24" style="display: flex; justify-content: center;">
+            <el-form-item label="上级分类: " prop="pid">
+              <tree-select
+                v-model="addControlsParm.parammaps.pid"
+                class="typeSelect"
+                :height="300"
+                :width="230"
+                clearable
+                :data="processList"
+                :placeholder="placeholder"
+                style="display: inline-block"
+                :default-props="defaultProps"
+                :node-key="nodeKey"
+                :checked-keys="defaultCheckedKeys"
+                @popoverHide="popoverHide"
+                :disabled="false"
+              /> 
+            </el-form-item>
+          </el-row>
+
+
+          <el-row :gutter="24" style="display: flex; justify-content: center;">
+            <el-form-item label="货品名称: " prop="process" >
+                <el-input
+                style="width: 254px;height: 40px;"
+                v-model="addControlsParm.process"
+                :disabled="false"
+              />
+            </el-form-item>
+          </el-row>
+
+          <el-row :gutter="24" style="display: flex; justify-content: center;margin-top: 20px;">
+            <el-button type="primary" style="padding: 10px 20px;" size="mini" @click="handleControlsAddData">保存</el-button>
+            <el-button type="primary" style="padding: 10px 20px;" size="mini" @click="handleCancelAdd">取消</el-button>
+          </el-row>
+        </el-form>
+    </el-row>
+
+    </el-dialog>
+
+
+    <el-dialog
+    :title="dialogTitle"
+    :visible.sync="dialogControlsEdit"
+    :close-on-click-modal="false"
+    @close="handleCancelAdd"
+    :width="600 + 'px'"
+    :style="{ maxHeight: '100vh', overflowY: 'auto' }"
+    >
+    <el-form
+          :rules="rulesEditManufacture"
+          :inline="true"
+          :model="editControlsParm"
+          label-position="left"
+          label-width="auto"
+          style="width: 90%; margin: 0 auto 30px"
+        >
+          <el-row :gutter="24" style="display: flex; justify-content: center;">
+            <el-form-item label="上级分类: " prop="pid">
+              <tree-select
+                v-model="editControlsParm.parammaps.pid"
+                class="typeSelect"
+                :height="300"
+                :width="230"
+                clearable
+                :data="processList"
+                :placeholder="placeholder"
+                style="display: inline-block"
+                :default-props="defaultProps"
+                :node-key="nodeKey"
+                :checked-keys="defaultCheckedKeys"
+                @popoverHide="popoverHide"
+                :disabled="false"
+              /> 
+            </el-form-item>
+          </el-row>
+
+
+          <el-row :gutter="24" style="display: flex; justify-content: center;">
+            <el-form-item label="货品名称: " prop="process" >
+                <el-input
+                style="width: 254px;height: 40px;"
+                v-model="editControlsParm.process"
+                :disabled="false"
+              />
+            </el-form-item>
+          </el-row>
+
+          <el-row :gutter="24" style="display: flex; justify-content: center;margin-top: 20px;">
+            <el-button type="primary" style="padding: 10px 20px;" size="mini" @click="handleControlsEditData">保存</el-button>
+            <el-button type="primary" style="padding: 10px 20px;" size="mini" @click="handleCancelAdd">取消</el-button>
+          </el-row>
+        </el-form>
+    </el-row>
+
+    </el-dialog>
+
+
+    <el-dialog
+    :title="dialogTitle"
+    :visible.sync="dialogProcessRecords"
+    :close-on-click-modal="false"
+    @close="handleProcessRecordsCancelAdd"
+    :width="600 + 'px'"
+    :style="{ maxHeight: '100vh', overflowY: 'auto' }"
+    >
+
+    <el-form
+          :rules="rulesProcessRecordsParm"
+          :inline="true"
+          :model="processRecordsParammapsParm"
+          label-position="left"
+          label-width="auto"
+          style="width: 90%; margin: 0 auto 30px"
+        >
+
+        <el-row :gutter="24" style="display: flex; justify-content: center;">
+            <el-form-item label="序号: " prop="sort" >
+                <el-input
+                style="width: 254px;height: 40px;"
+                v-model="processRecordsParammapsParm.sort"
+                :disabled="false"
+              />
+            </el-form-item>
+        </el-row>
+
+        <el-row :gutter="24" style="display: flex; justify-content: center;">
+            <el-form-item label="工序: " prop="process" >
+                <el-input
+                style="width: 254px;height: 40px;"
+                v-model="processRecordsParammapsParm.process"
+                :disabled="false"
+              />
+            </el-form-item>
+        </el-row>
+
+        <el-row :gutter="24" style="display: flex; justify-content: center;">
+            <el-form-item label="备注: " prop="remark" >
+                <el-input
+                style="width: 254px;height: 40px;"
+                v-model="processRecordsParammapsParm.remark"
+                :disabled="false"
+              />
+            </el-form-item>
+        </el-row>
+        
+        <el-row :gutter="24" style="display: flex; justify-content: flex-end; margin-top: 20px;"> 
+        <el-button type="primary" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsAddData">保存并新增</el-button>
+        <el-button type="primary" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsAddCancelData">保存并关闭</el-button>
+        <el-button type="primary" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsCancelAdd">取消</el-button>
+    </el-row>
+        
+    </el-form>
+
+
+
+    </el-dialog>
+
+
+    <el-dialog
+    :title="dialogTitle"
+    :visible.sync="dialogProcessRecords"
+    :close-on-click-modal="false"
+    @close="handleProcessRecordsCancelAdd"
+    :width="600 + 'px'"
+    :style="{ maxHeight: '100vh', overflowY: 'auto' }"
+    >
+
+    <el-form
+          :rules="rulesProcessRecordsParm"
+          :inline="true"
+          :model="processRecordsParammapsParm"
+          label-position="left"
+          label-width="auto"
+          style="width: 90%; margin: 0 auto 30px"
+        >
+
+        <el-row :gutter="24" style="display: flex; justify-content: center;">
+            <el-form-item label="序号: " prop="sort" >
+                <el-input
+                style="width: 254px;height: 40px;"
+                v-model="processRecordsParammapsParm.sort"
+                :disabled="false"
+              />
+            </el-form-item>
+        </el-row>
+
+        <el-row :gutter="24" style="display: flex; justify-content: center;">
+            <el-form-item label="工序: " prop="process" >
+                <el-input
+                style="width: 254px;height: 40px;"
+                v-model="processRecordsParammapsParm.process"
+                :disabled="false"
+              />
+            </el-form-item>
+        </el-row>
+
+        <el-row :gutter="24" style="display: flex; justify-content: center;">
+            <el-form-item label="备注: " prop="remark" >
+                <el-input
+                style="width: 254px;height: 40px;"
+                v-model="processRecordsParammapsParm.remark"
+                :disabled="false"
+              />
+            </el-form-item>
+        </el-row>
+        
+        <el-row :gutter="24" style="display: flex; justify-content: flex-end; margin-top: 20px;"> 
+        <el-button type="primary" v-if="!this.dialogProcessRecordsEdit"  class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsAddData">保存并新增</el-button>
+        <el-button type="primary" v-if="dialogProcessRecordsEdit" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsEditCancelData">保存并关闭</el-button>
+        <el-button type="primary" v-if="!dialogProcessRecordsEdit" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsAddCancelData">保存并关闭</el-button>
+        <el-button type="primary" class="add-button" style="padding: 10px 20px;" size="mini" @click="handleProcessRecordsCancelAdd">取消</el-button>
+    </el-row>
+        
+    </el-form>
+
+
+
+    </el-dialog>
+
+</div>
 </template>
 
 
+
 <script>
-</script>
+import 'element-ui/lib/theme-chalk/index.css';
+import Cookies from 'js-cookie';
+import {
+  GetDataByName,
+  postJson,
+  GetDataByNames,
+  partslistSGv2,
+  PostDataByName,
+  ExecDataByConfig,
+  GetAccount, transData
+} from '@/api/common';
+import Pagination from '@/components/Pagination';
+import { MessageBox } from 'element-ui';
+import waves from '@/directive/waves'; // waves directive
+import TreeSelect from '@/components/TreeSelect'; // 确保路径正确
+
+
+export default {
+  components: { Pagination ,TreeSelect},
+  directives: { waves },
+  inject: ['reload'],
+  data() {
+    return {
+        list:[],
+        processList :[],
+        pid :0,
+        listLoading: false,
+        tableKey: 0,
+        nodeKey: 'id',
+        placeholder: '请选择上级分类',
+        myHeight: document.documentElement.clientHeight - 85 - 250,
+        defaultCheckedKeys: [], // 默认选中 的节点
+        getProcessParm:{name:'getProcess'},
+        getProcessDetailsParm:{name:'getProcess',parammaps:{}},
+        dialogTitle :'',
+        dialogProcessRecords :false,//工序新增
+          rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+        dialogProcessRecordsEdit:false,
+        dialogControls:false, //操作弹窗
+        dialogControlsEdit:false, //编辑
+        dialogControlsAdd:false, //操作弹窗
+        addControlsParm:{name:'addProcess',parammaps:{}},
+        delControlsParm:{name:'delProcess',parammaps:{}},
+        editControlsParm:{name:'editProcess',parammaps:{},process:''},
+        addProcessRecordsParm:{name:'addProcessRecords',parammaps:{ process: '',  sort: '',remarks: ''}},
+        processRecordsParammapsParm :{process: '',  sort: '',remark: ''},
+        getProcessRecordsParm:{name:'getProcessRecords',parammaps:{ pid:''}},
+        delProcessRecordsParm:{name:'delProcessRecords',parammaps:{ id:''}},
+        editProcessRecordsParm:{name:'editProcessRecords',parammaps:{}},
+        defaultProps: {
+          children: 'children',
+          label: 'process'
+        },
+        rules:[],
+        rulesAddManufacture : {
+            process: [
+            { required: true, message: '货品不能为空', trigger: 'blur' },
+            ]
+        },
+        rulesEditManufacture: {
+            process: [
+            { required: true, message: '货品不能为空', trigger: 'blur' },
+            ]
+        },
+        rulesProcessRecordsParm: {
+            process: [
+            { required: true, message: '工序不能为空', trigger: 'blur' },
+            ],
+            sort: [
+            { required: true, message: '序号不能为空', trigger: 'blur' },
+            ]
+        },
+    };
+  },
+  methods: {
+    delProcessRecordsData(row){
+        MessageBox.confirm('名称:' + row.process, '确认删除?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(() => {
+        this.delProcessRecordsParm.parammaps.id = row.id ;
+        PostDataByName(this.delProcessRecordsParm).then(response => {
+          if (response.msg !== 'fail') {
+            this.dialogProcessRecords = false;
+            this.dialogTitle = '';
+            this.get_process_records();
+            this.$notify({
+              title: '成功',
+              message: '删除成功',
+              type: 'success',
+              duration: 2000,
+            });
+          } else {
+            failproccess(response, this.$notify);
+          }
+        });
+      });
+    },
+    handleProcessRecordsEditCancelData(){
+        this.processRecordsParammapsParm.pid = this.pid;
+        this.editProcessRecordsParm.parammaps = this.processRecordsParammapsParm;
+        PostDataByName(this.editProcessRecordsParm).then(response => {
+          if (response.msg !== 'fail') {
+            this.dialogProcessRecords = false;
+            this.dialogTitle = '';
+            this.get_process_records();
+            this.$notify({
+              title: '成功',
+              message: '修改成功',
+              type: 'success',
+              duration: 2000,
+            });
+          } else {
+            failproccess(response, this.$notify);
+          }
+        });
+    },
+    handleProcessRecordsAddCancelData(){
+        this.processRecordsParammapsParm.pid = this.pid;
+        this.addProcessRecordsParm.parammaps = this.processRecordsParammapsParm;
+        PostDataByName(this.addProcessRecordsParm).then(response => {
+          if (response.msg !== 'fail') {
+            this.dialogProcessRecords = false;
+            this.dialogTitle = '';
+            // this.get_process_data();
+            this.$notify({
+              title: '成功',
+              message: '新增成功',
+              type: 'success',
+              duration: 2000,
+            });
+          } else {
+            failproccess(response, this.$notify);
+          }
+        });
+    },
+    handleProcessRecordsAddData(){
+        this.processRecordsParammapsParm.pid = this.pid;
+        this.addProcessRecordsParm.parammaps = this.processRecordsParammapsParm;
+        PostDataByName(this.addProcessRecordsParm).then(response => {
+          if (response.msg !== 'fail') {
+            // this.dialogControlsEdit = false;
+            // this.dialogTitle = '';
+            // this.get_process_data();
+            this.$notify({
+              title: '成功',
+              message: '新增成功',
+              type: 'success',
+              duration: 2000,
+            });
+          } else {
+            failproccess(response, this.$notify);
+          }
+        });
+    },
+    handleProcessRecordsAdd(){
+        this.dialogProcessRecords = true;
+        this.dialogTitle = '新增工序';
+    },
+    handleProcessRecordsCancelAdd(){
+        this.dialogProcessRecords = false;
+        this.dialogTitle = '';
+        this.processRecordsParammapsParm = {};
+        this.dialogProcessRecordsEdit = false;
+    },
+    handleProcessRecordsEdit(row){
+        this.processRecordsParammapsParm.id = row.id;
+        this.dialogProcessRecords = true;
+        this.dialogTitle = '编辑';
+        this.dialogProcessRecordsEdit = true;
+        this.processRecordsParammapsParm.process = row.process;
+        this.processRecordsParammapsParm.sort = row.sort;
+        this.processRecordsParammapsParm.remark = row.remark;
+    },
+    handleControlsEditData(){
+        this.editControlsParm.parammaps.process =  this.editControlsParm.process;
+        PostDataByName(this.editControlsParm).then(response => {
+          if (response.msg !== 'fail') {
+            this.dialogControlsEdit = false;
+            this.dialogTitle = '';
+            this.get_process_data();
+            this.$notify({
+              title: '成功',
+              message: '保存成功',
+              type: 'success',
+              duration: 2000,
+            });
+          } else {
+            failproccess(response, this.$notify);
+          }
+        });
+    },
+    handleEdit(row){
+        this.dialogControlsEdit = true;
+         this.dialogTitle = '编辑生产名称';
+         this.editControlsParm.parammaps.id = row.id ;
+        //  this.editControlsParm.parammaps.process = row.process;
+         this.editControlsParm.parammaps.pid = row.pid;
+         this.editControlsParm.process= row.process;
+         this.defaultCheckedKeys = [row.pid];
+    },
+    handleDel(row){
+        MessageBox.confirm('名称:' + row.process, '确认删除?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(() => {
+        console.log(row);
+        this.delControlsParm.parammaps.id = row.id;
+        PostDataByName(this.delControlsParm).then(response => {
+          if (response.msg !== 'fail') {
+            this.get_process_data();
+            this.$notify({
+              title: '成功',
+              message: '删除成功',
+              type: 'success',
+              duration: 2000,
+            });
+          } else {
+            failproccess(response, this.$notify);
+          }
+        });
+      });
+    },
+    popoverHide(checkedIds,checkedData) {
+        if (checkedIds !== null) {
+          this.addControlsParm.parammaps.pid = checkedData.id
+        } else {
+          this.addControlsParm.parammaps.pid ='';
+        }
+      },
+    handleCancelAdd(){
+        this.dialogControlsAdd = false;
+        this.dialogTitle = '';
+        this.dialogControlsEdit = false;
+        this.addControlsParm = {name:'addProcess',parammaps:{}};
+    },
+    handleControlsAdd(){
+        this.dialogControlsAdd = true;
+        this.dialogTitle = '添加生产名称'
+    },
+    handleControlsAddData(){
+    this.addControlsParm.parammaps.process =  this.addControlsParm.process;
+        PostDataByName(this.addControlsParm).then(response => {
+          if (response.msg !== 'fail') {
+            this.dialogControlsAdd = false;
+            this.dialogTitle = '';
+            this.get_process_data();
+            this.addControlsParm = {name:'addProcess',parammaps:{}};
+            this.$notify({
+              title: '成功',
+              message: '保存成功',
+              type: 'success',
+              duration: 2000,
+            });
+          } else {
+            failproccess(response, this.$notify);
+          }
+        });
+    },
+    handleControls(){
+        this.dialogControls = true;
 
+    },
+    handleCancel(){
+        this.dialogControls = false;
+        this.dialogTitle = '';
+    },
+    handleNodeClick(data,node){
+        if (node.isLeaf) {
+            this.pid = data.id;
+            this.get_process_records()
+        }
+    },
+    get_process_records(){
+        this.getProcessRecordsParm.parammaps.pid = this.pid;
+        GetDataByName(this.getProcessRecordsParm).then((response) => {
+          if (response.data && response.data.list) { 
+            this.list = response.data.list;
+            this.listLoading = false;
+          }else{
+            this.list = [];
+            this.listLoading = false;
+          }
+        });
+    },
+    get_process_data() {
+        GetDataByName(this.getProcessParm).then((response) => {
+          if (response.data && response.data.list) { 
+            this.processList = transData( response.data.list, 'id', 'pid', 'children');
+            for (let index = 0; index < this.processList.length; index++) {
+                this.processList[index].number = index+1;
+            }
+          }else{
+           this.processList = [];
+            this.listLoading = false;
+          }
+        });
+      },
+  },
+ 
+  created() {
+    this.get_process_data()
+  },
+};
+</script>
 
 <style>
+.el-input--small .el-input__inner {
+  height: 40px;  /* 调整输入框高度 */
+  line-height: 40px;
+}
+
+
+.add-button {
+  background-color: #2196f3; /* 绿色背景 */
+  color: white; /* 白色文字 */
+  border-radius: 5px; /* 圆角 */
+  cursor: pointer; /* 鼠标悬停时显示手型 */
+  font-size: 16px; /* 字体大小 */
+  transition: background-color 0.3s ease; /* 背景颜色过渡效果 */
+  border: 0.01px solid #ccc; /* 黑色边框,宽度为 2px */
+}
+
+.el-card {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+}
+
+
 </style>

+ 24 - 7
src/views/productManagement/productionWorkOrder/index.vue

@@ -116,13 +116,13 @@
           <el-table-column label="下单时间" align="center" prop="orderTime" />
           <el-table-column label="接单时间" align="center" prop="acceptTime" />
           <el-table-column label="预估完成时间" align="center" prop="estimatedCompletionTime" />
-          <el-table-column label="距预估时间还剩/天" align="center" prop="days_diff" />
+          <el-table-column label="距预估时间还剩/天" align="center" prop="days_diff"  sortable />
           <el-table-column label="实际完成时间" align="center" prop="actualCompletionTime" />
           <el-table-column label="处理状态" align="center" prop="orderStatus" />
           <el-table-column label="接单人" align="center" prop="acceptername" />
           <el-table-column label="备注" align="center" prop="remarks" />
 
-          <el-table-column label="操作" min-width="250px" header-align="center" align="center">
+          <el-table-column label="操作" min-width="250px" header-align="center" align="center" fixed="right">
             <template slot-scope="scope">
               <el-button class="add-button" type="primary" size="mini" @click="handleGet(scope.row)">查看</el-button>
               <el-button class="add-button" v-if="scope.row.orderStatus === '待接单'" :style="{ backgroundColor: '#28d251' }" size="mini" @click="handleOrderTaking(scope.row)">接单</el-button>
@@ -316,7 +316,7 @@
                   />
                 </template>
               </el-table-column>
-
+<!-- 
               <el-table-column label="优先级" align="center">
                 <template slot-scope="scope">
                   <el-select
@@ -334,7 +334,7 @@
                     />
                   </el-select>
                 </template>
-              </el-table-column>
+              </el-table-column> -->
 
               <el-table-column>
                 <template slot-scope="scope">
@@ -344,10 +344,11 @@
             </el-table>
           </el-row>
 
-          <el-row :gutter="24">
-            <span style="font-size: 20px; margin-top: 15px;font-weight: bold;display: block;margin-bottom:15px;">工序</span>
+          <el-row :gutter="24" style="margin-top: 10px;">
+            <span style="font-size: 22px; margin-top: 15px;font-weight: bold;margin-bottom:15px;">工序</span>
+            <el-button type="primary" style="margin-left: 10px;padding: 10px;" size="mini" @click="handleProcess">选择工序</el-button>
           </el-row>
-          <el-row :gutter="24">
+          <el-row :gutter="24" style="margin-top: 10px;">
             <el-table
               :key="tableKey"
               v-loading="listLoading"
@@ -1077,6 +1078,7 @@ export default {
       active: 1,
       listLoading: true,
       isView: false,
+      isProcess: false,
       dialogFormVisible: false,
       dialogGetVisible: false,
       isOrderTaking: false, //接单
@@ -1087,6 +1089,7 @@ export default {
       activeMenuItem: 1,
       listAdd: [],
       workList: [],
+      processList:[],
       priorityList: [
         { id: '紧张', name: '紧张' },
         { id: '高', name: '高' },
@@ -1149,6 +1152,10 @@ export default {
     };
   },
   methods: {
+    handleProcess(){
+      this.isProcess = true;
+      
+    },
     spanMethod({ row, column, rowIndex, columnIndex }) {
       if (columnIndex < 5) {
         const _row = this.spanArr[rowIndex];
@@ -1609,6 +1616,9 @@ export default {
       this.getProductionOrderGoodsParm.parammaps.id = id;
       GetDataByName(this.getProductionOrderGoodsParm).then((response) => {
         if (response.data && response.data.list) {
+          for (let index = 0; index < response.data.list.length; index++) {
+            response.data.list[index].goodsImagePath =  process.env.VUE_APP_BASE_API +response.data.list[index].goodsImagePath;
+          }
           this.productionOrderGoodsList = response.data.list;
         } else {
           // this.list = [];
@@ -1631,6 +1641,10 @@ export default {
 
       GetDataByName(this.getProductionWorkOrder).then((response) => {
         if (response.data && response.data.list) {
+        // for (let index = 0; index < response.data.list.length; index++) {
+        //   response.data.list[index].goodsImagePath = process.env.VUE_APP_BASE_API + response.data.list[index].goodsImagePath;
+          
+        // }
           this.list = response.data.list;
           this.listLoading = false;
           this.pageNum = response.data.pageNum;
@@ -1663,6 +1677,9 @@ export default {
     get_goods_list() {
       GetDataByName(this.getGoodsListByCodeParm).then((response) => {
         if (response.data && response.data.list) {
+          for (let index = 0; index < response.data.list.length; index++) {
+            response.data.list[index].goodsImagePath =  process.env.VUE_APP_BASE_API +response.data.list[index].goodsImagePath;
+          }
           this.goodsList = response.data.list;
         }
       });