Commit 84aa90da authored by 张子雨's avatar 张子雨

Merge branch 'feat/sentry0616' into feature/meal-3.0

* feat/sentry0616:
  feat: 解决senty问题
  feat: 修改sentry
  feat: 解决sentry问题
  feat: 解决sentry问题
  feat: 修复sentry问题
parents 77ccf63b f932ffea
import RoleType, { isPlatForm } from './role.config';
const isProduction = process.env.NODE_ENV === 'production';
const isPre = process.env.PRE_ENV === 'pre';
const environment = 'yxm2';
const environment = 'sc';
const envAPi = {
api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net',
......
......@@ -17,12 +17,12 @@ const Model = {
const productCategoryId = payload?.productCategoryId || [];
params.productCategoryId =
(productCategoryId.length && productCategoryId[productCategoryId.length - 1]) || '';
const { data } = yield call(api.searchList, params);
if (!data) return;
const res = yield call(api.searchList, params);
if (res && !res.data) return;
yield put({
type: 'saveData',
payload: {
tableData: data,
tableData: res.data,
},
});
},
......
......@@ -30,9 +30,13 @@ class toExamine extends Component {
if (err) {
return;
}
if (!values?.fileList[0]?.url) {
notification.error({ message: '请上传发票错误,请重新上传' });
return;
}
const params = {
filePath: values?.fileList[0].url,
fileName: values?.fileList[0].name,
fileName: values?.fileList[0]?.name || '',
id,
};
const data = await uploadBill(params);
......
......@@ -62,6 +62,10 @@ class PicturesWall extends React.Component {
const vm = this;
// eslint-disable-next-line new-cap
const data = `${UUID.createUUID()}.${suffix}`;
if (!token) {
message.error('上传失败,请刷新页面重试!');
return;
}
const observable = qiniu.upload(file, data, token);
const observer = {
next() {
......@@ -121,7 +125,9 @@ class PicturesWall extends React.Component {
customRequest={this.customRequest}
listType="text"
fileList={fileList}
disabled={status !== 1}
onRemove={status === 1 ? this.clearFileList : ''}
accept=".pdf,.doc,.docx,.zip,.rar,.png,.jpeg"
>
{max && fileList.length >= max ? null : uploadButton}
</Upload>
......
......@@ -147,7 +147,7 @@ const FormAttr = forwardRef((props, ref) => {
if (typeof values[item] === 'string') {
obj.productAttributeApplyValueList = JSON.parse(values[item]);
} else {
obj.productAttributeApplyValueList = values[item].map(v => JSON.parse(v));
obj.productAttributeApplyValueList = values[item]?.map(v => JSON.parse(v)) || [];
}
return obj;
});
......
......@@ -10,7 +10,7 @@ const FormItem = Form.Item;
const { Option } = Select;
const LogisticsForm = props => {
const { modalVisible, onCancel, companys = [], skuList, onSubmit } = props;
const { modalVisible, onCancel, company = [], skuList, onSubmit } = props;
const { getFieldDecorator } = props.form;
const [result, setResult] = useState(() => props.value);
const formData = async (formDataList, fieldsValue, suffixes) => {
......@@ -127,14 +127,14 @@ const LogisticsForm = props => {
],
})(
<Select showSearch placeholder="请选择物流公司">
{companys.map(item => (
{company?.map(item => (
<Option
value={`${item.expressCompanyCode}-${item.expressCompanyName}`}
key={item.expressCompanyCode}
>
{item.expressCompanyName}
</Option>
))}
)) || []}
</Select>,
)}
</FormItem>
......
......@@ -248,51 +248,54 @@ const UpdateStatusModal = (props, ref) => {
const onOk = async () => {
const submitApi = oldPackageList.length === 0 ? apiDeliveriesAdd : apiDeliveriesEdit;
formRef.current.form.validateFields().then(async values => {
const packageList = onFilterParams(values.packageList);
formRef.current.form
.validateFields()
.then(async values => {
const packageList = onFilterParams(values.packageList);
// 对比修改差异
oldPackageList.forEach((item, index) => {
if (!packageList[index]) return;
const updateAttr = () => {
packageList[index].preExpressCompanyCode = item.expressCompanyCode;
packageList[index].preExpressCompanyName = item.expressCompanyName;
packageList[index].preExpressNo = item.expressNo;
};
// eslint-disable-next-line no-restricted-syntax
// for (const key in item) {
// if (typeof item[key] !== 'object' && item[key] !== packageList[index][key]) {
// console.log('修改了物流信息');
// updateAttr();
// break;
// } else if (
// typeof item[key] === 'object' &&
// JSON.stringify(item[key]) !== JSON.stringify(packageList[index][key])
// ) {
// console.log('修改了选择的商品');
// updateAttr();
// break;
// }
// }
updateAttr();
});
// 对比修改差异
oldPackageList.forEach((item, index) => {
if (!packageList[index]) return;
const updateAttr = () => {
packageList[index].preExpressCompanyCode = item.expressCompanyCode;
packageList[index].preExpressCompanyName = item.expressCompanyName;
packageList[index].preExpressNo = item.expressNo;
};
const params = {
orderNo: record.orderNo,
packageList,
};
setConfirmLoading(true);
const res = await submitApi(params);
setConfirmLoading(false);
if (res.code === '0000' && res.businessCode === '0000') {
notification.success({
message: '提交成功',
// eslint-disable-next-line no-restricted-syntax
// for (const key in item) {
// if (typeof item[key] !== 'object' && item[key] !== packageList[index][key]) {
// console.log('修改了物流信息');
// updateAttr();
// break;
// } else if (
// typeof item[key] === 'object' &&
// JSON.stringify(item[key]) !== JSON.stringify(packageList[index][key])
// ) {
// console.log('修改了选择的商品');
// updateAttr();
// break;
// }
// }
updateAttr();
});
onCancel();
actionRef.current.reload();
}
});
const params = {
orderNo: record.orderNo,
packageList,
};
setConfirmLoading(true);
const res = await submitApi(params);
setConfirmLoading(false);
if (res?.code === '0000' && res?.businessCode === '0000') {
notification.success({
message: '提交成功',
});
onCancel();
actionRef.current.reload();
}
})
.catch(err => {});
};
useImperativeHandle(ref, () => ({
......
......@@ -591,7 +591,7 @@ const TableList = props => {
<LogisticsForm
onSubmit={reload}
skuList={skuList}
companys={companys}
company={companys}
onCancel={() => handleModalVisible(false)}
modalVisible={LogisticsModalVisible}
value={LogisticsData}
......
......@@ -12,7 +12,6 @@ class Socket extends EventEmitter {
this.taskRemindInterval = null;
this.connected = false;
this.waitingSendData = [];
this.reconnectCount = 0;
this.heartBeatTimer = null;
return this;
}
......@@ -117,7 +116,9 @@ class Socket extends EventEmitter {
return;
}
const sendValue = typeof value === 'string' ? value : JSON.stringify(value);
this.socket.send(sendValue);
if (this.socket.readyState === this.socket.OPEN) {
this.socket.send(sendValue);
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment