浏览代码

Merge branch 'master' of ssh://gogs.zfire.top:2222/zfire-front/zfire-newmall-admin

linwenxin 1 年之前
父节点
当前提交
c133e11283

+ 6 - 2
src/api/auxiliaryFittings/attachmentProfile.js

@@ -46,11 +46,11 @@ export function getDetail(params) {
 }
 
 // 上下架
-export function updateStatus(data) {
+export function updateStatus(params) {
   return request({
     url: `/websit/goods/batch/update/status`,
     method: 'post',
-    data
+    params
   })
 }
 
@@ -70,4 +70,8 @@ export function getCategoryList(params) {
     method: 'get',
     params
   })
+}
+
+export function listImport(data) {
+	return handleImport('/dictCompany/importExcel', data.formdata, data.id || '')
 }

+ 138 - 48
src/views/auxiliaryFittings/attachmentProfile/index.vue

@@ -58,22 +58,23 @@ export default {
 					}
 				}
 			]
-		],[
-          [
-            {
-              name: '下载导入模板',
-              click: this.handleDownload
-            }
-          ],
-          [
-            {
-              name: '导入模板',
-              render: () => {
-                return this.importButton(listImport, '导入模板')
-              }
-            }
-          ],
-        ],
+		],
+		// [
+  //         [
+  //           {
+  //             name: '下载导入模板',
+  //             click: this.handleDownload
+  //           }
+  //         ],
+  //         [
+  //           {
+  //             name: '导入模板',
+  //             render: () => {
+  //               return this.importButton(listImport, '导入模板')
+  //             }
+  //           }
+  //         ],
+  //       ],
 	  ],
       // 表格属性
       tableAttributes: {
@@ -97,7 +98,7 @@ export default {
 		goodsCode: '',
 		goodsName: '',
 		normType: 'M',
-		stateEnum: 'ON',
+		status: 'ON',
 		categoryList: [],
 		brandList: [],
 		marketPrice: '',
@@ -118,6 +119,28 @@ export default {
     moreParameters() {
       return []
     },
+	
+	//加法 
+	accAdd(){
+		return function(arg1,arg2){
+			var r1,r2,m;
+			try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0} 
+			try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0} 
+			m=Math.pow(10,Math.max(r1,r2)) 
+			return (arg1*m+arg2*m)/m 
+		}
+	},
+	//减法 
+	Subtr(){ 
+		return function(arg1,arg2){
+			var r1,r2,m,n;
+			try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0} 
+			try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0} 
+			m=Math.pow(10,Math.max(r1,r2)); 
+			n=(r1>=r2)?r1:r2; 
+			return ((arg1*m-arg2*m)/m).toFixed(2); 
+		}
+	},
     formItems() {
       return [{
         md: 12,
@@ -136,13 +159,13 @@ export default {
         attributes: { },
         formItemAttributes: {
           label: '状态',
-          prop: 'stateEnum',
+          prop: 'status',
           rules: [...required]
         },
 		render: (h, { props, onInput }) => {
 			var { value } = props
 			return (
-				<el-radio-group v-model={this.formData.stateEnum}>
+				<el-radio-group v-model={this.formData.status}>
 				    <el-radio disabled={this.formDialogType==2} label="ON">上架</el-radio>
 				    <el-radio disabled={this.formDialogType==2} label="OFF">下架</el-radio>
 				</el-radio-group>
@@ -233,7 +256,7 @@ export default {
         }
       }, {
         md: 12,
-        isShow: true,
+        isShow: this.formData.normType == 'M'?true:false,
         name: 'slot-component',
         attributes: { placeholder: '请输入', type: 'number' },
         formItemAttributes: {
@@ -246,17 +269,7 @@ export default {
 			return (
 				<div style="position: relative;">
 					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-						<el-input v-model={this.formData.marketPrice} onChange={(e)=>{
-							if(this.formData.selfWorkerAmount > e){
-								this.formData.marketPrice = ''
-								return this.$message.warning('自有库存师傅分账金额必须小于销售价格!');
-							}else if(this.formData.outWorkerAmount > e){
-								this.formData.outWorkerAmount = ''
-								return this.$message.warning('外购辅材师傅分账金额必须小于销售价格!');
-							}
-							this.formData.selfWebsitAmount = e - this.formData.selfWorkerAmount
-							this.formData.outWebsitAmount = e - this.formData.outWorkerAmount
-						}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
+						<el-input v-model={this.formData.marketPrice} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
 					</div>
 					<div style="color: #EA8000">注:维护网点销售给师傅的价格</div>
 				</div>
@@ -264,7 +277,7 @@ export default {
 		}
       }, {
         md: 12,
-        isShow: true,
+        isShow: this.formData.normType == 'M'?true:false,
         name: 'slot-component',
         attributes: { placeholder: '请输入', type: 'number' },
         formItemAttributes: {
@@ -277,7 +290,18 @@ export default {
 			return (
 				<div style="position: relative;">
 					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
-						<el-input v-model={this.formData.normAmount} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
+						<el-input v-model={this.formData.normAmount} onChange={(e)=>{
+							this.formData.normAmount = Number(e).toFixed(2)
+							if(this.formData.selfWorkerAmount > e){
+								this.formData.normAmount = ''
+								return this.$message.warning('自有库存师傅分账金额必须小于收费标准!');
+							}else if(this.formData.outWorkerAmount > e){
+								this.formData.outWorkerAmount = ''
+								return this.$message.warning('外购辅材师傅分账金额必须小于收费标准!');
+							}
+							this.formData.selfWebsitAmount = this.Subtr(e,this.formData.selfWorkerAmount)
+							this.formData.outWebsitAmount = this.Subtr(e,this.formData.outWorkerAmount)
+						}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
 					</div>
 					<div style="color: #EA8000">注:分账金额需扣除手续费0.6%</div>
 				</div>
@@ -285,7 +309,7 @@ export default {
 		}
       }, {
         md: 12,
-        isShow: true,
+        isShow: this.formData.normType == 'M'?true:false,
         name: 'slot-component',
         attributes: { placeholder: '请输入', type: 'number' },
         formItemAttributes: {
@@ -300,11 +324,12 @@ export default {
 				<div style="position: relative;">
 					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
 						<el-input v-model={this.formData.selfWorkerAmount} onChange={(e)=>{
-							if(e && (Number(e) > Number(that.formData.marketPrice))){
+							this.formData.selfWorkerAmount = Number(this.formData.selfWorkerAmount).toFixed(2)
+							if(e && (Number(e) > Number(that.formData.normAmount))){
 								that.formData.selfWorkerAmount = ''
-								return this.$message.warning('自有库存师傅分账金额必须小于销售价格!');
+								return this.$message.warning('自有库存师傅分账金额必须小于收费标准!');
 							}
-							that.formData.selfWebsitAmount = that.formData.marketPrice - e
+							that.formData.selfWebsitAmount =  this.Subtr(that.formData.normAmount,e)
 						}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
 					</div>
 				</div>
@@ -312,7 +337,39 @@ export default {
 		}
       }, {
         md: 12,
-        isShow: true,
+        isShow: this.formData.normType == 'M'?false:true,
+        name: 'slot-component',
+        attributes: { placeholder: '请输入', type: 'number' },
+        formItemAttributes: {
+          label: '师傅分账比例',
+          prop: 'selfWorkerAmount',
+          rules: [...required]
+        },
+		render: (h, { props, onInput }) => {
+			var { value } = props
+			const that = this
+			return (
+				<div style="position: relative;">
+					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+						<el-input v-model={this.formData.selfWorkerAmount} onChange={(e)=>{
+							this.formData.selfWorkerAmount = Number(this.formData.selfWorkerAmount).toFixed(2)
+							if(e && (Number(e) < 0)){
+								return this.$message.warning('师傅分账比例不能为0!');
+							}
+							if(e && (this.accAdd(Number(e),Number(that.formData.selfWebsitAmount)) >100)){
+								this.formData.selfWorkerAmount = 0
+								return this.$message.warning('网点与师傅分账比例和最大只能100%!');
+							}else{
+								that.formData.selfWebsitAmount = this.Subtr(100,e)
+							}
+						}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">%</span>
+					</div>
+				</div>
+			)
+		}
+      }, {
+        md: 12,
+        isShow: this.formData.normType == 'M'?true:false,
         name: 'slot-component',
         attributes: { placeholder: '请输入', type: 'number' },
         formItemAttributes: {
@@ -327,11 +384,12 @@ export default {
 				<div style="position: relative;">
 					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
 						<el-input v-model={this.formData.outWorkerAmount} onChange={(e)=>{
-							if(Number(e) > Number(that.formData.marketPrice)){
+							this.formData.outWorkerAmount = Number(this.formData.outWorkerAmount).toFixed(2)
+							if(Number(e) > Number(that.formData.normAmount)){
 								this.formData.outWorkerAmount = ''
-								return this.$message.warning('外购辅材师傅分账金额必须小于销售价格!');
+								return this.$message.warning('外购辅材师傅分账金额必须小于收费标准!');
 							}
-							this.formData.outWebsitAmount = this.formData.marketPrice - e
+							this.formData.outWebsitAmount = this.Subtr(this.formData.normAmount,e)
 						}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">元</span>
 					</div>
 				</div>
@@ -339,7 +397,7 @@ export default {
 		}
       }, {
         md: 12,
-        isShow: true,
+        isShow: this.formData.normType == 'M'?true:false,
         name: 'slot-component',
         attributes: { placeholder: '请输入', type: 'number' },
         formItemAttributes: {
@@ -359,7 +417,39 @@ export default {
 		}
       }, {
         md: 12,
-        isShow: true,
+        isShow: this.formData.normType == 'M'?false:true,
+        name: 'slot-component',
+        attributes: { placeholder: '请输入', type: 'number' },
+        formItemAttributes: {
+          label: '网点分账比例',
+          prop: 'selfWebsitAmount',
+          rules: [...required]
+        },
+		render: (h, { props, onInput }) => {
+			var { value } = props
+			const that = this
+			return (
+				<div style="position: relative;">
+					<div style="display: flex;justify-content: space-around;align-items: center;position: relative;">
+						<el-input v-model={this.formData.selfWebsitAmount} onChange={(e)=>{
+							this.formData.selfWebsitAmount = Number(this.formData.selfWebsitAmount).toFixed(2)
+							if(e && (Number(e) < 0)){
+								return this.$message.warning('网点分账比例不能为0!');
+							}
+							if(e && (this.accAdd(Number(e),Number(that.formData.selfWorkerAmount)) >100)){
+								this.formData.selfWebsitAmount = 0
+								return this.$message.warning('网点与师傅分账比例和最大只能100%!');
+							}else{
+								that.formData.selfWorkerAmount = this.Subtr(100,e)
+							}
+						}} type="number" placeholder="请输入"></el-input><span style="margin-left: 10px;">%</span>
+					</div>
+				</div>
+			)
+		}
+      }, {
+        md: 12,
+        isShow: this.formData.normType == 'M'?true:false,
         name: 'slot-component',
         attributes: { placeholder: '请输入', type: 'number' },
         formItemAttributes: {
@@ -467,22 +557,22 @@ export default {
       this.$data.formData = this.$options.data().formData
       this.formDialog = false
     },
-	updateStatus(stateEnum){
+	updateStatus(status){
 		if(this.recordSelected.length == 0){
 			return this.$message.warning('请至少勾选一条数据!');
 		}
 		console.log(this.recordSelected)
-		this.$confirm(`请确认是否${stateEnum=='OFF'?'下架':'上架'}该配件, 是否继续?`, '提示', {
+		this.$confirm(`请确认是否${status=='OFF'?'下架':'上架'}该配件, 是否继续?`, '提示', {
 			confirmButtonText: '确定',
 			cancelButtonText: '取消',
 			type: 'warning'
 		}).then(() => {
 			updateStatus({
-				stateEnum,
-				ids: this.recordSelected.map(item=>{return item.goodsId})
+				status,
+				ids: this.recordSelected.map(item=>{return item.goodsId}).join(',')
 			}).then(res => {
 				if (res.code == 200) {
-					this.$message({ type: 'success', message: `${stateEnum=='ON'?'下架':'上架'}成功!` })
+					this.$message({ type: 'success', message: `${status=='ON'?'上架':'下架'}成功!` })
 					this.$refs.pageRef.refreshList()
 				} else {
 					this.$message.error(res.msg);

+ 1 - 1
src/views/auxiliaryFittings/salesManagement/attachmentNewReturn/index.vue

@@ -77,7 +77,7 @@ export default {
 	backList() {
 		this.id = ''
 		this.formDialog = false;
-		this.getList()
+		this.$refs.pageRef.refreshList()
 	},
     // 列表请求函数
 	getList(p) {

+ 1 - 1
src/views/auxiliaryFittings/salesManagement/attachmentOldReturn/index.vue

@@ -77,7 +77,7 @@ export default {
 	backList() {
 		this.id = ''
 		this.formDialog = false;
-		this.getList()
+		this.$refs.pageRef.refreshList()
 	},
     // 列表请求函数
 	getList(p) {

+ 1 - 1
src/views/auxiliaryFittings/salesManagement/attachmentSalesOrder/index.vue

@@ -77,7 +77,7 @@ export default {
 	},
 	backList() {
 		this.formDialog = false;
-		this.getList()
+		this.$refs.pageRef.refreshList()
 	},
     // 列表请求函数
 	getList(p) {

+ 8 - 3
src/views/auxiliaryFittings/salesManagement/auxiliaryAdjustPriceOrder/index.vue

@@ -77,7 +77,7 @@ export default {
 	backList() {
 		this.id = ''
 		this.formDialog = false;
-		this.getList()
+		this.$refs.pageRef.refreshList()
 	},
     // 列表请求函数
 	getList(p) {
@@ -105,11 +105,16 @@ export default {
     operation(h, { row, index, column }) {
       return (
         <div class='operation-btns'>
-		  <el-button type="text" onClick={() => {
+		  {row.flag == 'SAVE'?<el-button type="text" onClick={() => {
 			this.id = row.sheetId
 		    this.formDialogType = 1
 		    this.openForm()
-		  }}>编辑</el-button>
+		  }}>编辑</el-button>:null}
+		  {row.flag == 'OK'?<el-button type="text" onClick={() => {
+		  	this.id = row.sheetId
+		    this.formDialogType = 2
+		    this.openForm()
+		  }}>详情</el-button>:null}
         </div>
       )
     },

+ 1 - 1
src/views/auxiliaryFittings/salesManagement/auxiliarySalesOrder/index.vue

@@ -78,7 +78,7 @@ export default {
 	backList() {
 		this.id = ''
 		this.formDialog = false;
-		this.getList()
+		this.$refs.pageRef.refreshList()
 	},
     // 列表请求函数
 	getList(p) {

+ 1 - 1
src/views/auxiliaryFittings/salesManagement/auxiliarySalesReturnOrder/index.vue

@@ -77,7 +77,7 @@ export default {
 	backList() {
 		this.id = ''
 		this.formDialog = false;
-		this.getList()
+		this.$refs.pageRef.refreshList()
 	},
     // 列表请求函数
 	getList(p) {

+ 2 - 1
src/views/auxiliaryFittings/salesManagement/components/auxiliaryAdjustPriceOrderDetail.vue

@@ -173,6 +173,7 @@
 					createTime: '',
 					confirmBy: '',
 					confirmTime: '',
+					remark: ''
 				},
 				productCategory: {},
 				goodsCategory: {},
@@ -377,7 +378,7 @@
 				});
 			},
 			submit(){
-				this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
 					if (valid) {
 						if(this.formType == 0){
 							add({

+ 9 - 1
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

@@ -191,7 +191,7 @@
 				<el-button v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')" size="small" type="primary" @click="save()">保存</el-button>
 				<el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()">提交</el-button>
 				<el-button v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'" size="small" type="primary" @click="wxPay()">微信支付</el-button>
-				<el-button v-if="formData.flag == 'PAY_NOT_TAKE'" size="small" type="primary"  @click="confirm()">确认货</el-button>
+				<el-button v-if="formData.flag == 'PAY_NOT_TAKE'" size="small" type="primary"  @click="confirm()">确认货</el-button>
 				<el-button size="small" type="info" @click="goBack">返回</el-button>
 			</div>
 		</div>
@@ -245,6 +245,7 @@
 					payType: ''
 				},
 				isEdit: 0,
+				is_submit: true,
 				companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
 				rules: {
 					websitId: [
@@ -469,6 +470,13 @@
 				});
 			},
 			wxPay(){
+				if(!this.is_submit){
+					return false
+				}
+				this.is_submit = false
+				setTimeout(()=>{
+					this.is_submit = true
+				},3000)
 				getCode({
 					salesId: this.formData.salesId
 				}).then(res => {

+ 9 - 0
src/views/userManagement/distributorManagement/index.vue

@@ -203,6 +203,15 @@ export default {
     exportList: memberPageExport,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
+		if (item.jname === 'idCardImg') {
+		    defaultData.render = (h, { row, index, column }) => {
+		      return (
+		        <div style="padding:0 6px;cursor: pointer;">
+		          {row.idCardImg ? row.idCardImg.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
+		          </div>
+		      )
+		    }
+		}
       return defaultData
     },
     // 监听勾选变化