shish 2 лет назад
Родитель
Сommit
cbe6cc837a
2 измененных файлов с 54 добавлено и 4 удалено
  1. 48 4
      ghsApp/src/admin/item/detail.vue
  2. 6 0
      ghsApp/src/api/item/index.js

+ 48 - 4
ghsApp/src/admin/item/detail.vue

@@ -167,6 +167,11 @@
           </view>
           </view>
         </tui-list-cell>
         </tui-list-cell>
 
 
+        <tui-list-cell class="line-cell" :arrow="true">
+          <view class="tui-title">采购人</view>
+          <view @click="changeCgStaff()">{{ productData.cgStaffName?productData.cgStaffName:'未设置' }}</view>
+        </tui-list-cell>
+
       </view>
       </view>
 
 
       <view class="module-com input-line-wrap goods-wrap">
       <view class="module-com input-line-wrap goods-wrap">
@@ -301,7 +306,9 @@
         <view style="width:100vw;margin-top:8upx;" v-if="productData.delStatus == 1"><button @click="changeDelStatus(productData,0)">取消删除</button></view>
         <view style="width:100vw;margin-top:8upx;" v-if="productData.delStatus == 1"><button @click="changeDelStatus(productData,0)">取消删除</button></view>
 				<view style="width:100vw;margin-top:30upx;"><button @click="closeMoreDoPop()">取消</button></view>
 				<view style="width:100vw;margin-top:30upx;"><button @click="closeMoreDoPop()">取消</button></view>
 			</view>
 			</view>
-		</uni-popup>		<modal-module :show="wasteShow" @click="wasteConfirm" :maskClosable="true" title="损耗数量" padding="30rpx 30rpx" >
+		</uni-popup>
+
+    <modal-module :show="wasteShow" @click="wasteConfirm" :maskClosable="true" title="损耗数量" padding="30rpx 30rpx" >
       <template v-slot:content>
       <template v-slot:content>
         <div class="app-modal-input-wrap">
         <div class="app-modal-input-wrap">
         <div class="inp-list-line">
         <div class="inp-list-line">
@@ -311,14 +318,28 @@
         </div>
         </div>
         </div>
         </div>
       </template>
       </template>
-		</modal-module>  </view>
+		</modal-module>
+
+		<uni-popup ref="staffRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+			<view style="max-height:90vh;overflow: scroll;">
+				<view style="margin-left:30upx;margin-top:19upx;font-size:27upx;font-weight:bold;">请选择:</view>
+				<view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
+					<view v-for="(item, index) in staffData" :key="index" @tap.stop="getStaff(item)" style="margin-bottom:20upx;margin-left:3upx;">
+						<view style="margin-top:8upx;overflow: hidden;white-space: nowrap;width:120upx;text-align:center;font-weight:bold;font-size:30upx;">{{item.name}}</view>
+					</view>
+				</view>
+				<view style="text-align:center;padding:10upx 0 10upx 0;"><button class="admin-button-com big blue" @click="cancelStaff()">取消选择</button></view>
+			</view>
+    </uni-popup>
+
+  </view>
 </template>
 </template>
 
 
 <script>
 <script>
 import TuiListCell from "@/components/plugin/list-cell";
 import TuiListCell from "@/components/plugin/list-cell";
 const form = require("@/utils/formValidation.js");
 const form = require("@/utils/formValidation.js");
 import { getAllItemClass } from "@/api/item-class";
 import { getAllItemClass } from "@/api/item-class";
-import { applyAuth } from '@/api/item';
+import { applyAuth,modifyCgStaff } from '@/api/item';
 import { delCpItem,addCpItem } from '@/api/cp'
 import { delCpItem,addCpItem } from '@/api/cp'
 import { getAllUnit } from "@/api/unit";
 import { getAllUnit } from "@/api/unit";
 import { addProduct,updateProduct,getProductDetail,py,print,modifyOnStockFn,delStatusUpdate,changeBelongCost } from "@/api/product";
 import { addProduct,updateProduct,getProductDetail,py,print,modifyOnStockFn,delStatusUpdate,changeBelongCost } from "@/api/product";
@@ -328,6 +349,7 @@ import { mapGetters } from "vuex"
 //图片上传插件来源:https://ext.dcloud.net.cn/plugin?id=2922 已改造,不能再升级 shish 20211228
 //图片上传插件来源:https://ext.dcloud.net.cn/plugin?id=2922 已改造,不能再升级 shish 20211228
 import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue'
 import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue'
 import ModalModule from "@/components/plugin/modal"
 import ModalModule from "@/components/plugin/modal"
+import { getAllStaff } from "@/api/shop-admin";
 export default {
 export default {
   name: "item-detail",
   name: "item-detail",
   components: {
   components: {
@@ -391,7 +413,8 @@ export default {
       backCpInfo:{cpId:0,cpName:'',needUpdate:0},      wasteNum:'',
       backCpInfo:{cpId:0,cpName:'',needUpdate:0},      wasteNum:'',
       wasteShow:false,
       wasteShow:false,
       wasteFocus:false,
       wasteFocus:false,
-      belongCost:0
+      belongCost:0,
+      staffData:[]
     };
     };
   },
   },
 	computed:{
 	computed:{
@@ -410,6 +433,12 @@ export default {
 		prevPage.$vm.onShowRefresh = 1
 		prevPage.$vm.onShowRefresh = 1
     prevPage.$vm.hasRequest = 0
     prevPage.$vm.hasRequest = 0
 
 
+		getAllStaff().then(res=>{
+			if(res.code == 1){
+				this.staffData = res.data.list ? res.data.list : []
+			}
+		})
+
   },
   },
   onShow(){
   onShow(){
     let that = this
     let that = this
@@ -437,6 +466,21 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
+    getStaff(staff){
+      this.$refs.staffRef.close()
+      modifyCgStaff({id:this.productData.id,staffId:staff.id}).then(res=>{
+        if(res.code == 1){
+          this.$msg(res.msg)
+          this.getDetail()
+        }
+      })
+    },
+    cancelStaff(){
+      this.$refs.staffRef.close()
+    },
+		changeCgStaff(){
+			this.$refs.staffRef.open('center')
+		},
     delOneCp(info,index){
     delOneCp(info,index){
       let that = this
       let that = this
       that.$util.confirmModal({content:'确认删除'+info.cpName+'?'},() => {
       that.$util.confirmModal({content:'确认删除'+info.cpName+'?'},() => {

+ 6 - 0
ghsApp/src/api/item/index.js

@@ -1,5 +1,11 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 import https from '@/plugins/luch-request_0.0.7/request'
 
 
+//单个花材采购人修改
+export const modifyCgStaff = data => {
+	return https.get('/item/modify-cg-staff', data)
+}
+
+//批量修改某人负责的花材换成别人
 export const changeCgStaff = data => {
 export const changeCgStaff = data => {
 	return https.get('/item/change-cg-staff', data)
 	return https.get('/item/change-cg-staff', data)
 }
 }