逻辑优化
This commit is contained in:
		
							parent
							
								
									937fdf799a
								
							
						
					
					
						commit
						8383351d8e
					
				| 
						 | 
					@ -51,19 +51,19 @@
 | 
				
			||||||
            <el-button
 | 
					            <el-button
 | 
				
			||||||
                size="mini"
 | 
					                size="mini"
 | 
				
			||||||
                type="text"
 | 
					                type="text"
 | 
				
			||||||
                v-if="scope.row.cardStatus==1"
 | 
					                :disabled="scope.row.cardStatus!=1"
 | 
				
			||||||
                @click="handleChangeCard(scope.row)" 
 | 
					                @click="handleChangeCard(scope.row)" 
 | 
				
			||||||
            >换卡</el-button>
 | 
					            >换卡</el-button>
 | 
				
			||||||
            <el-button
 | 
					            <el-button
 | 
				
			||||||
                size="mini"
 | 
					                size="mini"
 | 
				
			||||||
                type="text" 
 | 
					                type="text" 
 | 
				
			||||||
                v-if="scope.row.cardStatus==1"
 | 
					                :disabled="scope.row.cardStatus!=1"
 | 
				
			||||||
                @click="handleReturn(scope.row)" 
 | 
					                @click="handleReturn(scope.row)" 
 | 
				
			||||||
            >退卡</el-button>
 | 
					            >退卡</el-button>
 | 
				
			||||||
            <el-button
 | 
					            <el-button
 | 
				
			||||||
                size="mini"
 | 
					                size="mini"
 | 
				
			||||||
                type="text" 
 | 
					                type="text" 
 | 
				
			||||||
                v-if="scope.row.cardStatus==1"
 | 
					                :disabled="scope.row.cardStatus!=1"
 | 
				
			||||||
                @click="handleLoss(scope.row)" 
 | 
					                @click="handleLoss(scope.row)" 
 | 
				
			||||||
            >挂失</el-button>
 | 
					            >挂失</el-button>
 | 
				
			||||||
            <el-button
 | 
					            <el-button
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,7 +37,7 @@
 | 
				
			||||||
                    <span v-else>无</span>
 | 
					                    <span v-else>无</span>
 | 
				
			||||||
                </template>
 | 
					                </template>
 | 
				
			||||||
            </el-table-column>
 | 
					            </el-table-column>
 | 
				
			||||||
            <el-table-column label="图片地址" align="center" prop="imgUrl" :show-overflow-tooltip="true"/>
 | 
					            <!-- <el-table-column label="图片地址" align="center" prop="imgUrl" :show-overflow-tooltip="true"/> -->
 | 
				
			||||||
            <el-table-column label="用途类型" align="center" prop="usageType" :show-overflow-tooltip="true">
 | 
					            <el-table-column label="用途类型" align="center" prop="usageType" :show-overflow-tooltip="true">
 | 
				
			||||||
                <template scope="scope">
 | 
					                <template scope="scope">
 | 
				
			||||||
                    <span v-if="scope.row.usageType==1">后台</span>
 | 
					                    <span v-if="scope.row.usageType==1">后台</span>
 | 
				
			||||||
| 
						 | 
					@ -110,13 +110,13 @@
 | 
				
			||||||
                        </el-form-item> 
 | 
					                        </el-form-item> 
 | 
				
			||||||
                    </el-col> 
 | 
					                    </el-col> 
 | 
				
			||||||
                </el-row>
 | 
					                </el-row>
 | 
				
			||||||
                <el-row>
 | 
					                <!-- <el-row>
 | 
				
			||||||
                    <el-col :span="24">
 | 
					                    <el-col :span="24">
 | 
				
			||||||
                        <el-form-item label="图片地址">
 | 
					                        <el-form-item label="图片地址">
 | 
				
			||||||
                            <el-input  v-model="form.imgUrl" placeholder="图片地址" disabled clearable/>
 | 
					                            <el-input  v-model="form.imgUrl" placeholder="图片地址" disabled clearable/>
 | 
				
			||||||
                        </el-form-item> 
 | 
					                        </el-form-item> 
 | 
				
			||||||
                    </el-col> 
 | 
					                    </el-col> 
 | 
				
			||||||
                </el-row> 
 | 
					                </el-row>  -->
 | 
				
			||||||
                <el-row>
 | 
					                <el-row>
 | 
				
			||||||
                    <el-col :span="24">
 | 
					                    <el-col :span="24">
 | 
				
			||||||
                        <el-form-item label="图片" prop="imgUrl">
 | 
					                        <el-form-item label="图片" prop="imgUrl">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -238,11 +238,13 @@
 | 
				
			||||||
          <el-button @click="cancel">取 消</el-button>
 | 
					          <el-button @click="cancel">取 消</el-button>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
      </el-dialog>
 | 
					      </el-dialog>
 | 
				
			||||||
 | 
					      <!-- 图片查看 -->
 | 
				
			||||||
      <el-dialog :visible.sync="dialogVisible" width="700px">
 | 
					      <el-dialog :visible.sync="dialogVisible" width="700px">
 | 
				
			||||||
        <img style="width: 100%;height: 100%;" :src="dialogImageUrl" alt="">
 | 
					        <img style="width: 100%;height: 100%;" :src="dialogImageUrl" alt="">
 | 
				
			||||||
      </el-dialog>
 | 
					      </el-dialog>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      <el-dialog :title="titleProduct" :visible.sync="openProduct" width="1200px" append-to-body>
 | 
					      <el-dialog :title="titleProduct" :visible.sync="openProduct" width="1200px" append-to-body>
 | 
				
			||||||
        <div class="app-container" id="toolsType">
 | 
					        <div>
 | 
				
			||||||
          <el-row>
 | 
					          <el-row>
 | 
				
			||||||
            <el-form
 | 
					            <el-form
 | 
				
			||||||
              :model="queryShopParams"
 | 
					              :model="queryShopParams"
 | 
				
			||||||
| 
						 | 
					@ -258,7 +260,6 @@
 | 
				
			||||||
                  placeholder="请输入商品名称"
 | 
					                  placeholder="请输入商品名称"
 | 
				
			||||||
                  clearable maxlength="30"
 | 
					                  clearable maxlength="30"
 | 
				
			||||||
                  style="width: 240px"
 | 
					                  style="width: 240px"
 | 
				
			||||||
                  @keyup.enter.native="handleShopQuery"
 | 
					 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
              </el-form-item>
 | 
					              </el-form-item>
 | 
				
			||||||
              <el-form-item label="上架状态" prop="putawayState">
 | 
					              <el-form-item label="上架状态" prop="putawayState">
 | 
				
			||||||
| 
						 | 
					@ -276,7 +277,6 @@
 | 
				
			||||||
                  placeholder="请输入条码"
 | 
					                  placeholder="请输入条码"
 | 
				
			||||||
                  clearable maxlength="30"
 | 
					                  clearable maxlength="30"
 | 
				
			||||||
                  style="width: 240px"
 | 
					                  style="width: 240px"
 | 
				
			||||||
                  @keyup.enter.native="handleShopQuery"
 | 
					 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
              </el-form-item>
 | 
					              </el-form-item>
 | 
				
			||||||
              <el-form-item>
 | 
					              <el-form-item>
 | 
				
			||||||
| 
						 | 
					@ -310,51 +310,24 @@
 | 
				
			||||||
              </div>
 | 
					              </div>
 | 
				
			||||||
              <div class="head-container">
 | 
					              <div class="head-container">
 | 
				
			||||||
                <el-tree
 | 
					                <el-tree
 | 
				
			||||||
                  style="height: 700px; overflow: scroll"
 | 
					                  style="height: 500px; overflow: scroll"
 | 
				
			||||||
                  :data="treeShopOptions"
 | 
					                  :data="treeShopOptions"
 | 
				
			||||||
                  :props="defaultProps"
 | 
					                  :props="defaultProps"
 | 
				
			||||||
                  :show-checkbox="true"
 | 
					                  :show-checkbox="true"
 | 
				
			||||||
                  :default-expand-all="true"
 | 
					                  :default-expand-all="true"
 | 
				
			||||||
                  :expand-on-click-node="false"
 | 
					                  :expand-on-click-node="false"
 | 
				
			||||||
                  :filter-node-method="filterNode"
 | 
					                  :filter-node-method="filterNode"
 | 
				
			||||||
                  ref="typeTree"
 | 
					                  ref="typeTree" 
 | 
				
			||||||
                  node-key="materialTypeId"
 | 
					                  node-key="id"
 | 
				
			||||||
                  highlight-current
 | 
					                  highlight-current
 | 
				
			||||||
                  @node-click="handleNodeClick"
 | 
					                  @node-click="handleNodeClick"
 | 
				
			||||||
                  @check-change="handleCheckChange"
 | 
					                  @check-change="handleCheckChange"
 | 
				
			||||||
                >
 | 
					                >
 | 
				
			||||||
                    <span class="custom-tree-node" slot-scope="{ node, data }" @mousemove="onMousemove(data)" @mouseleave="onMouseleave()">
 | 
					                    <span class="custom-tree-node" slot-scope="{ node, data }">
 | 
				
			||||||
                      <span v-if="isMousemoveId === data.id && node.label.length > 5">{{
 | 
					                      <span v-if="node.label.length > 5">{{
 | 
				
			||||||
                          node.label.slice(0, 5) + "..."
 | 
					                          node.label.slice(0, 5) + "..."
 | 
				
			||||||
                        }}</span>
 | 
					                        }}</span>
 | 
				
			||||||
                      <span v-else>{{ node.label }}</span>
 | 
					                      <span v-else>{{ node.label }}</span> 
 | 
				
			||||||
                      <span class="btn-items" v-if="isMousemoveId === data.id">
 | 
					 | 
				
			||||||
                        <el-button
 | 
					 | 
				
			||||||
                          type="text"
 | 
					 | 
				
			||||||
                          size="mini"
 | 
					 | 
				
			||||||
                          icon="el-icon-plus" v-if="data.level<1"
 | 
					 | 
				
			||||||
                          @click.stop="() => appendTreeNode(data)"
 | 
					 | 
				
			||||||
                        >
 | 
					 | 
				
			||||||
                        </el-button>
 | 
					 | 
				
			||||||
                         <el-button
 | 
					 | 
				
			||||||
                          type="text"
 | 
					 | 
				
			||||||
                          size="mini"
 | 
					 | 
				
			||||||
                          icon="el-icon-edit-outline"
 | 
					 | 
				
			||||||
                          style="color: #67c23a"
 | 
					 | 
				
			||||||
                          v-if="data.id !== 0"
 | 
					 | 
				
			||||||
                          @click.stop="() => editTreeNode(data)"
 | 
					 | 
				
			||||||
                        >
 | 
					 | 
				
			||||||
                        </el-button>
 | 
					 | 
				
			||||||
                        <el-button
 | 
					 | 
				
			||||||
                          type="text"
 | 
					 | 
				
			||||||
                          size="mini"
 | 
					 | 
				
			||||||
                          icon="el-icon-delete"
 | 
					 | 
				
			||||||
                          style="color: #f56c6c"
 | 
					 | 
				
			||||||
                          v-if="data.parentId != '0'"
 | 
					 | 
				
			||||||
                          @click.stop="() => removeTreeNode(data)"
 | 
					 | 
				
			||||||
                        >
 | 
					 | 
				
			||||||
                        </el-button>
 | 
					 | 
				
			||||||
                      </span>
 | 
					 | 
				
			||||||
                    </span>
 | 
					                    </span>
 | 
				
			||||||
                </el-tree>
 | 
					                </el-tree>
 | 
				
			||||||
              </div>
 | 
					              </div>
 | 
				
			||||||
| 
						 | 
					@ -458,106 +431,88 @@
 | 
				
			||||||
      </el-dialog>
 | 
					      </el-dialog>
 | 
				
			||||||
      <!-- 商品编辑对话框 -->
 | 
					      <!-- 商品编辑对话框 -->
 | 
				
			||||||
      <el-dialog :title="titleProductEitd" :visible.sync="openProductEitd" width="980px" append-to-body>
 | 
					      <el-dialog :title="titleProductEitd" :visible.sync="openProductEitd" width="980px" append-to-body>
 | 
				
			||||||
          <el-form ref="form" :model="productFrom" label-width="90px">
 | 
					          <el-form ref="form" :model="productFrom" label-width="110px">
 | 
				
			||||||
              <el-row justify="center">
 | 
					              <el-row>
 | 
				
			||||||
                <table  align="center" width="80%" cellspacing="0">
 | 
					                <el-col :span="12">
 | 
				
			||||||
                  <tr >
 | 
					                  <el-form-item label="商品名称" prop="materialName">
 | 
				
			||||||
                    <td  colspan="4" class="table-title">商品</td>
 | 
					                    <el-input v-model="productFrom.materialName" disabled/>
 | 
				
			||||||
                  </tr>
 | 
					                  </el-form-item>
 | 
				
			||||||
                  <tr >
 | 
					                </el-col>
 | 
				
			||||||
                    <td  class="table-label"><span >名称</span></td>
 | 
					                <el-col :span="12">
 | 
				
			||||||
                    <td  class="table-content">
 | 
					                  <el-form-item label="商品单位" prop="unitName">
 | 
				
			||||||
                      <el-input
 | 
					                    <el-input v-model="productFrom.unitName" disabled/>
 | 
				
			||||||
                        v-model="productFrom.materialName"
 | 
					                  </el-form-item>
 | 
				
			||||||
                        disabled
 | 
					                </el-col>
 | 
				
			||||||
                      />
 | 
					                <el-col :span="12">
 | 
				
			||||||
                    </td>
 | 
					                  <el-form-item label="商品条码" prop="barCode">
 | 
				
			||||||
                    <td  class="table-label"><span >单位</span></td>
 | 
					                    <el-input v-model="productFrom.barCode" disabled/>
 | 
				
			||||||
                    <td  class="table-content">
 | 
					                  </el-form-item>
 | 
				
			||||||
                      <el-input
 | 
					                </el-col>
 | 
				
			||||||
                        v-model="productFrom.unitName"
 | 
					                <el-col :span="12">
 | 
				
			||||||
                        disabled
 | 
					                  <el-form-item label="零售价" prop="salePrice">
 | 
				
			||||||
                      />
 | 
					                    <el-input
 | 
				
			||||||
                    </td>
 | 
					 | 
				
			||||||
                  </tr>
 | 
					 | 
				
			||||||
                  <tr >
 | 
					 | 
				
			||||||
                    <td  class="table-label"><span >条码</span></td>
 | 
					 | 
				
			||||||
                    <td  class="table-content">
 | 
					 | 
				
			||||||
                      <el-input
 | 
					 | 
				
			||||||
                        v-model="productFrom.barCode"
 | 
					 | 
				
			||||||
                        disabled
 | 
					 | 
				
			||||||
                      />
 | 
					 | 
				
			||||||
                    </td>
 | 
					 | 
				
			||||||
                    <td  class="table-label"><span >零售价</span></td>
 | 
					 | 
				
			||||||
                    <td  class="table-content">
 | 
					 | 
				
			||||||
                      <el-input
 | 
					 | 
				
			||||||
                        v-model="productFrom.salePrice"
 | 
					                        v-model="productFrom.salePrice"
 | 
				
			||||||
                        placeholder="请输入"
 | 
					                        placeholder="请输入"
 | 
				
			||||||
                         @input="handleNumberInput"
 | 
					                         @input="handleNumberInput"
 | 
				
			||||||
                      />
 | 
					                      />
 | 
				
			||||||
                    </td>
 | 
					                  </el-form-item>
 | 
				
			||||||
                  </tr>
 | 
					                </el-col>
 | 
				
			||||||
                  <tr >
 | 
					                <el-col :span="12">
 | 
				
			||||||
                    <td  class="table-label"><span >会员价</span></td>
 | 
					                  <el-form-item label="会员价" prop="prefPrice">
 | 
				
			||||||
                    <td  class="table-content">
 | 
					                    <el-input
 | 
				
			||||||
                      <el-input
 | 
					 | 
				
			||||||
                        v-model="productFrom.prefPrice"
 | 
					                        v-model="productFrom.prefPrice"
 | 
				
			||||||
                        placeholder="请输入"
 | 
					                        placeholder="请输入"
 | 
				
			||||||
                         @input="handleNumberInput"
 | 
					                         @input="handleNumberInput"
 | 
				
			||||||
                      />
 | 
					                      />
 | 
				
			||||||
                    </td>
 | 
					                  </el-form-item>
 | 
				
			||||||
                    <td  class="table-label"><span >个人限购数量</span></td>
 | 
					                </el-col>
 | 
				
			||||||
                    <td  class="table-content">
 | 
					
 | 
				
			||||||
                      <el-input
 | 
					                <el-col :span="12">
 | 
				
			||||||
 | 
					                  <el-form-item label="个人限购数量" prop="personLimit">
 | 
				
			||||||
 | 
					                    <el-input
 | 
				
			||||||
                        v-model="productFrom.personLimit"
 | 
					                        v-model="productFrom.personLimit"
 | 
				
			||||||
                        placeholder="请输入"
 | 
					                        placeholder="请输入"
 | 
				
			||||||
                         @input="handleNumberInput"
 | 
					                         @input="handleNumberInput"
 | 
				
			||||||
                      />
 | 
					                      />
 | 
				
			||||||
                    </td>
 | 
					                  </el-form-item>
 | 
				
			||||||
                  </tr>
 | 
					                </el-col>
 | 
				
			||||||
                  <tr >
 | 
					                <el-col :span="12">
 | 
				
			||||||
                    <td  class="table-label"><span >每日限购数量</span></td>
 | 
					                  <el-form-item label="每日限购数量" prop="oneDayLimit">
 | 
				
			||||||
                    <td  class="table-content">
 | 
					                    <el-input
 | 
				
			||||||
                      <el-input
 | 
					 | 
				
			||||||
                        v-model="productFrom.oneDayLimit"
 | 
					                        v-model="productFrom.oneDayLimit"
 | 
				
			||||||
                        placeholder="请输入"
 | 
					                        placeholder="请输入"
 | 
				
			||||||
                         @input="handleNumberInput"
 | 
					                         @input="handleNumberInput"
 | 
				
			||||||
                      />
 | 
					                      />
 | 
				
			||||||
                    </td>
 | 
					                  </el-form-item>
 | 
				
			||||||
                    <td  class="table-label"><span >库存</span></td>
 | 
					                </el-col>
 | 
				
			||||||
                    <td  class="table-content">
 | 
					                <el-col :span="12">  
 | 
				
			||||||
                      <el-input
 | 
					                  <el-form-item label="库存" prop="inventoryNum">
 | 
				
			||||||
 | 
					                    <el-input
 | 
				
			||||||
                        v-model="productFrom.inventoryNum"
 | 
					                        v-model="productFrom.inventoryNum"
 | 
				
			||||||
                        placeholder="请输入"
 | 
					                        placeholder="请输入"
 | 
				
			||||||
                        @input="handleNumberInput"
 | 
					                         @input="handleNumberInput"
 | 
				
			||||||
                      />
 | 
					                      />
 | 
				
			||||||
                    </td>
 | 
					                  </el-form-item>
 | 
				
			||||||
                  </tr>
 | 
					                </el-col>
 | 
				
			||||||
                  <tr >
 | 
					
 | 
				
			||||||
                    <td  class="table-label"><span >上架状态</span></td>
 | 
					                <el-col :span="12">   
 | 
				
			||||||
                    <td  class="table-content">
 | 
					                  <el-form-item label="上架状态" prop="putawayState">
 | 
				
			||||||
                      <template>
 | 
					                    <el-switch 
 | 
				
			||||||
                        <span>{{ '下架' }}</span>
 | 
					                        v-model="productFrom.putawayState"
 | 
				
			||||||
                        <el-switch
 | 
					                        active-value="1" active-text="上架"
 | 
				
			||||||
                          v-model="productFrom.putawayStatef"
 | 
					                        inactive-value="2" inactive-text="下架">
 | 
				
			||||||
                          @change="handlePutawayStateEitdChange(productFrom)">
 | 
					                    </el-switch>
 | 
				
			||||||
                        </el-switch>
 | 
					                  </el-form-item>
 | 
				
			||||||
                        <span>{{'上架' }}</span>
 | 
					                </el-col>
 | 
				
			||||||
                      </template>
 | 
					                <el-col :span="12">  
 | 
				
			||||||
                    </td>
 | 
					                  <el-form-item label="线上销售" prop="ifOnline">
 | 
				
			||||||
                    <td  class="table-label"><span >线上销售</span></td>
 | 
					                     <el-switch 
 | 
				
			||||||
                    <td  class="table-content">
 | 
					                        v-model="productFrom.ifOnline"
 | 
				
			||||||
                      <template >
 | 
					                        active-value="1" active-text="是"
 | 
				
			||||||
                        <span>{{'否'}}</span>
 | 
					                        inactive-value="2" inactive-text="否">
 | 
				
			||||||
                        <el-switch
 | 
					                    </el-switch>
 | 
				
			||||||
                          v-model="productFrom.ifOnlinef"
 | 
					                  </el-form-item>
 | 
				
			||||||
                          @change="handleIfOnlineEitdChange(productFrom)">
 | 
					                </el-col>
 | 
				
			||||||
                        </el-switch>
 | 
					 | 
				
			||||||
                        <span>{{'是' }}</span>
 | 
					 | 
				
			||||||
                      </template>
 | 
					 | 
				
			||||||
                    </td>
 | 
					 | 
				
			||||||
                  </tr>
 | 
					 | 
				
			||||||
                </table>
 | 
					 | 
				
			||||||
              </el-row>
 | 
					              </el-row>
 | 
				
			||||||
          </el-form>
 | 
					          </el-form>
 | 
				
			||||||
          <div slot="footer" class="dialog-footer">
 | 
					          <div slot="footer" class="dialog-footer">
 | 
				
			||||||
| 
						 | 
					@ -567,7 +522,7 @@
 | 
				
			||||||
      </el-dialog>
 | 
					      </el-dialog>
 | 
				
			||||||
      <!-- 商品添加对话框 -->
 | 
					      <!-- 商品添加对话框 -->
 | 
				
			||||||
      <el-dialog :title="titleAddProduct" :visible.sync="openAddProduct" width="1200px" append-to-body>
 | 
					      <el-dialog :title="titleAddProduct" :visible.sync="openAddProduct" width="1200px" append-to-body>
 | 
				
			||||||
        <div class="app-container" id="toolsType">
 | 
					        <div>
 | 
				
			||||||
          <el-row>
 | 
					          <el-row>
 | 
				
			||||||
            <el-form
 | 
					            <el-form
 | 
				
			||||||
              :model="queryAddShopParams"
 | 
					              :model="queryAddShopParams"
 | 
				
			||||||
| 
						 | 
					@ -613,8 +568,7 @@
 | 
				
			||||||
                  <template slot-scope="scope">
 | 
					                  <template slot-scope="scope">
 | 
				
			||||||
                    <span>{{'下架' }}</span>
 | 
					                    <span>{{'下架' }}</span>
 | 
				
			||||||
                    <el-switch
 | 
					                    <el-switch
 | 
				
			||||||
                      v-model="scope.row.putawayState"
 | 
					                      v-model="scope.row.putawayState">
 | 
				
			||||||
                      @change="handlePutawayStateChanges(scope.row)">
 | 
					 | 
				
			||||||
                    </el-switch>
 | 
					                    </el-switch>
 | 
				
			||||||
                    <span>{{ '上架' }}</span>
 | 
					                    <span>{{ '上架' }}</span>
 | 
				
			||||||
                  </template>
 | 
					                  </template>
 | 
				
			||||||
| 
						 | 
					@ -623,8 +577,7 @@
 | 
				
			||||||
                  <template slot-scope="scope">
 | 
					                  <template slot-scope="scope">
 | 
				
			||||||
                    <span>{{ '否'}}</span>
 | 
					                    <span>{{ '否'}}</span>
 | 
				
			||||||
                    <el-switch
 | 
					                    <el-switch
 | 
				
			||||||
                      v-model="scope.row.ifOnline"
 | 
					                      v-model="scope.row.ifOnline">
 | 
				
			||||||
                      @change="handleIfOnlineChanges(scope.row)">
 | 
					 | 
				
			||||||
                    </el-switch>
 | 
					                    </el-switch>
 | 
				
			||||||
                    <span>{{ '是' }}</span>
 | 
					                    <span>{{ '是' }}</span>
 | 
				
			||||||
                  </template>
 | 
					                  </template>
 | 
				
			||||||
| 
						 | 
					@ -724,7 +677,7 @@
 | 
				
			||||||
        isMousemoveId: null,
 | 
					        isMousemoveId: null,
 | 
				
			||||||
        defaultProps: {
 | 
					        defaultProps: {
 | 
				
			||||||
          children: "children",
 | 
					          children: "children",
 | 
				
			||||||
          label: "materialTypeName",
 | 
					          label: "categoryName",
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        keyShopWord:"",//左侧树-关键字查询
 | 
					        keyShopWord:"",//左侧树-关键字查询
 | 
				
			||||||
        putawayStates:[{"putawayState":"1","putawayStateName":"上架"},{"putawayState":"2","putawayStateName":"下架"}],
 | 
					        putawayStates:[{"putawayState":"1","putawayStateName":"上架"},{"putawayState":"2","putawayStateName":"下架"}],
 | 
				
			||||||
| 
						 | 
					@ -895,6 +848,12 @@
 | 
				
			||||||
            return this.checkUrlList.length > 0
 | 
					            return this.checkUrlList.length > 0
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    watch: {
 | 
				
			||||||
 | 
					      // 根据名称筛选部门树
 | 
				
			||||||
 | 
					      keyShopWord(val) {
 | 
				
			||||||
 | 
					        this.$refs.typeTree.filter(val);
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    methods: {
 | 
					    methods: {
 | 
				
			||||||
      handleNumberInput(value){
 | 
					      handleNumberInput(value){
 | 
				
			||||||
        this.inputValue = value.replace(/[^\d.]/g, '');
 | 
					        this.inputValue = value.replace(/[^\d.]/g, '');
 | 
				
			||||||
| 
						 | 
					@ -1110,13 +1069,14 @@
 | 
				
			||||||
            console.log(file)
 | 
					            console.log(file)
 | 
				
			||||||
            this.dialogImageUrl = file.url
 | 
					            this.dialogImageUrl = file.url
 | 
				
			||||||
            this.dialogVisible = true
 | 
					            this.dialogVisible = true
 | 
				
			||||||
        },
 | 
					        }, 
 | 
				
			||||||
 | 
					        //商品类别树
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        getShopTreeData() {
 | 
					        getShopTreeData() {
 | 
				
			||||||
          shopMaterialTreeApi().then((response) => {
 | 
					          let param = {
 | 
				
			||||||
            this.treeShopOptions = this.handleTree(response.rows,'materialTypeId');
 | 
					            goodsType:2
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          shopMaterialTreeApi(param).then((response) => {
 | 
				
			||||||
 | 
					            this.treeShopOptions = response.data
 | 
				
			||||||
            this.addLevel(this.treeShopOptions)
 | 
					            this.addLevel(this.treeShopOptions)
 | 
				
			||||||
            console.log("this.treeOptions",this.treeShopOptions)
 | 
					            console.log("this.treeOptions",this.treeShopOptions)
 | 
				
			||||||
            if(this.treeShopOptions && this.treeShopOptions.length > 0){
 | 
					            if(this.treeShopOptions && this.treeShopOptions.length > 0){
 | 
				
			||||||
| 
						 | 
					@ -1129,34 +1089,8 @@
 | 
				
			||||||
        // 筛选节点 - 左侧树
 | 
					        // 筛选节点 - 左侧树
 | 
				
			||||||
        filterNode(value, data) {
 | 
					        filterNode(value, data) {
 | 
				
			||||||
          if (!value) return true;
 | 
					          if (!value) return true;
 | 
				
			||||||
          return data.materialTypeName.indexOf(value) !== -1;
 | 
					          return data.categoryName.indexOf(value) !== -1;
 | 
				
			||||||
        },
 | 
					        }, 
 | 
				
			||||||
        handleTree(data, idKey, parentIdKey = 'parentId', childrenKey = 'children') {
 | 
					 | 
				
			||||||
            // 用于存储节点数据的Map,以idKey为键
 | 
					 | 
				
			||||||
            const nodeMap = new Map();
 | 
					 | 
				
			||||||
            // 用于存储根节点的数组
 | 
					 | 
				
			||||||
            const rootNodes = [];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            // 遍历数据,构建nodeMap并找到根节点
 | 
					 | 
				
			||||||
            data.forEach(node => {
 | 
					 | 
				
			||||||
                // 将节点添加到nodeMap中,并初始化children为空数组
 | 
					 | 
				
			||||||
                nodeMap.set(node[idKey], { ...node, [childrenKey]: [] });
 | 
					 | 
				
			||||||
                // 如果parentId为null或父节点不存在于nodeMap中,则该节点为根节点
 | 
					 | 
				
			||||||
                if (node[parentIdKey] === null || !nodeMap.has(node[parentIdKey])) {
 | 
					 | 
				
			||||||
                    // 将根节点添加到rootNodes数组中
 | 
					 | 
				
			||||||
                    rootNodes.push(nodeMap.get(node[idKey]));
 | 
					 | 
				
			||||||
                } else {
 | 
					 | 
				
			||||||
                    // 否则,将当前节点添加到其父节点的children列表中
 | 
					 | 
				
			||||||
                    // 获取父节点
 | 
					 | 
				
			||||||
                    const parentNode = nodeMap.get(node[parentIdKey]);
 | 
					 | 
				
			||||||
                    // 将当前节点添加到父节点的children列表中
 | 
					 | 
				
			||||||
                    parentNode[childrenKey].push(nodeMap.get(node[idKey]));
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            // 返回根节点数组,它现在包含了完整的树形结构
 | 
					 | 
				
			||||||
            return rootNodes;
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        addLevel(nodes, level = 0) {
 | 
					        addLevel(nodes, level = 0) {
 | 
				
			||||||
            nodes.forEach(node => {
 | 
					            nodes.forEach(node => {
 | 
				
			||||||
                node.level = level; // 设置当前节点的层级
 | 
					                node.level = level; // 设置当前节点的层级
 | 
				
			||||||
| 
						 | 
					@ -1214,9 +1148,6 @@
 | 
				
			||||||
            this.resetForm("queryShopForm");
 | 
					            this.resetForm("queryShopForm");
 | 
				
			||||||
            this.handleShopQuery();
 | 
					            this.handleShopQuery();
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /** 商品列表 */
 | 
					        /** 商品列表 */
 | 
				
			||||||
        getShopList() {
 | 
					        getShopList() {
 | 
				
			||||||
            this.loading = true;
 | 
					            this.loading = true;
 | 
				
			||||||
| 
						 | 
					@ -1226,7 +1157,8 @@
 | 
				
			||||||
              "putawayState": this.queryShopParams.putawayState,
 | 
					              "putawayState": this.queryShopParams.putawayState,
 | 
				
			||||||
              "materialName":this.queryShopParams.materialName,
 | 
					              "materialName":this.queryShopParams.materialName,
 | 
				
			||||||
              "barCode":this.queryShopParams.barCode,
 | 
					              "barCode":this.queryShopParams.barCode,
 | 
				
			||||||
              "supermarketId":this.selectSupermarketId
 | 
					              "supermarketId":this.selectSupermarketId,
 | 
				
			||||||
 | 
					              "materialTypeIds": this.$refs.typeTree.getCheckedKeys(),
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            console.log("this.queryShopParams",param)
 | 
					            console.log("this.queryShopParams",param)
 | 
				
			||||||
            shopPageListApi(param).then(response => {
 | 
					            shopPageListApi(param).then(response => {
 | 
				
			||||||
| 
						 | 
					@ -1245,30 +1177,12 @@
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          getShopProductApi(param).then(response => {
 | 
					          getShopProductApi(param).then(response => {
 | 
				
			||||||
              console.log("response.data",response.data)
 | 
					              console.log("response.data",response.data)
 | 
				
			||||||
              this.productFrom=response.data;
 | 
					              this.productFrom=response.data;  
 | 
				
			||||||
              this.productFrom.putawayStatef=this.productFrom.putawayState=="1"?true:false;
 | 
					 | 
				
			||||||
              this.productFrom.ifOnlinef=this.productFrom.ifOnline=="2"?true:false;
 | 
					 | 
				
			||||||
          });
 | 
					          });
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        cancelShopEitd(){
 | 
					        cancelShopEitd(){
 | 
				
			||||||
          this.openProductEitd=false;
 | 
					          this.openProductEitd=false;
 | 
				
			||||||
        },
 | 
					        }, 
 | 
				
			||||||
        handlePutawayStateEitdChange(from){
 | 
					 | 
				
			||||||
           let pws=from.putawayState;
 | 
					 | 
				
			||||||
           if(pws=="1"){
 | 
					 | 
				
			||||||
             this.productFrom.putawayState="2";
 | 
					 | 
				
			||||||
           }else if(pws=="2"){
 | 
					 | 
				
			||||||
             this.productFrom.putawayState="1";
 | 
					 | 
				
			||||||
           }
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        handleIfOnlineEitdChange(from){
 | 
					 | 
				
			||||||
           let pws=from.ifOnline;
 | 
					 | 
				
			||||||
           if(pws=="1"){
 | 
					 | 
				
			||||||
             this.productFrom.ifOnline="2";
 | 
					 | 
				
			||||||
           }else if(pws=="2"){
 | 
					 | 
				
			||||||
             this.productFrom.ifOnline="1";
 | 
					 | 
				
			||||||
           }
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        handlePutawayStateChange(row){
 | 
					        handlePutawayStateChange(row){
 | 
				
			||||||
           let pws=row.putawayState;
 | 
					           let pws=row.putawayState;
 | 
				
			||||||
           let param={}
 | 
					           let param={}
 | 
				
			||||||
| 
						 | 
					@ -1304,12 +1218,6 @@
 | 
				
			||||||
           eitdShopProductApi(param).then(response => {
 | 
					           eitdShopProductApi(param).then(response => {
 | 
				
			||||||
             this.getShopList();
 | 
					             this.getShopList();
 | 
				
			||||||
           });
 | 
					           });
 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        handlePutawayStateChanges(row){
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        handleIfOnlineChanges(row){
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        submitShopEitd(){
 | 
					        submitShopEitd(){
 | 
				
			||||||
          console.log("this.productFrom",this.productFrom)
 | 
					          console.log("this.productFrom",this.productFrom)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -85,7 +85,6 @@
 | 
				
			||||||
                    </el-table-column>
 | 
					                    </el-table-column>
 | 
				
			||||||
                    <el-table-column label="中标供应商" align="center" prop="supplierName" :show-overflow-tooltip="true"/>
 | 
					                    <el-table-column label="中标供应商" align="center" prop="supplierName" :show-overflow-tooltip="true"/>
 | 
				
			||||||
                    <el-table-column label="最近一次供货" align="center">
 | 
					                    <el-table-column label="最近一次供货" align="center">
 | 
				
			||||||
                        <!-- <el-table-column label="供应商名称" align="center" prop="lastOrderGoodsSupplierName" width="120" :show-overflow-tooltip="true" />  -->
 | 
					 | 
				
			||||||
                        <el-table-column label="时间" align="center" prop="lastOrderGoodsDate" width="160" :show-overflow-tooltip="true" /> 
 | 
					                        <el-table-column label="时间" align="center" prop="lastOrderGoodsDate" width="160" :show-overflow-tooltip="true" /> 
 | 
				
			||||||
                        <el-table-column label="价格" align="center" prop="lastOrderGoodsPrice" width="120" :show-overflow-tooltip="true" >
 | 
					                        <el-table-column label="价格" align="center" prop="lastOrderGoodsPrice" width="120" :show-overflow-tooltip="true" >
 | 
				
			||||||
                            <template slot-scope="scope">
 | 
					                            <template slot-scope="scope">
 | 
				
			||||||
| 
						 | 
					@ -389,22 +388,39 @@ export default {
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        changSupplier(row){
 | 
					        changSupplier(row){
 | 
				
			||||||
            console.log(row)
 | 
					            console.log(row)
 | 
				
			||||||
            let param = [   
 | 
					            if(row.ifSupply){
 | 
				
			||||||
                {   
 | 
					                let param = [   
 | 
				
			||||||
                    "id":row.id,
 | 
					                    {   
 | 
				
			||||||
                    "canteenId": row.canteenId,
 | 
					                        "id":row.id,
 | 
				
			||||||
                    "supplierId": row.supplierId,
 | 
					                        "canteenId": row.canteenId,
 | 
				
			||||||
                    "materialId": row.materialId,
 | 
					                        "supplierId": row.supplierId,
 | 
				
			||||||
                    "alternativeSuppliers": row.alternativeSuppliers,
 | 
					                        "materialId": row.materialId,
 | 
				
			||||||
                    "ifSupply": row.ifSupply
 | 
					                        "alternativeSuppliers": row.alternativeSuppliers,
 | 
				
			||||||
                } 
 | 
					                        "ifSupply": row.ifSupply
 | 
				
			||||||
            ]
 | 
					                    } 
 | 
				
			||||||
            editSupplierBindMaterialApi(param).then(response => {
 | 
					                ]
 | 
				
			||||||
                this.$modal.msgSuccess("修改成功"); 
 | 
					                editSupplierBindMaterialApi(param).then(response => {
 | 
				
			||||||
                this.getList();
 | 
					                    this.$modal.msgSuccess("修改成功");
 | 
				
			||||||
            }); 
 | 
					                }); 
 | 
				
			||||||
 | 
					            }else{
 | 
				
			||||||
 | 
					                let param = [   
 | 
				
			||||||
 | 
					                    {   
 | 
				
			||||||
 | 
					                        "id":row.id,
 | 
				
			||||||
 | 
					                        "canteenId": row.canteenId,
 | 
				
			||||||
 | 
					                        "supplierId": row.supplierId,
 | 
				
			||||||
 | 
					                        "materialId": row.materialId,
 | 
				
			||||||
 | 
					                        "alternativeSuppliers": row.alternativeSuppliers,
 | 
				
			||||||
 | 
					                        "ifSupply": row.ifSupply
 | 
				
			||||||
 | 
					                    } 
 | 
				
			||||||
 | 
					                ]
 | 
				
			||||||
 | 
					                addSupplierBindMaterialApi(param).then(response => {
 | 
				
			||||||
 | 
					                    this.getList();
 | 
				
			||||||
 | 
					                }); 
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					       
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        changSupplierList(row){
 | 
					        changSupplierList(row){
 | 
				
			||||||
 | 
					            console.log(row)
 | 
				
			||||||
            let param = [   
 | 
					            let param = [   
 | 
				
			||||||
                {   
 | 
					                {   
 | 
				
			||||||
                    "id":row.id,
 | 
					                    "id":row.id,
 | 
				
			||||||
| 
						 | 
					@ -422,10 +438,17 @@ export default {
 | 
				
			||||||
            }else{
 | 
					            }else{
 | 
				
			||||||
                param[0].alternativeSuppliers=[]
 | 
					                param[0].alternativeSuppliers=[]
 | 
				
			||||||
            } 
 | 
					            } 
 | 
				
			||||||
            editSupplierBindMaterialApi(param).then(response => {
 | 
					            if(row.ifSupply){ 
 | 
				
			||||||
                // this.$modal.msgSuccess("修改成功"); 
 | 
					                editSupplierBindMaterialApi(param).then(response => {
 | 
				
			||||||
                // this.getList();
 | 
					                    // this.$modal.msgSuccess("修改成功"); 
 | 
				
			||||||
            });  
 | 
					                    // this.getList();
 | 
				
			||||||
 | 
					                });  
 | 
				
			||||||
 | 
					            }else{
 | 
				
			||||||
 | 
					                addSupplierBindMaterialApi(param).then(response => {
 | 
				
			||||||
 | 
					                    // this.$modal.msgSuccess("修改成功"); 
 | 
				
			||||||
 | 
					                    this.getList();
 | 
				
			||||||
 | 
					                });  
 | 
				
			||||||
 | 
					            } 
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        // 多选框选中数据
 | 
					        // 多选框选中数据
 | 
				
			||||||
        handleSelectionChange(selection) {
 | 
					        handleSelectionChange(selection) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue